Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Configurations/ParseUnitTests-OSX.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-OSX-Info.plist
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks @executable_path/Frameworks @loader_path/Frameworks

USER_HEADER_SEARCH_PATHS = $(inherited) $(PARSE_DIR)/Parse/Internal/**

// Swift
SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/Tests/Other/Swift/ParseUnitTests-OSX-Bridging-Header.h
3 changes: 0 additions & 3 deletions Configurations/ParseUnitTests-iOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0
INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-iOS-Info.plist

USER_HEADER_SEARCH_PATHS = $(inherited) $(PARSE_DIR)/Parse/Internal/**

// Swift
SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/Tests/Other/Swift/ParseUnitTests-iOS-Bridging-Header.h
6 changes: 0 additions & 6 deletions Parse.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,6 @@
F5B0B30C1B449F1D00F3EBC4 /* PFLocationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E18AE41623835600B17A67 /* PFLocationManager.h */; };
F5B0B30D1B449F1D00F3EBC4 /* PFAsyncTaskQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C8F2BE1B1F7E6B00CD98E7 /* PFAsyncTaskQueue.h */; };
F5B0B30E1B449F1D00F3EBC4 /* PFBaseState.h in Headers */ = {isa = PBXBuildFile; fileRef = F586B34E1B1E3BD70082E3BD /* PFBaseState.h */; };
F5B0B3131B44A05100F3EBC4 /* PFPaymentTransactionObserver_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = F5B0B3121B44A05100F3EBC4 /* PFPaymentTransactionObserver_Private.h */; };
F5B0B3151B44A21100F3EBC4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5B0B3141B44A21100F3EBC4 /* SystemConfiguration.framework */; };
F5B0B3161B44A22300F3EBC4 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0942999C139C613700DFA018 /* SystemConfiguration.framework */; };
F5B0B3171B44A2CA00F3EBC4 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 498C29FE1551DC450034BB80 /* StoreKit.framework */; };
Expand Down Expand Up @@ -3017,8 +3016,6 @@
810ECA6F1B573853002944D4 /* PFRelationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFRelationPrivate.h; sourceTree = "<group>"; };
810ECC611B573B96002944D4 /* ParseUnitTests-iOS-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ParseUnitTests-iOS-Info.plist"; sourceTree = "<group>"; };
810ECC621B573B96002944D4 /* ParseUnitTests-OSX-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ParseUnitTests-OSX-Info.plist"; sourceTree = "<group>"; };
810ECC6C1B573C6B002944D4 /* ParseUnitTests-iOS-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ParseUnitTests-iOS-Bridging-Header.h"; sourceTree = "<group>"; };
810ECC6D1B573C6B002944D4 /* ParseUnitTests-OSX-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ParseUnitTests-OSX-Bridging-Header.h"; sourceTree = "<group>"; };
810ECC6E1B573C6B002944D4 /* SwiftSubclass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSubclass.swift; sourceTree = "<group>"; };
810ECC721B573CC5002944D4 /* OCMock+Parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "OCMock+Parse.h"; sourceTree = "<group>"; };
810ECC731B573CC5002944D4 /* OCMock+Parse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "OCMock+Parse.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3947,8 +3944,6 @@
810ECC6B1B573C6B002944D4 /* Swift */ = {
isa = PBXGroup;
children = (
810ECC6C1B573C6B002944D4 /* ParseUnitTests-iOS-Bridging-Header.h */,
810ECC6D1B573C6B002944D4 /* ParseUnitTests-OSX-Bridging-Header.h */,
810ECC6E1B573C6B002944D4 /* SwiftSubclass.swift */,
);
path = Swift;
Expand Down Expand Up @@ -5730,7 +5725,6 @@
81329E8E1AE1E8840071EE3E /* PFReachability.h in Headers */,
81CA29F01C28ECFD00C4F34A /* PFUser+Deprecated.h in Headers */,
81C7F4AC1AF42BD9007B5418 /* PFMutableQueryState.h in Headers */,
F5B0B3131B44A05100F3EBC4 /* PFPaymentTransactionObserver_Private.h in Headers */,
81CB7F991B17970400DC601D /* PFPushState_Private.h in Headers */,
81C7F4A21AF4220A007B5418 /* PFMutableFileState.h in Headers */,
8124C8AC1B27D5D600758E00 /* PFSessionUtilities.h in Headers */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

#import <objc/runtime.h>

#import <Parse/PFObject.h>
#import <Parse/PFSubclassing.h>

#import "PFAssert.h"
#import "PFMacros.h"
#import "PFObject.h"
#import "PFObjectSubclassInfo.h"
#import "PFPropertyInfo_Private.h"
#import "PFPropertyInfo_Runtime.h"
#import "PFSubclassing.h"

// CFNumber does not use number type 0, we take advantage of that here.
#define kCFNumberTypeUnknown 0
Expand Down
15 changes: 12 additions & 3 deletions Parse/PFObject+Subclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,17 @@ NS_ASSUME_NONNULL_BEGIN
For example, `[PFUser object]` will return a `MyUser` object if `MyUser` is a registered subclass of `PFUser`.
For this reason, `[MyClass object]` is preferred to `[[MyClass alloc] init]`.
This method can only be called on subclasses which conform to `PFSubclassing`.
A default implementation is provided by `PFObject` which should always be sufficient.
*/
+ (instancetype)object;

/**
The following ignore statement is required, as otherwise, every time this is compiled - it produces an `swift_name` unused warning.
This appears to be a clang itself or ClangImporter issue when imported into Swift.
*/

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wignored-attributes"

/**
Creates a reference to an existing `PFObject` for use in creating associations between `PFObjects`.

Expand All @@ -85,7 +92,9 @@ NS_ASSUME_NONNULL_BEGIN

@return An instance of `PFObject` without data.
*/
+ (instancetype)objectWithoutDataWithObjectId:(nullable NSString *)objectId;
+ (instancetype)objectWithoutDataWithObjectId:(nullable NSString *)objectId NS_SWIFT_NAME(init(withoutDataWithObjectId:));

#pragma clang diagnostic pop

/**
Registers an Objective-C class for Parse to use for representing a given Parse class.
Expand All @@ -102,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN

This method can only be called on subclasses which conform to `PFSubclassing`.
A default implementation is provided by `PFObject` which should always be sufficient.

@see `PFQuery`
*/
+ (nullable PFQuery *)query;
Expand Down
2 changes: 1 addition & 1 deletion Parse/PFSubclassing.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN

@return A new `PFObject` without data.
*/
+ (instancetype)objectWithoutDataWithObjectId:(nullable NSString *)objectId;
+ (instancetype)objectWithoutDataWithObjectId:(nullable NSString *)objectId PF_SWIFT_UNAVAILABLE;

/**
Create a query which returns objects of this type.
Expand Down
11 changes: 0 additions & 11 deletions Tests/Other/Swift/ParseUnitTests-OSX-Bridging-Header.h

This file was deleted.

11 changes: 0 additions & 11 deletions Tests/Other/Swift/ParseUnitTests-iOS-Bridging-Header.h

This file was deleted.

6 changes: 6 additions & 0 deletions Tests/Other/Swift/SwiftSubclass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import Foundation

import Parse

@objc
public class SwiftSubclass: PFObject, PFSubclassing {
@NSManaged public var primitiveProperty: Int
Expand All @@ -20,4 +22,8 @@ public class SwiftSubclass: PFObject, PFSubclassing {
public static func parseClassName() -> String {
return "SwiftSubclass"
}

func test_validateSwiftImport() {
let _ = SwiftSubclass(withoutDataWithObjectId: "")
}
}
7 changes: 4 additions & 3 deletions Tests/Unit/ObjectSubclassingControllerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import "PFObject+Subclass.h"
#import <Parse/PFObject+Subclass.h>
#import <Parse/PFRelation.h>
#import <Parse/PFSubclassing.h>

#import "PFObjectPrivate.h"
#import "PFObjectSubclassingController.h"
#import "PFRelation.h"
#import "PFSubclassing.h"
#import "PFUnitTestCase.h"
#import "ParseUnitTests-Swift.h"

Expand Down