Skip to content

Commit

Permalink
Supports swift4
Browse files Browse the repository at this point in the history
  • Loading branch information
shoheiyokoyama committed Oct 9, 2017
1 parent ede7a65 commit a7eda4f
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 21 deletions.
16 changes: 10 additions & 6 deletions Example/Gemini.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,11 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0820;
LastSwiftMigration = 0900;
ProvisioningStyle = Automatic;
TestTargetID = 607FACCF1AFB9204008FA782;
};
Expand Down Expand Up @@ -573,7 +573,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -588,7 +589,8 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -610,7 +612,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -628,7 +631,8 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Example/Gemini/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window?.makeKeyAndVisible()

UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]
UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white]
UINavigationBar.appearance().setBackgroundImage(image(of: UIColor.black.withAlphaComponent(0.75)), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class CircleRotationViewController: UIViewController {
view.addGestureRecognizer(gesture)
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
2 changes: 1 addition & 1 deletion Example/Gemini/ViewControllers/CubeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class CubeViewController: UIViewController {
view.addGestureRecognizer(gesture)
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final class CustomAnimationViewController: UIViewController {
}
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final class PitchRotationViewController: UIViewController {
view.layer.insertSublayer(gradientLayer, at: 0)
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class RollRotationViewController: UIViewController {
super.viewDidAppear(animated)
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ final class ScaleAnimationViewController: UIViewController {
collectionView.decelerationRate = UIScrollViewDecelerationRateFast
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class YawRotationViewController: UIViewController {
collectionView.decelerationRate = UIScrollViewDecelerationRateFast
}

func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
@objc func toggleNavigationBarHidden(_ gestureRecognizer: UITapGestureRecognizer) {
let isNavigationBarHidden = navigationController?.isNavigationBarHidden ?? true
navigationController?.setNavigationBarHidden(!isNavigationBarHidden, animated: true)
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Gemini/Views/PlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ final class PlayerView: UIView {

override init(frame: CGRect) {
super.init(frame: frame)
playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
playerLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
playerLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill
}

func setVideoURL(_ url: URL) {
Expand Down
20 changes: 16 additions & 4 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ To run the example project, clone the repo, and run `pod install` from the Examp
## <a name="requirements"> Requirements

- Xcode 9.0+
- Swift 3.2
- Swift 4.0

## <a name="installation"> Installation

Expand Down

0 comments on commit a7eda4f

Please sign in to comment.