Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Added Swift 4.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenTiigi committed Sep 18, 2018
1 parent 7a1872b commit 73c81bd
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.2
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ opt_in_rules: # some rules are only opt-in
- conditional_returns_on_newline
- closure_spacing
- implicitly_unwrapped_optional
- missing_docs
- valid_docs

included: # paths to include during linting. `--path` is ignored if present.
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ notifications:
on_success: change
on_failure: always

osx_image: xcode9.3
osx_image: xcode10
language: swift

before_install:
Expand All @@ -29,4 +29,4 @@ script:
after_script:
- fastlane coverage
- ./cc-test-reporter format-coverage -t cobertura
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "SvenTiigi/FlyoverKit" == 1.2.0
github "SnapKit/SnapKit" == 4.0.0
github "SvenTiigi/FlyoverKit" == 1.2.1
github "SnapKit/SnapKit" == 4.0.1
github "0x73/SwiftIconFont" == 2.8.0
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "0x73/SwiftIconFont" "2.8.0"
github "SnapKit/SnapKit" "4.0.0"
github "SvenTiigi/FlyoverKit" "1.2.0"
github "SnapKit/SnapKit" "4.0.1"
github "SvenTiigi/FlyoverKit" "1.2.1"
4 changes: 2 additions & 2 deletions STLocationRequest.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.source_files = 'STLocationRequest/**/*'
s.frameworks = 'UIKit', 'MapKit'
s.dependency 'FlyoverKit', '1.2.0'
s.dependency 'SnapKit', '4.0.0'
s.dependency 'FlyoverKit', '1.2.1'
s.dependency 'SnapKit', '4.0.1'
s.dependency 'SwiftIconFont', '2.8.0'
end
14 changes: 7 additions & 7 deletions STLocationRequest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/local/bin/carthage copy-frameworks";
shellScript = "/usr/local/bin/carthage copy-frameworks\n";
};
3D244D1F2036E6F2007BD2E7 /* Carthage */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -738,7 +738,7 @@
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequest;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -764,7 +764,7 @@
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequest;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -783,7 +783,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequestTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -802,7 +802,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequestTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -823,7 +823,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequestExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -844,7 +844,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tiigi.STLocationRequestExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion STLocationRequest/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.2.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
25 changes: 1 addition & 24 deletions STLocationRequest/Place/STLocationRequestController+Place.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CoreLocation
public extension STLocationRequestController {

/// The STLocationRequestController.Place
enum Place {
enum Place: CaseIterable {
// MARK: USA
/// New York Statue of Liberty
case newYorkStatueOfLiberty
Expand Down Expand Up @@ -150,26 +150,3 @@ extension STLocationRequestController.Place: RawRepresentable {
}

}

// MARK: STLocationRequestController.Place iterate Extension

extension STLocationRequestController.Place {

/// Iterate all cases of enumeration
///
/// - Returns: Iterator for the enumeration
static func iterate() -> AnyIterator<STLocationRequestController.Place> {
var counter = 0
return AnyIterator {
let next = withUnsafePointer(to: &counter) {
$0.withMemoryRebound(to: self, capacity: 1) { $0.pointee }
}
if next.hashValue != counter {
return nil
}
counter += 1
return next
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension STLocationRequestController {
/// The places
private lazy var places: [CLLocationCoordinate2D] = {
// Initialize Places by iterate Place enumeration with filter
var places = STLocationRequestController.Place.iterate().compactMap { (place) -> CLLocationCoordinate2D? in
var places = STLocationRequestController.Place.allCases.compactMap { (place) -> CLLocationCoordinate2D? in
// If the current iteration is customPlaces
if place == .customPlaces {
return nil
Expand Down
2 changes: 1 addition & 1 deletion STLocationRequest/PulseAnimation/LFTPulseAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class LFTPulseAnimation: CALayer {
self.animationGroup.repeatCount = self.repetitions
self.animationGroup.isRemovedOnCompletion = false
if self.useTimingFunction {
let defaultCurve = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
let defaultCurve = CAMediaTimingFunction(name: .default)
self.animationGroup.timingFunction = defaultCurve
}
self.animationGroup.animations = [createScaleAnimation(), createOpacityAnimation()]
Expand Down
6 changes: 3 additions & 3 deletions STLocationRequestExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let navigationController = UINavigationController(rootViewController: ViewController())
navigationController.navigationBar.prefersLargeTitles = true
navigationController.navigationBar.largeTitleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.main
.foregroundColor: UIColor.main
]
navigationController.navigationBar.tintColor = .main
navigationController.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.main]
navigationController.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.main]
return navigationController
}()

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = self.navigationController
Expand Down
2 changes: 1 addition & 1 deletion STLocationRequestExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.2.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion STLocationRequestTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.2.3</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit 73c81bd

Please sign in to comment.