Skip to content

Swift 3 #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 19, 2017
Merged

Swift 3 #1145

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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ branches:
- master
language: objective-c
os: osx
osx_image: xcode7.3
osx_image: xcode8.3
env:
global:
- LC_CTYPE=en_US.UTF-8
Expand Down Expand Up @@ -35,4 +35,4 @@ after_success:
- |
if [ "$TEST_TYPE" = iOS ] || [ "$TEST_TYPE" = macOS ]; then
bash <(curl -s https://codecov.io/bash)
fi
fi
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "BoltsFramework/Bolts-ObjC" "1.8.4"
github "erikdoe/OCMock" "v3.3.1"
github "erikdoe/OCMock" "v3.4"
2 changes: 2 additions & 0 deletions Configurations/ParseUnitTests-iOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-iOS
PRODUCT_MODULE_NAME = ParseUnitTests
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.ios

SWIFT_VERSION = 3.0

IPHONEOS_DEPLOYMENT_TARGET = 8.0

INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-iOS-Info.plist
Expand Down
2 changes: 2 additions & 0 deletions Configurations/ParseUnitTests-macOS.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PRODUCT_NAME = ParseUnitTests-macOS
PRODUCT_MODULE_NAME = ParseUnitTests
PRODUCT_BUNDLE_IDENTIFIER = com.parse.unit.macOS

SWIFT_VERSION = 3.0

INFOPLIST_FILE = $(SRCROOT)/Tests/Resources/ParseUnitTests-OSX-Info.plist

USER_HEADER_SEARCH_PATHS = $(inherited) $(PARSE_DIR)/Parse/Internal/**
Expand Down
37 changes: 36 additions & 1 deletion Parse.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3817,6 +3817,7 @@
099C082113AC013900D71869 /* Tests */,
09D3364C139C54940098E916 /* Frameworks */,
09D3364B139C54940098E916 /* Products */,
4AAB99061EE6D7E50073D7A7 /* Recovered References */,
);
indentWidth = 4;
sourceTree = "<group>";
Expand Down Expand Up @@ -3874,6 +3875,16 @@
name = Views;
sourceTree = "<group>";
};
4AAB99061EE6D7E50073D7A7 /* Recovered References */ = {
isa = PBXGroup;
children = (
F5B0B3121B44A05100F3EBC4 /* PFPaymentTransactionObserver_Private.h */,
97DE045B163214C0007154E8 /* SystemConfiguration.framework */,
97DE045016321428007154E8 /* CoreLocation.framework */,
);
name = "Recovered References";
sourceTree = "<group>";
};
7C83A03B15B4A609005E2C8E /* Commands */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -6874,11 +6885,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Parse Inc.";
TargetAttributes = {
810155051BB3832700D7C7BD = {
LastSwiftMigration = 0830;
};
816F441B1A8E8933009CDB32 = {
LastSwiftMigration = 0900;
};
81C3821B19CCA89E0066284A = {
CreatedOnToolsVersion = 6.0.1;
LastSwiftMigration = 0830;
};
};
};
Expand Down Expand Up @@ -8597,27 +8615,33 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 81DCD1491D2DA080002501A2 /* Debug.xcconfig */;
buildSettings = {
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
};
name = Debug;
};
09D3366C139C54940098E916 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 81DCD14A1D2DA080002501A2 /* Release.xcconfig */;
buildSettings = {
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
};
name = Release;
};
810156671BB3832700D7C7BD /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 810154FE1BB382F800D7C7BD /* Parse-watchOS.xcconfig */;
buildSettings = {
SWIFT_VERSION = 3.0;
};
name = Debug;
};
810156681BB3832700D7C7BD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 810154FE1BB382F800D7C7BD /* Parse-watchOS.xcconfig */;
buildSettings = {
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down Expand Up @@ -8667,13 +8691,24 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F55ABB531B4F39DA00A0ECD5 /* Parse-iOS.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
81C3823519CCA89F0066284A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F55ABB531B4F39DA00A0ECD5 /* Parse-iOS.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Parse.xcodeproj/xcshareddata/xcschemes/Parse-iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Parse.xcodeproj/xcshareddata/xcschemes/Parse-tvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = Parse;
TargetAttributes = {
81993FD51B69AC760077D6B9 = {
CreatedOnToolsVersion = 6.4;
};
81CC85B71A49F2E00076DE19 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0830;
};
};
};
Expand Down Expand Up @@ -268,15 +269,18 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -310,15 +314,18 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -328,6 +335,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
name = Release;
};
Expand All @@ -344,6 +352,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "ParseOSXStarterProject-Swift";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -360,6 +369,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.parse.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "ParseOSXStarterProject-Swift";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

@IBOutlet weak var window: NSWindow?

func applicationDidFinishLaunching(aNotification: NSNotification) {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// ****************************************************************************
// Initialize Parse SDK
// ****************************************************************************
Expand All @@ -32,17 +32,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {

// Enable storing and querying data from Local Datastore.
// Remove this line if you don't want to use Local Datastore features or want to use cachePolicy.
$0.localDatastoreEnabled = true
$0.isLocalDatastoreEnabled = true
}
Parse.initializeWithConfiguration(configuration)
Parse.initialize(with: configuration)

PFUser.enableAutomaticUser()

let defaultACL: PFACL = PFACL()
// If you would like all objects to be private by default, remove this line.
defaultACL.publicReadAccess = true
defaultACL.getPublicReadAccess = true

PFACL.setDefaultACL(defaultACL, withAccessForCurrentUser: true)
PFACL.setDefault(defaultACL, withAccessForCurrentUser: true)

// ****************************************************************************
// Uncomment these lines to register for Push Notifications.
Expand All @@ -52,24 +52,23 @@ class AppDelegate: NSObject, NSApplicationDelegate {
//
// ****************************************************************************

PFAnalytics.trackAppOpenedWithLaunchOptions(nil)
PFAnalytics.trackAppOpened(launchOptions: nil)
}

func application(application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
let installation = PFInstallation.currentInstallation()
installation?.setDeviceTokenFromData(deviceToken)
func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let installation = PFInstallation.current()
installation?.setDeviceTokenFrom(deviceToken)
installation?.saveInBackground()

PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
PFPush.subscribeToChannel(inBackground: "") { (succeeded: Bool, error: Error?) in
if succeeded {
print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n")
} else {
print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error)
print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error as Any)
}
}
}

func application(application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("application:didFailToRegisterForRemoteNotificationsWithError: %@\n", error)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
Expand Down
Loading