Skip to content

Commit

Permalink
Merge pull request #5 from awkward/feature/swift-4-2-update
Browse files Browse the repository at this point in the history
Update to Swift 4.2 and fix SwiftLint warnings
  • Loading branch information
AvdLee authored Nov 23, 2018
2 parents 59b5da6 + 7464bbe commit 4c68a07
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

language: swift
osx_image: xcode9.4
xcode_sdk: iphonesimulator11.4
osx_image: xcode10.1
xcode_sdk: iphonesimulator12.0
script:
- xcodebuild clean build test -project Trekker.xcodeproj -scheme Trekker -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.4'
- xcodebuild clean build test -project Trekker.xcodeproj -scheme Trekker -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=12.0'
2 changes: 1 addition & 1 deletion Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

//MARK: - Application states

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

//let mixpanel = MixpanelService(token: "002b0dd7f191c2cdeee19893e12572fe")
Expand Down
12 changes: 6 additions & 6 deletions Trekker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "co.awkward.trekker-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -573,7 +573,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "co.awkward.trekker-example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -597,7 +597,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -622,7 +622,7 @@
PRODUCT_BUNDLE_IDENTIFIER = co.awkward.trekker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -635,7 +635,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "co.awkward.trekker-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -646,7 +646,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "co.awkward.trekker-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Trekker.xcodeproj/xcshareddata/xcschemes/Trekker.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1010"
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 = "0940"
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 4 additions & 4 deletions Trekker/Trekker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public final class Trekker: NSObject {

if self.automaticStateUpdatingEnabled {
self.start()
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.pauseTracking(_:)), name: Notification.Name.UIApplicationDidEnterBackground, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.resumeTracking(_:)), name: Notification.Name.UIApplicationDidBecomeActive, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.endTracking(_:)), name: Notification.Name.UIApplicationWillTerminate, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.pauseTracking(_:)), name: UIApplication.didEnterBackgroundNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.resumeTracking(_:)), name: UIApplication.didBecomeActiveNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Trekker.endTracking(_:)), name: UIApplication.willTerminateNotification, object: nil)
}
}

Expand Down Expand Up @@ -299,7 +299,7 @@ extension Trekker {
/// But can contain more information in the `customProperties` property. Any nil items in the User profile should be removed, so be sure to always fill the user profile.
///
/// - Parameter profile: The profile to identify the user with.
open func identify(using profile: TrekkerUserProfile) {
public func identify(using profile: TrekkerUserProfile) {
self.servicesForUserProfiles.forEach { (service) in
service.identify(using: profile)
}
Expand Down
4 changes: 2 additions & 2 deletions Trekker/TrekkerEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import Foundation
open class TrekkerEvent: NSObject {

/// The name of the event, alphanumeric characters, dashes and spaces are allowed.
open let eventName: String
let eventName: String

/// The properties to send with the event
open let properties: [String: Any]?
let properties: [String: Any]?

/// Creates an event with the given name and properties.
///
Expand Down

0 comments on commit 4c68a07

Please sign in to comment.