Skip to content

Commit

Permalink
Migrate to Swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zenangst committed Sep 22, 2018
1 parent 7c826c8 commit e81c0c3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 27 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
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
osx_image: xcode9.3
osx_image: xcode10
language: objective-c

script:
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-macOS" -sdk macosx clean build
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-macOS" -sdk macosx -enableCodeCoverage YES test
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-iOS" -sdk iphonesimulator -destination name="iPhone 8" clean build
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-iOS" -sdk iphonesimulator -destination name="iPhone 8" -enableCodeCoverage YES test
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV 1080p,OS=11.0' clean build
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV 1080p,OS=11.0' -enableCodeCoverage YES test
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-macOS" -sdk macosx clean build | xcpretty
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-macOS" -sdk macosx -enableCodeCoverage YES test | xcpretty
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-iOS" -sdk iphonesimulator -destination name="iPhone 8" clean build | xcpretty
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-iOS" -sdk iphonesimulator -destination name="iPhone 8" -enableCodeCoverage YES test | xcpretty
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=11.4' clean build | xcpretty
- set -o pipefail && xcodebuild -project Vaccine.xcodeproj -scheme "Vaccine-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=11.4' -enableCodeCoverage YES test | xcpretty

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/View+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extension View {
#else
guard Injection.animations else { closure(); return }

let options: UIViewAnimationOptions = [.allowAnimatedContent,
let options: UIView.AnimationOptions = [.allowAnimatedContent,
.beginFromCurrentState,
.layoutSubviews]
UIView.animate(withDuration: 0.3, delay: 0.0, options: options, animations: {
Expand Down
4 changes: 2 additions & 2 deletions Source/iOS+tvOS/UIViewController+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import UIKit
/// added to the applications window in order to nicely
/// transition to the new controller view state.
private func performInjection() {
let options: UIViewAnimationOptions = [.allowAnimatedContent,
let options: UIView.AnimationOptions = [.allowAnimatedContent,
.beginFromCurrentState,
.layoutSubviews]
if Injection.animations, let snapshot = self.view.snapshotView(afterScreenUpdates: false) {
Expand Down Expand Up @@ -157,7 +157,7 @@ import UIKit
}
}

for childViewController in childViewControllers {
for childViewController in children {
for case let scrollView as UIScrollView in childViewController.view.subviews {
scrollViews.append(scrollView)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/iOS+tvOS/ViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ViewControllerTests: XCTestCase {
addInjection(with: #selector(injected(_:)))
view.addSubview(dummyView)
view.layer.addSublayer(dummyLayer)
addChildViewController(childViewController)
addChild(childViewController)
timesInvoked += 1
}
}
Expand All @@ -29,7 +29,7 @@ class ViewControllerTests: XCTestCase {
XCTAssertEqual(viewController.timesInvoked, 1)
utilities.triggerInjection(viewController)
XCTAssertEqual(viewController.timesInvoked, 2)
XCTAssertEqual(viewController.childViewControllers.count, 1)
XCTAssertEqual(viewController.children.count, 1)
XCTAssertEqual(viewController.view.subviews.count, 1)
XCTAssertEqual(viewController.view.layer.sublayers?.count, 2)
}
Expand Down
4 changes: 2 additions & 2 deletions Vaccine.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Vaccine"
s.summary = "Make your apps immune to recompile-disease."
s.version = "0.10.2"
s.version = "0.11.0"
s.homepage = "https://github.com/zenangst/Vaccine"
s.license = 'MIT'
s.author = { "Christoffer Winterkvist" => "[email protected]" }
Expand All @@ -20,5 +20,5 @@ Pod::Spec.new do |s|
s.tvos.source_files = 'Source/{iOS+tvOS,tvOS,Shared}/**/*'
s.osx.source_files = 'Source/{macOS,Shared}/**/*'

s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }
end
26 changes: 14 additions & 12 deletions Vaccine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
Expand Down Expand Up @@ -750,7 +750,7 @@
PRODUCT_NAME = Vaccine;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
Expand All @@ -775,7 +775,7 @@
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
Expand All @@ -798,7 +798,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Vaccine-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
};
Expand Down Expand Up @@ -856,7 +856,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -908,7 +908,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -933,7 +933,7 @@
PRODUCT_NAME = Vaccine;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -953,7 +953,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.zenangst.Vaccine-iOS";
PRODUCT_NAME = Vaccine;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -968,7 +968,7 @@
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.VaccineTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -982,7 +982,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)";
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.VaccineTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1006,7 +1006,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1029,7 +1029,7 @@
PRODUCT_NAME = Vaccine;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1046,6 +1046,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Vaccine-MacTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1062,6 +1063,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Vaccine-MacTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down

0 comments on commit e81c0c3

Please sign in to comment.