From 65ed770c81c8e1622e817f26e97e53f9472ffadf Mon Sep 17 00:00:00 2001 From: Sebastian Boldt Date: Fri, 5 Jul 2019 16:11:05 +0200 Subject: [PATCH 1/2] decreased minimum deployment target to iOS10 --- Example/Jelly.xcodeproj/project.pbxproj | 4 +- .../xcschemes/Jelly-Example.xcscheme | 22 +- Example/Podfile | 2 +- Example/Podfile.lock | 4 +- .../Pods/Local Podspecs/Jelly.podspec.json | 6 +- Example/Pods/Manifest.lock | 4 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 243 ++++++++++-------- .../Jelly/Jelly-Info.plist | 2 +- Jelly.podspec | 2 +- .../InteractionController.swift | 8 +- .../Extensions/UIView+RoundCorners.swift | 27 +- .../private/PresentationController.swift | 4 +- 12 files changed, 183 insertions(+), 145 deletions(-) diff --git a/Example/Jelly.xcodeproj/project.pbxproj b/Example/Jelly.xcodeproj/project.pbxproj index e4f2902..de4c7af 100644 --- a/Example/Jelly.xcodeproj/project.pbxproj +++ b/Example/Jelly.xcodeproj/project.pbxproj @@ -574,7 +574,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = JY9STJR6M4; INFOPLIST_FILE = Jelly/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.Jelly; @@ -589,7 +589,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = JY9STJR6M4; INFOPLIST_FILE = Jelly/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.demo.Jelly; diff --git a/Example/Jelly.xcodeproj/xcshareddata/xcschemes/Jelly-Example.xcscheme b/Example/Jelly.xcodeproj/xcshareddata/xcschemes/Jelly-Example.xcscheme index 512453d..a34e504 100644 --- a/Example/Jelly.xcodeproj/xcshareddata/xcschemes/Jelly-Example.xcscheme +++ b/Example/Jelly.xcodeproj/xcshareddata/xcschemes/Jelly-Example.xcscheme @@ -41,6 +41,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -53,17 +62,6 @@ - - - - - - - - CFBundlePackageType FMWK CFBundleShortVersionString - 2.1.1 + 2.2.0 CFBundleSignature ???? CFBundleVersion diff --git a/Jelly.podspec b/Jelly.podspec index e3e1aaa..5d5acad 100644 --- a/Jelly.podspec +++ b/Jelly.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/SebastianBoldt/Jelly.git', :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/sebastianboldt' - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '10.0' s.source_files = 'Jelly/Classes/**/*' s.frameworks = 'UIKit' end diff --git a/Jelly/Classes/private/Animators/Interaction Controllers/InteractionController.swift b/Jelly/Classes/private/Animators/Interaction Controllers/InteractionController.swift index 3098910..40e9c1e 100644 --- a/Jelly/Classes/private/Animators/Interaction Controllers/InteractionController.swift +++ b/Jelly/Classes/private/Animators/Interaction Controllers/InteractionController.swift @@ -132,12 +132,16 @@ class InteractionController: UIPercentDrivenInteractiveTransition { switch configuration.dragMode { case .canvas: let gesture = UIPanGestureRecognizer(target: self, action: #selector(handleGesture(_:))) - gesture.name = Constants.gestureRecognizerIdentifier + if #available(iOS 11.0, *) { + gesture.name = Constants.gestureRecognizerIdentifier + } view.addGestureRecognizer(gesture) case .edge: let gesture = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(handleGesture(_:))) gesture.edges = presentationType == .dismiss ? dragDirection.dismissRectEdges : dragDirection.showRectEdges - gesture.name = Constants.gestureRecognizerIdentifier + if #available(iOS 11.0, *) { + gesture.name = Constants.gestureRecognizerIdentifier + } view.addGestureRecognizer(gesture) } } diff --git a/Jelly/Classes/private/Extensions/UIView+RoundCorners.swift b/Jelly/Classes/private/Extensions/UIView+RoundCorners.swift index 54126c6..7042bc5 100644 --- a/Jelly/Classes/private/Extensions/UIView+RoundCorners.swift +++ b/Jelly/Classes/private/Extensions/UIView+RoundCorners.swift @@ -1,9 +1,28 @@ import UIKit extension UIView { - public func roundCorners(corners: CACornerMask = [.layerMaxXMaxYCorner,.layerMaxXMinYCorner, .layerMinXMaxYCorner, .layerMinXMinYCorner], radius: CGFloat = 0.0) { - layer.masksToBounds = true - layer.cornerRadius = radius - layer.maskedCorners = corners + func roundCorners(_ corners: CACornerMask, radius: CGFloat) { + if #available(iOS 11, *) { + self.layer.cornerRadius = radius + self.layer.maskedCorners = corners + } else { + var cornerMask = UIRectCorner() + if(corners.contains(.layerMinXMinYCorner)){ + cornerMask.insert(.topLeft) + } + if(corners.contains(.layerMaxXMinYCorner)){ + cornerMask.insert(.topRight) + } + if(corners.contains(.layerMinXMaxYCorner)){ + cornerMask.insert(.bottomLeft) + } + if(corners.contains(.layerMaxXMaxYCorner)){ + cornerMask.insert(.bottomRight) + } + let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: cornerMask, cornerRadii: CGSize(width: radius, height: radius)) + let mask = CAShapeLayer() + mask.path = path.cgPath + self.layer.mask = mask + } } } diff --git a/Jelly/Classes/private/PresentationController.swift b/Jelly/Classes/private/PresentationController.swift index fae92f0..1f2660e 100644 --- a/Jelly/Classes/private/PresentationController.swift +++ b/Jelly/Classes/private/PresentationController.swift @@ -24,7 +24,7 @@ final class PresentationController: UIPresentationController, PresentationContro presentedViewController.view.layer.masksToBounds = true let corners = presentation.presentationUIConfiguration.corners let radius = presentation.presentationUIConfiguration.cornerRadius - presentedViewController.view.roundCorners(corners: corners, radius: radius) + presentedViewController.view.roundCorners(corners, radius: radius) } func updatePresentation(presentation: Presentation, duration: Duration) { @@ -61,7 +61,7 @@ final class PresentationController: UIPresentationController, PresentationContro presentedView?.frame = frameOfPresentedViewInContainerView let corners = presentation.presentationUIConfiguration.corners let radius = presentation.presentationUIConfiguration.cornerRadius - presentedView?.roundCorners(corners: corners, radius: radius) + presentedView?.roundCorners(corners, radius: radius) } override func size(forChildContentContainer container: UIContentContainer, From 6b81d85d61d390b83a76c51d31ab2c4baaea601d Mon Sep 17 00:00:00 2001 From: Sebastian Boldt Date: Fri, 5 Jul 2019 16:14:02 +0200 Subject: [PATCH 2/2] 2.2.1 preparations --- CHANGELOG.md | 3 +++ Jelly.podspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 723d40a..2329ec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.2.1 (2019-5-6) +- decreased minimum deployment target to iOS10 + ## 2.2.0 (2019-13-4) - Swift 5.0 adaptions diff --git a/Jelly.podspec b/Jelly.podspec index 5d5acad..81f7cbb 100644 --- a/Jelly.podspec +++ b/Jelly.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.name = 'Jelly' - s.version = '2.2.0' + s.version = '2.2.1' s.summary = 'Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.' s.description = <<-DESC