diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 9b08d041..7d3ff3cf 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -181,9 +181,11 @@ TargetAttributes = { D2515E6E1BC1A47F00ED606F = { CreatedOnToolsVersion = 7.0.1; + LastSwiftMigration = 0800; }; D2C0AFCC1BE7236A00F31D0F = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; TestTargetID = D2515E6E1BC1A47F00ED606F; }; }; @@ -385,6 +387,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -401,6 +404,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ScottyDoesntCode.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -413,6 +417,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.ScottyDoesntCode.SDCAlertView-UI-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; @@ -426,6 +431,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.ScottyDoesntCode.SDCAlertView-UI-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; diff --git a/SDCAlertView.xcodeproj/project.pbxproj b/SDCAlertView.xcodeproj/project.pbxproj index c33937be..1dc5cbd7 100644 --- a/SDCAlertView.xcodeproj/project.pbxproj +++ b/SDCAlertView.xcodeproj/project.pbxproj @@ -208,6 +208,7 @@ TargetAttributes = { D2515EC01BC1A7D500ED606F = { CreatedOnToolsVersion = 7.0.1; + LastSwiftMigration = 0800; }; }; }; @@ -295,6 +296,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -323,6 +325,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.ScottyDoesntCode.SDCAlertView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/Source/Presentation/AnimationController.swift b/Source/Presentation/AnimationController.swift index 5c0cffe9..028cdf77 100644 --- a/Source/Presentation/AnimationController.swift +++ b/Source/Presentation/AnimationController.swift @@ -25,7 +25,7 @@ class AnimationController: NSObject, UIViewControllerAnimatedTransitioning { } if self.isPresentation { - transitionContext.containerView()?.addSubview(toView) + transitionContext.containerView().addSubview(toView) } let animatingController = self.isPresentation ? toController : fromController diff --git a/Source/Presentation/PresentationController.swift b/Source/Presentation/PresentationController.swift index 9f576a0d..161720f4 100644 --- a/Source/Presentation/PresentationController.swift +++ b/Source/Presentation/PresentationController.swift @@ -4,7 +4,7 @@ class PresentationController: UIPresentationController { private let dimmingView = UIView() - override init(presentedViewController: UIViewController, presentingViewController: UIViewController) { + override init(presentedViewController: UIViewController, presentingViewController: UIViewController?) { super.init(presentedViewController: presentedViewController, presentingViewController: presentingViewController) self.dimmingView.backgroundColor = UIColor(white: 0, alpha: 0.4) diff --git a/Source/Presentation/Transition.swift b/Source/Presentation/Transition.swift index 31ad8882..af1df4d6 100644 --- a/Source/Presentation/Transition.swift +++ b/Source/Presentation/Transition.swift @@ -9,7 +9,7 @@ class Transition: NSObject, UIViewControllerTransitioningDelegate { } func presentationControllerForPresentedViewController(presented: UIViewController, - presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) + presentingViewController presenting: UIViewController?, sourceViewController source: UIViewController) -> UIPresentationController? { return PresentationController(presentedViewController: presented, diff --git a/Source/Views/ActionSheetView.swift b/Source/Views/ActionSheetView.swift index fbb81583..891dbb41 100644 --- a/Source/Views/ActionSheetView.swift +++ b/Source/Views/ActionSheetView.swift @@ -83,13 +83,13 @@ private extension UIImage { UIGraphicsBeginImageContextWithOptions(rect.size, false, 0) - let context = UIGraphicsGetCurrentContext() + let context = UIGraphicsGetCurrentContext()! color.setFill() CGContextFillRect(context, rect) - let image = UIGraphicsGetImageFromCurrentImageContext() + let image = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext() - return image; + return image } } diff --git a/Source/Views/AlertView.swift b/Source/Views/AlertView.swift index 9aa3af4e..4641a396 100644 --- a/Source/Views/AlertView.swift +++ b/Source/Views/AlertView.swift @@ -125,7 +125,7 @@ class AlertView: AlertControllerView { private func createMessageLabelConstraints() { self.addConstraint(NSLayoutConstraint(item: self.messageLabel, attribute: .FirstBaseline, - relatedBy: .Equal, toItem: self.titleLabel, attribute: .Baseline , multiplier: 1, + relatedBy: .Equal, toItem: self.titleLabel, attribute: .LastBaseline , multiplier: 1, constant: self.visualStyle.verticalElementSpacing)) let contentPadding = self.visualStyle.contentPadding let insets = UIEdgeInsets(top: 0, left: contentPadding.left, bottom: 0, right: -contentPadding.right) @@ -147,7 +147,7 @@ class AlertView: AlertControllerView { let widthOffset = self.visualStyle.contentPadding.left + self.visualStyle.contentPadding.right self.addConstraint(NSLayoutConstraint(item: textFieldsView, attribute: .Top, relatedBy: .Equal, - toItem: self.messageLabel, attribute: .Baseline, multiplier: 1, + toItem: self.messageLabel, attribute: .LastBaseline, multiplier: 1, constant: self.visualStyle.verticalElementSpacing)) textFieldsView.sdc_pinWidthToWidthOfView(self, offset: -widthOffset)