From f80e58b0c3b30087b63d9ddf879795ee87f71e87 Mon Sep 17 00:00:00 2001 From: wes Date: Thu, 19 Jul 2018 22:41:45 -0700 Subject: [PATCH 1/3] Swift 4.2 --- CBApp/CBApp.xcodeproj/project.pbxproj | 14 +- CBApp/CBApp/AppDelegate.swift | 2 +- CBApp/CBApp/CVLayoutCell.swift | 6 +- CBApp/CBApp/LoadersCell.swift | 6 +- CBApp/CBApp/ViewController.swift | 10 +- CBToolkit/CBToolkit.xcodeproj/project.pbxproj | 14 +- .../UserInterfaceState.xcuserstate | Bin 44818 -> 46863 bytes .../xcschemes/CBToolkit.xcscheme | 13 +- CBToolkit/CBToolkit/CBButton.swift | 16 +- .../CBToolkit/CBCollectionViewLayout.swift | 2 +- CBToolkit/CBToolkit/CBDate.swift | 4 +- CBToolkit/CBToolkit/CBExtensions.swift | 40 ++--- CBToolkit/CBToolkit/CBIconButton.swift | 2 +- CBToolkit/CBToolkit/CBImageEditor.swift | 152 +++++++++--------- CBToolkit/CBToolkit/CBImageView.swift | 10 +- CBToolkit/CBToolkit/CBLogger.swift | 6 +- CBToolkit/CBToolkit/CBPhoneNumber.swift | 34 ++-- .../CBSliderCollectionViewLayout.swift | 4 +- CBToolkit/CBToolkit/CBTextField.swift | 6 +- CBToolkit/CBToolkit/CBTextView.swift | 4 +- 20 files changed, 175 insertions(+), 170 deletions(-) diff --git a/CBApp/CBApp.xcodeproj/project.pbxproj b/CBApp/CBApp.xcodeproj/project.pbxproj index 537f011..86a34f2 100644 --- a/CBApp/CBApp.xcodeproj/project.pbxproj +++ b/CBApp/CBApp.xcodeproj/project.pbxproj @@ -178,12 +178,12 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = Type2Designs; TargetAttributes = { DEEBE0431B9892B600F18093 = { CreatedOnToolsVersion = 6.4; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; }; @@ -291,12 +291,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -346,12 +348,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -403,8 +407,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -429,8 +432,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/CBApp/CBApp/AppDelegate.swift b/CBApp/CBApp/AppDelegate.swift index d69f3eb..f2e69c0 100644 --- a/CBApp/CBApp/AppDelegate.swift +++ b/CBApp/CBApp/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } diff --git a/CBApp/CBApp/CVLayoutCell.swift b/CBApp/CBApp/CVLayoutCell.swift index f08dbad..e9e4258 100644 --- a/CBApp/CBApp/CVLayoutCell.swift +++ b/CBApp/CBApp/CVLayoutCell.swift @@ -78,8 +78,8 @@ class CVLayoutCell : UICollectionViewCell, UICollectionViewDataSource, UICollect let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "GalleryCell", for: indexPath) as! GalleryCell let imgIndex = (indexPath as NSIndexPath).row % imgURLs.count - let url = imgURLs[imgIndex] - cell.imageView.onLoadTransition = UIViewAnimationOptions.transitionCrossDissolve + let url = URL(string: imgURLs[imgIndex])! + cell.imageView.onLoadTransition = UIView.AnimationOptions.transitionCrossDissolve cell.imageView.loadImage(at: url, completion: nil) return cell @@ -87,7 +87,7 @@ class CVLayoutCell : UICollectionViewCell, UICollectionViewDataSource, UICollect func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let imgIndex = (indexPath as NSIndexPath).row % imgURLs.count - let url = imgURLs[imgIndex] + let url = URL(string: imgURLs[imgIndex])! CBPhotoFetcher.sharedFetcher.fetchImage(at: url, completion: { (image, error, requestTime) -> Void in if image != nil { self.delegate?.openImageEditor(image!) diff --git a/CBApp/CBApp/LoadersCell.swift b/CBApp/CBApp/LoadersCell.swift index 7898124..d324094 100644 --- a/CBApp/CBApp/LoadersCell.swift +++ b/CBApp/CBApp/LoadersCell.swift @@ -27,12 +27,12 @@ class LoadersCell : UICollectionViewCell { @IBAction func toggleActivityIndicator(_ sender: CBButton) { if activityIndicator.animating { activityIndicator.stopAnimating() - sender.setTitle("Start", for: UIControlState.normal) + sender.setTitle("Start", for: UIControl.State.normal) sender.tintColor = UIColor.white } else { activityIndicator.startAnimating() - sender.setTitle("Stop", for: UIControlState.normal) + sender.setTitle("Stop", for: UIControl.State.normal) sender.tintColor = UIColor.red } } @@ -70,7 +70,7 @@ class LoadersCell : UICollectionViewCell { self.progress = 0 self.uploadButtonView.isEnabled = true self.progressCompleteImageView.transform = CGAffineTransform(scaleX: 0, y: 0) - UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIViewAnimationOptions.curveEaseOut, animations: { () -> Void in + UIView.animate(withDuration: 0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIView.AnimationOptions.curveEaseOut, animations: { () -> Void in self.progressCompleteImageView.alpha = 1 self.progressCompleteImageView.transform = CGAffineTransform(scaleX: 1, y: 1) }) { (fin) -> Void in diff --git a/CBApp/CBApp/ViewController.swift b/CBApp/CBApp/ViewController.swift index dad4201..165316d 100644 --- a/CBApp/CBApp/ViewController.swift +++ b/CBApp/CBApp/ViewController.swift @@ -10,7 +10,7 @@ import UIKit import CBToolkit class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, GalleryDelegate, CBImageEditorDelegate { - + @IBOutlet weak var contentCollectionView: UICollectionView! override func viewDidLoad() { @@ -65,19 +65,17 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection func openImageEditor(_ image: UIImage) { - let editor = CBImageEditor(image: image, style: UIBlurEffectStyle.light, delegate: self) + let editor = CBImageEditor(image: image, style: UIBlurEffect.Style.light, delegate: self) self.present(editor, animated: true, completion: nil) } - func imageEditor(_ editor: CBImageEditor!, didFinishEditingImage original: UIImage!, editedImage: UIImage!) { + func imageEditor(_ editor: CBImageEditor, didFinishEditingImage original: UIImage, editedImage: UIImage) { editor.dismiss(animated: true, completion: nil) } - func imageEditorDidCancel(_ editor: CBImageEditor!) { + func imageEditorDidCancel(_ editor: CBImageEditor) { editor.dismiss(animated: true, completion: nil) } - - } diff --git a/CBToolkit/CBToolkit.xcodeproj/project.pbxproj b/CBToolkit/CBToolkit.xcodeproj/project.pbxproj index 0bccb8c..035424b 100644 --- a/CBToolkit/CBToolkit.xcodeproj/project.pbxproj +++ b/CBToolkit/CBToolkit.xcodeproj/project.pbxproj @@ -165,13 +165,13 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = WCBMedia; TargetAttributes = { 1CDBAFED1A7D8A7200D7677B = { CreatedOnToolsVersion = 6.1.1; DevelopmentTeam = 33W8XH2WT5; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; }; }; }; @@ -240,12 +240,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -297,12 +299,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -355,8 +359,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -378,8 +381,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.wcbmedia.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/CBToolkit/CBToolkit.xcodeproj/project.xcworkspace/xcuserdata/mbyrne.xcuserdatad/UserInterfaceState.xcuserstate b/CBToolkit/CBToolkit.xcodeproj/project.xcworkspace/xcuserdata/mbyrne.xcuserdatad/UserInterfaceState.xcuserstate index aaac09fff941a261f1b20327c918e55c83357e89..5b72368fdf97063448cd71193102cbb4bd5c1c88 100644 GIT binary patch delta 18677 zcmb8W2V7Lg^8o&KUq7Vxa`bj|kY1(Q6~(TAl%p35_Hu8L-r>=~0w|WKu_eZ6VvNQf zqp`-GsL>c>kH#3|fA0{*?=Sz)=l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c70..a3d2a8c 100644 --- a/CBToolkit/CBToolkit.xcodeproj/xcuserdata/mbyrne.xcuserdatad/xcschemes/CBToolkit.xcscheme +++ b/CBToolkit/CBToolkit.xcodeproj/xcuserdata/mbyrne.xcuserdatad/xcschemes/CBToolkit.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:CBToolkit.xcodeproj"> + + Void in + UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction, UIView.AnimationOptions.beginFromCurrentState], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: self.shrinkscale, y: self.shrinkscale) }, completion: nil) } private func animateToResting() { - UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform.identity }, completion: nil) } public func popAnimation() { - UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIViewAnimationOptions.curveEaseOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIView.AnimationOptions.curveEaseOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: self.popScale, y: self.popScale) }) { (finished) -> Void in - UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: 1, y: 1) }, completion: nil) } @@ -198,23 +198,23 @@ import UIKit } private func animateShrink() { - UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction, UIViewAnimationOptions.beginFromCurrentState], animations: { () -> Void in + UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction, UIView.AnimationOptions.beginFromCurrentState], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: self.shrinkscale, y: self.shrinkscale) }, completion: nil) } private func animateToResting() { - UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.8, delay: 0.1, usingSpringWithDamping: damping, initialSpringVelocity: 4, options: [UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform.identity }, completion: nil) } public func popAnimation() { - UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIViewAnimationOptions.curveEaseOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.26, delay: 0.15, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: [UIView.AnimationOptions.curveEaseOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: self.popScale, y: self.popScale) }) { (finished) -> Void in - UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.8, delay: 0, usingSpringWithDamping: self.damping, initialSpringVelocity: 5, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.transform = CGAffineTransform(scaleX: 1, y: 1) }, completion: nil) } diff --git a/CBToolkit/CBToolkit/CBCollectionViewLayout.swift b/CBToolkit/CBToolkit/CBCollectionViewLayout.swift index 688d0f9..0b76e90 100755 --- a/CBToolkit/CBToolkit/CBCollectionViewLayout.swift +++ b/CBToolkit/CBToolkit/CBCollectionViewLayout.swift @@ -324,7 +324,7 @@ public class CBCollectionViewLayout : UICollectionViewLayout, UIGestureRecognize // let v = velocity ?? CGPoint.zero let cell = self.collectionView?.cellForItem(at: finalIndexPath as IndexPath) - UIView.animate(withDuration: 0.35, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0, options: UIViewAnimationOptions.beginFromCurrentState, animations: { () -> Void in + UIView.animate(withDuration: 0.35, delay: 0, usingSpringWithDamping: 0.95, initialSpringVelocity: 0, options: UIView.AnimationOptions.beginFromCurrentState, animations: { () -> Void in oldView.frame = attr!.frame cell?.alpha = 1 }, completion: { (fin) -> Void in diff --git a/CBToolkit/CBToolkit/CBDate.swift b/CBToolkit/CBToolkit/CBDate.swift index b2f2353..780f45e 100644 --- a/CBToolkit/CBToolkit/CBDate.swift +++ b/CBToolkit/CBToolkit/CBDate.swift @@ -369,10 +369,10 @@ public extension Date { public var years = "y" public var shouldPluralize : Bool = false - static var short: AggregationNames { + public static var short: AggregationNames { return AggregationNames() } - static var long: AggregationNames { + public static var long: AggregationNames { return AggregationNames(seconds: " second", minutes: " minute", hours: " hour", days: " day", weeks: " week", years: " year", shouldPluralize: true) } diff --git a/CBToolkit/CBToolkit/CBExtensions.swift b/CBToolkit/CBToolkit/CBExtensions.swift index fe21fc4..dc0c5aa 100644 --- a/CBToolkit/CBToolkit/CBExtensions.swift +++ b/CBToolkit/CBToolkit/CBExtensions.swift @@ -58,12 +58,12 @@ public extension UIView { */ func addConstraintsToMatchParent(insets: UIEdgeInsets? = nil) -> (top: NSLayoutConstraint, right: NSLayoutConstraint, bottom: NSLayoutConstraint, left: NSLayoutConstraint)? { if let sv = self.superview { - let top = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal + let top = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal - , toItem: self, attribute: NSLayoutAttribute.top, multiplier: 1, constant: insets?.top ?? 0) - let right = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.right, multiplier: 1, constant: insets?.right ?? 0) - let bottom = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: insets?.bottom ?? 0) - let left = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.left, multiplier: 1, constant: insets?.left ?? 0) + , toItem: self, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: insets?.top ?? 0) + let right = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: insets?.right ?? 0) + let bottom = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: insets?.bottom ?? 0) + let left = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: insets?.left ?? 0) sv.addConstraints([top, bottom, right, left]) self.translatesAutoresizingMaskIntoConstraints = false return (top, right, bottom, left) @@ -91,8 +91,8 @@ public extension UIAlertController { - returns: The UIAlertController initialized with the provided properties. */ public class func alertWithTitle(title: String?, message: String?, cancelButtonTitle button: String) -> UIAlertController { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) - alert.addAction(UIAlertAction(title: button, style: UIAlertActionStyle.default, handler: nil)) + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) + alert.addAction(UIAlertAction(title: button, style: UIAlertAction.Style.default, handler: nil)) return alert } @@ -125,10 +125,10 @@ public extension CAShapeLayer { anim.duration = 0.2 anim.fromValue = self.presentation()?.value(forKeyPath: "path") anim.toValue = path - anim.fillMode = kCAFillModeBoth + anim.fillMode = CAMediaTimingFillMode.both anim.isAdditive = true anim.isRemovedOnCompletion = false - anim.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) + anim.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) self.add(anim, forKey: "animatePath") } } @@ -171,7 +171,7 @@ public extension UIImage { } public func fixOrientation() -> UIImage { - if (self.imageOrientation == UIImageOrientation.up) { return self } + if (self.imageOrientation == UIImage.Orientation.up) { return self } UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale); self.draw(in: CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height)) let normalizedImage = UIGraphicsGetImageFromCurrentImageContext(); @@ -285,20 +285,20 @@ public extension UIImage { var transform = CGAffineTransform.identity switch (self.imageOrientation) { - case UIImageOrientation.down, // EXIF = 3 - UIImageOrientation.downMirrored: // EXIF = 4 + case UIImage.Orientation.down, // EXIF = 3 + UIImage.Orientation.downMirrored: // EXIF = 4 transform = transform.translatedBy(x: size.width, y: size.height) transform = transform.rotated(by: CGFloat(Double.pi)) break; - case UIImageOrientation.left, // EXIF = 6 - UIImageOrientation.leftMirrored: // EXIF = 5 + case UIImage.Orientation.left, // EXIF = 6 + UIImage.Orientation.leftMirrored: // EXIF = 5 transform = transform.translatedBy(x: size.width, y: 0) transform = transform.rotated(by: CGFloat((Double.pi / 2))) break; - case UIImageOrientation.right, // EXIF = 8 - UIImageOrientation.rightMirrored: // EXIF = 7 + case UIImage.Orientation.right, // EXIF = 8 + UIImage.Orientation.rightMirrored: // EXIF = 7 transform = transform.translatedBy(x: 0, y: size.height) transform = transform.rotated(by: CGFloat(-(Double.pi / 2))) break @@ -309,14 +309,14 @@ public extension UIImage { switch (self.imageOrientation) { - case UIImageOrientation.upMirrored, // EXIF = 2 - UIImageOrientation.downMirrored: // EXIF = 4 + case UIImage.Orientation.upMirrored, // EXIF = 2 + UIImage.Orientation.downMirrored: // EXIF = 4 transform = transform.translatedBy(x: size.width, y: 0) transform = transform.scaledBy(x: -1, y: 1) break; - case UIImageOrientation.leftMirrored, // EXIF = 5 - UIImageOrientation.rightMirrored: // EXIF = 7 + case UIImage.Orientation.leftMirrored, // EXIF = 5 + UIImage.Orientation.rightMirrored: // EXIF = 7 transform = transform.translatedBy(x: size.height, y: 0) transform = transform.scaledBy(x: -1, y: 1) break; diff --git a/CBToolkit/CBToolkit/CBIconButton.swift b/CBToolkit/CBToolkit/CBIconButton.swift index cddb23b..9a71531 100644 --- a/CBToolkit/CBToolkit/CBIconButton.swift +++ b/CBToolkit/CBToolkit/CBIconButton.swift @@ -110,7 +110,7 @@ public enum CBIconType : NSInteger { func setup() { for bar in [bar1, bar2, bar3] { bar.lineWidth = barWidth - bar.lineCap = kCALineCapRound + bar.lineCap = CAShapeLayerLineCap.round bar.fillColor = UIColor.clear.cgColor bar.strokeColor = self.tintColor.cgColor self.layer.addSublayer(bar) diff --git a/CBToolkit/CBToolkit/CBImageEditor.swift b/CBToolkit/CBToolkit/CBImageEditor.swift index 1f05495..24a9494 100644 --- a/CBToolkit/CBToolkit/CBImageEditor.swift +++ b/CBToolkit/CBToolkit/CBImageEditor.swift @@ -78,7 +78,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio private var headerHeight: NSLayoutConstraint! private var filterHeightConstraint: NSLayoutConstraint! - public init(image: UIImage!, style: UIBlurEffectStyle, delegate: CBImageEditorDelegate) { + public init(image: UIImage!, style: UIBlurEffect.Style, delegate: CBImageEditorDelegate) { super.init(nibName: nil, bundle: nil) self.delegate = delegate self.originalImage = image @@ -86,7 +86,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio self.originalImage = image.resize(CGSize(width: 3000, height: 3000), contentMode: CBImageContentMode.AspectFit) } - self.view.backgroundColor = style == UIBlurEffectStyle.dark ? UIColor(white: 0.2, alpha: 1) : UIColor(white: 0.9, alpha: 1) + self.view.backgroundColor = style == UIBlurEffect.Style.dark ? UIColor(white: 0.2, alpha: 1) : UIColor(white: 0.9, alpha: 1) self.view.clipsToBounds = true scrollView = UIScrollView(frame: cropRect) @@ -106,22 +106,22 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio let isPad = UI_USER_INTERFACE_IDIOM() == .pad - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.greaterThanOrEqual, toItem: scrollView, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 10)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.lessThanOrEqual, toItem: scrollView, attribute: NSLayoutAttribute.left, multiplier: 1, constant: -10)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.lessThanOrEqual, toItem: scrollView, attribute: NSLayoutAttribute.top, multiplier: 1, constant: isPad ? -70 : -62)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.greaterThanOrEqual, toItem: scrollView, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: isPad ? 70 : 62)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.greaterThanOrEqual, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 10)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.lessThanOrEqual, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: -10)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.lessThanOrEqual, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: isPad ? -70 : -62)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.greaterThanOrEqual, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: isPad ? 70 : 62)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: scrollView, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: scrollView, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.centerX, relatedBy: NSLayoutConstraint.Relation.equal, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0)) - let widthConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.width, multiplier: 1, constant: 0) + let widthConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.width, multiplier: 1, constant: 0) widthConstraint.priority = UILayoutPriority(rawValue: 250) self.view.addConstraint(widthConstraint) editingImage = originalImage imageView = UIImageView(frame: CGRect.zero) imageView.image = editingImage - imageView.contentMode = UIViewContentMode.scaleToFill + imageView.contentMode = UIView.ContentMode.scaleToFill scrollView.addSubview(imageView) let effect = UIBlurEffect(style: style) @@ -133,10 +133,10 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio self.view.addSubview(blurView) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: blurView, attribute: NSLayoutAttribute.left, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: blurView, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: blurView, attribute: NSLayoutAttribute.top, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: blurView, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: blurView, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: blurView, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal, toItem: blurView, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: blurView, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0)) // Title, Save, & Cancel @@ -146,54 +146,54 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio headerView.backgroundColor = UIColor(white: 0.5, alpha: 0.1) self.view.addSubview(headerView) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: headerView, attribute: NSLayoutAttribute.left, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: headerView, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: headerView, attribute: NSLayoutAttribute.top, multiplier: 1, constant: 0)) - headerHeight = NSLayoutConstraint(item: headerView, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 60) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: headerView, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: headerView, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal, toItem: headerView, attribute: NSLayoutConstraint.Attribute.top, multiplier: 1, constant: 0)) + headerHeight = NSLayoutConstraint(item: headerView, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 60) headerView.addConstraint(headerHeight) titleLabel = UILabel(frame: CGRect.zero) titleLabel.translatesAutoresizingMaskIntoConstraints = false titleLabel.font = UIFont(name: "Avenir-Medium", size: 22) - titleLabel.textColor = style == UIBlurEffectStyle.dark ? UIColor.white : UIColor.black + titleLabel.textColor = style == UIBlurEffect.Style.dark ? UIColor.white : UIColor.black titleLabel.textAlignment = NSTextAlignment.center titleLabel.text = "Adjust your Photo" headerView.addSubview(titleLabel) - titleLabel.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 44)) - headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: titleLabel, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0)) - headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: titleLabel, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 0)) - titleLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 250), for: UILayoutConstraintAxis.horizontal) + titleLabel.addConstraint(NSLayoutConstraint(item: titleLabel, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 44)) + headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutConstraint.Attribute.centerX, relatedBy: NSLayoutConstraint.Relation.equal, toItem: titleLabel, attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0)) + headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: titleLabel, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0)) + titleLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 250), for: NSLayoutConstraint.Axis.horizontal) - cancelButton = CBButton(type: UIButtonType.system) + cancelButton = CBButton(type: UIButton.ButtonType.system) cancelButton.translatesAutoresizingMaskIntoConstraints = false - cancelButton.setTitle("Cancel", for: UIControlState.normal) + cancelButton.setTitle("Cancel", for: UIControl.State.normal) cancelButton.titleLabel?.font = UIFont(name: "Avenir-Book", size: 18) - cancelButton.tintColor = UIColor(white: style == UIBlurEffectStyle.dark ? 0.9 : 0.1, alpha: 1) - cancelButton.addTarget(self, action: #selector(CBImageEditor.cancel), for: UIControlEvents.touchUpInside) + cancelButton.tintColor = UIColor(white: style == UIBlurEffect.Style.dark ? 0.9 : 0.1, alpha: 1) + cancelButton.addTarget(self, action: #selector(CBImageEditor.cancel), for: UIControl.Event.touchUpInside) headerView.addSubview(cancelButton) - cancelButton.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 44)) - headerView.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.lessThanOrEqual, toItem: titleLabel, attribute: NSLayoutAttribute.left, multiplier: 1, constant: -8)) - headerView.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: headerView, attribute: NSLayoutAttribute.left, multiplier: 1, constant: 8)) - headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: cancelButton, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 0)) + cancelButton.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 44)) + headerView.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.lessThanOrEqual, toItem: titleLabel, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: -8)) + headerView.addConstraint(NSLayoutConstraint(item: cancelButton, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: headerView, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 8)) + headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: cancelButton, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0)) - saveButton = CBButton(type: UIButtonType.system) + saveButton = CBButton(type: UIButton.ButtonType.system) saveButton.translatesAutoresizingMaskIntoConstraints = false - saveButton.setTitle("Save", for: UIControlState.normal) + saveButton.setTitle("Save", for: UIControl.State.normal) saveButton.titleLabel?.font = UIFont(name: "Avenir-Medium", size: 18) - saveButton.tintColor = UIColor(white: style == UIBlurEffectStyle.dark ? 0.9 : 0.1, alpha: 1) - saveButton.addTarget(self, action: #selector(CBImageEditor.finish), for: UIControlEvents.touchUpInside) + saveButton.tintColor = UIColor(white: style == UIBlurEffect.Style.dark ? 0.9 : 0.1, alpha: 1) + saveButton.addTarget(self, action: #selector(CBImageEditor.finish), for: UIControl.Event.touchUpInside) headerView.addSubview(saveButton) - saveButton.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 44)) - headerView.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: headerView, attribute: NSLayoutAttribute.right, multiplier: 1, constant: -8)) - headerView.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.greaterThanOrEqual, toItem: titleLabel, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 8)) - headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: saveButton, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 0)) + saveButton.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 44)) + headerView.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: headerView, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: -8)) + headerView.addConstraint(NSLayoutConstraint(item: saveButton, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.greaterThanOrEqual, toItem: titleLabel, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 8)) + headerView.addConstraint(NSLayoutConstraint(item: headerView, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: saveButton, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0)) let cvLayout = UICollectionViewFlowLayout() - cvLayout.scrollDirection = UICollectionViewScrollDirection.horizontal + cvLayout.scrollDirection = UICollectionView.ScrollDirection.horizontal cvLayout.minimumInteritemSpacing = 4 cvLayout.minimumLineSpacing = 4 filterCV = UICollectionView(frame: CGRect.zero, collectionViewLayout: cvLayout) @@ -206,47 +206,47 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio self.view.addSubview(filterCV) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: filterCV, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: filterCV, attribute: NSLayoutAttribute.left, multiplier: 1, constant: 0)) - self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: filterCV, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 0)) - filterHeightConstraint = NSLayoutConstraint(item: filterCV, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 60 ) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.bottom, relatedBy: NSLayoutConstraint.Relation.equal, toItem: filterCV, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: filterCV, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: self.view, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: filterCV, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 0)) + filterHeightConstraint = NSLayoutConstraint(item: filterCV, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 60 ) filterCV.addConstraint(filterHeightConstraint) - verticalButton = CBButton(type: UIButtonType.system) + verticalButton = CBButton(type: UIButton.ButtonType.system) verticalButton.translatesAutoresizingMaskIntoConstraints = false - verticalButton.addTarget(self, action: #selector(CBImageEditor.setVerticalCrop), for: UIControlEvents.touchUpInside) + verticalButton.addTarget(self, action: #selector(CBImageEditor.setVerticalCrop), for: UIControl.Event.touchUpInside) self.view.addSubview(verticalButton) - verticalButton.layer.borderColor = UIColor(white: style == UIBlurEffectStyle.dark ? 1 : 0, alpha: 0.6).cgColor + verticalButton.layer.borderColor = UIColor(white: style == UIBlurEffect.Style.dark ? 1 : 0, alpha: 0.6).cgColor verticalButton.layer.borderWidth = 2 - self.view.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: self.view, attribute: NSLayoutAttribute.left, multiplier: 1, constant: 8)) - self.view.addConstraint(NSLayoutConstraint(item: filterCV, attribute: NSLayoutAttribute.top, relatedBy: NSLayoutRelation.equal, toItem: verticalButton, attribute: NSLayoutAttribute.bottom, multiplier: 1, constant: 8)) - verticalButton.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 18)) - verticalButton.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 26)) + self.view.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self.view, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: 8)) + self.view.addConstraint(NSLayoutConstraint(item: filterCV, attribute: NSLayoutConstraint.Attribute.top, relatedBy: NSLayoutConstraint.Relation.equal, toItem: verticalButton, attribute: NSLayoutConstraint.Attribute.bottom, multiplier: 1, constant: 8)) + verticalButton.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)) + verticalButton.addConstraint(NSLayoutConstraint(item: verticalButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 26)) - horizontalButton = CBButton(type: UIButtonType.system) + horizontalButton = CBButton(type: UIButton.ButtonType.system) horizontalButton.translatesAutoresizingMaskIntoConstraints = false - horizontalButton.addTarget(self, action: #selector(CBImageEditor.setHorizontalCrop), for: UIControlEvents.touchUpInside) + horizontalButton.addTarget(self, action: #selector(CBImageEditor.setHorizontalCrop), for: UIControl.Event.touchUpInside) self.view.addSubview(horizontalButton) - horizontalButton.layer.borderColor = UIColor(white: style == UIBlurEffectStyle.dark ? 1 : 0, alpha: 0.6).cgColor + horizontalButton.layer.borderColor = UIColor(white: style == UIBlurEffect.Style.dark ? 1 : 0, alpha: 0.6).cgColor horizontalButton.layer.borderWidth = 2 - self.view.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: verticalButton, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 8)) - horizontalButton.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 26)) - horizontalButton.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 18)) - self.view.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: verticalButton, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: verticalButton, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 8)) + horizontalButton.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 26)) + horizontalButton.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 18)) + self.view.addConstraint(NSLayoutConstraint(item: horizontalButton, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: verticalButton, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0)) - squareButton = CBButton(type: UIButtonType.system) + squareButton = CBButton(type: UIButton.ButtonType.system) squareButton.translatesAutoresizingMaskIntoConstraints = false - squareButton.addTarget(self, action: #selector(CBImageEditor.setSquareCrop), for: UIControlEvents.touchUpInside) + squareButton.addTarget(self, action: #selector(CBImageEditor.setSquareCrop), for: UIControl.Event.touchUpInside) self.view.addSubview(squareButton) - squareButton.layer.borderColor = UIColor(white: style == UIBlurEffectStyle.dark ? 1 : 0, alpha: 0.6).cgColor + squareButton.layer.borderColor = UIColor(white: style == UIBlurEffect.Style.dark ? 1 : 0, alpha: 0.6).cgColor squareButton.layer.borderWidth = 2 - self.view.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: horizontalButton, attribute: NSLayoutAttribute.right, multiplier: 1, constant: 8)) - squareButton.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 20)) - squareButton.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 20)) - self.view.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: verticalButton, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0)) + self.view.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: horizontalButton, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: 8)) + squareButton.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 20)) + squareButton.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 20)) + self.view.addConstraint(NSLayoutConstraint(item: squareButton, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: verticalButton, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0)) self.enableFilters(true, animated: false) @@ -295,7 +295,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio } if animated { - UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: { () -> Void in + UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIView.AnimationOptions.allowUserInteraction, animations: { () -> Void in self.view.layoutIfNeeded() }, completion: nil) } @@ -325,7 +325,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio let image = CIImage(cgImage: filter.previewImage!.cgImage!) var params = filter.params as! [String:AnyObject] params[kCIInputImageKey] = image - let ciFilter = CIFilter(name: filter.key, withInputParameters: params) + let ciFilter = CIFilter(name: filter.key, parameters: params) let outImage = ciFilter!.outputImage let cgImage = self.imageContext.createCGImage(outImage!, from: outImage!.extent) let img = UIImage(cgImage: cgImage!) @@ -393,7 +393,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio if layerMask == nil { let fillLayer = CAShapeLayer() fillLayer.path = path.cgPath - fillLayer.fillRule = kCAFillRuleEvenOdd + fillLayer.fillRule = CAShapeLayerFillRule.evenOdd blurView.layer.mask = fillLayer } else { @@ -432,9 +432,9 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio if ratioConstraint != nil { self.view.removeConstraint(ratioConstraint!) } - ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: scrollView, attribute: NSLayoutAttribute.height, multiplier: 1, constant: 0) + ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.height, multiplier: 1, constant: 0) self.view.addConstraint(ratioConstraint!) - UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.view.layoutIfNeeded() }, completion: nil) @@ -448,9 +448,9 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio if ratioConstraint != nil { self.view.removeConstraint(ratioConstraint!) } - ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: scrollView, attribute: NSLayoutAttribute.height, multiplier: horizontalRatio.width/horizontalRatio.height, constant: 0) + ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.height, multiplier: horizontalRatio.width/horizontalRatio.height, constant: 0) self.view.addConstraint(ratioConstraint!) - UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.view.layoutIfNeeded() }, completion: nil) @@ -464,9 +464,9 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio if ratioConstraint != nil { self.view.removeConstraint(ratioConstraint!) } - ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutAttribute.width, relatedBy: NSLayoutRelation.equal, toItem: scrollView, attribute: NSLayoutAttribute.height, multiplier: verticalRatio.width/verticalRatio.height, constant: 0) + ratioConstraint = NSLayoutConstraint(item: scrollView, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: scrollView, attribute: NSLayoutConstraint.Attribute.height, multiplier: verticalRatio.width/verticalRatio.height, constant: 0) self.view.addConstraint(ratioConstraint!) - UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIViewAnimationOptions.curveEaseInOut, UIViewAnimationOptions.allowUserInteraction], animations: { () -> Void in + UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [UIView.AnimationOptions.curveEaseInOut, UIView.AnimationOptions.allowUserInteraction], animations: { () -> Void in self.view.layoutIfNeeded() }, completion: nil) @@ -517,7 +517,7 @@ public class CBImageEditor: UIViewController, UIScrollViewDelegate, UICollectio let image = CIImage(cgImage: originalImage.cgImage!) var params = filter.params as! [String:AnyObject] params[kCIInputImageKey] = image - let ciFilter = CIFilter(name: filter.key, withInputParameters: params) + let ciFilter = CIFilter(name: filter.key, parameters: params) let outImage = ciFilter!.outputImage let cgImage = imageContext.createCGImage(outImage!, from: outImage!.extent) let img = UIImage(cgImage: cgImage!) @@ -541,7 +541,7 @@ class CropperFilterCell : UICollectionViewCell { self.layer.cornerRadius = 2 self.clipsToBounds = true imageView = CBImageView() - imageView.contentMode = UIViewContentMode.scaleAspectFill + imageView.contentMode = UIView.ContentMode.scaleAspectFill self.addSubview(imageView) _ = imageView.addConstraintsToMatchParent() } diff --git a/CBToolkit/CBToolkit/CBImageView.swift b/CBToolkit/CBToolkit/CBImageView.swift index ab57eeb..a8b026d 100644 --- a/CBToolkit/CBToolkit/CBImageView.swift +++ b/CBToolkit/CBToolkit/CBImageView.swift @@ -48,7 +48,7 @@ import UIKit @IBInspectable public var tinted: Bool = false { didSet { if self.image != nil { - self.image = self.image?.withRenderingMode(tinted ? UIImageRenderingMode.alwaysTemplate : UIImageRenderingMode.automatic) + self.image = self.image?.withRenderingMode(tinted ? UIImage.RenderingMode.alwaysTemplate : UIImage.RenderingMode.automatic) } } } @@ -63,7 +63,7 @@ import UIKit didSet { if self.image == nil && placeholderImage != nil { if tinted { - self.image = placeholderImage?.withRenderingMode(UIImageRenderingMode.alwaysTemplate) + self.image = placeholderImage?.withRenderingMode(UIImage.RenderingMode.alwaysTemplate) } else { self.image = placeholderImage @@ -85,7 +85,7 @@ import UIKit self.layer.removeAllAnimations() if image == nil && self.placeholderImage != nil { if tinted { - self.image = placeholderImage?.withRenderingMode(UIImageRenderingMode.alwaysTemplate) + self.image = placeholderImage?.withRenderingMode(UIImage.RenderingMode.alwaysTemplate) } else { self.image = placeholderImage @@ -106,14 +106,14 @@ import UIKit self.image = nil } else if image != nil { - self.image = newImage!.withRenderingMode(UIImageRenderingMode.alwaysTemplate) + self.image = newImage!.withRenderingMode(UIImage.RenderingMode.alwaysTemplate) } } // MARK: - Loading images /// The transition to apply when a remote image is loaded - public var onLoadTransition: UIViewAnimationOptions = [] + public var onLoadTransition: UIView.AnimationOptions = [] /** Load an image at the given URL using CBPhotoFetcher and display it. diff --git a/CBToolkit/CBToolkit/CBLogger.swift b/CBToolkit/CBToolkit/CBLogger.swift index 2988241..f443b14 100644 --- a/CBToolkit/CBToolkit/CBLogger.swift +++ b/CBToolkit/CBToolkit/CBLogger.swift @@ -91,7 +91,7 @@ public class CBLogger { if dest.shouldLevelBeLogged(level: level, path: path, function: function) && dest.queue != nil { // try to convert msg object to String and put it on queue let msgStr = "\(msg)" - if msgStr.characters.count > 0 { + if msgStr.count > 0 { queue.async(execute: { _ = dest.send(level: level, msg: msgStr, thread: thread, path: path, function: function, line: line) }) @@ -249,8 +249,8 @@ public class BaseDestination: Hashable, Equatable { str += "\(function) " } - if self.log_maxMessage > 100 && msg.characters.count > self.log_maxMessage { - str += "\(levelString): \(msg.substring(to: msg.index(msg.startIndex, offsetBy: self.log_maxMessage)))" + if self.log_maxMessage > 100 && msg.count > self.log_maxMessage { + str += "\(levelString): \(msg[msg.startIndex.. String { + func sub(to: Int) -> Substring { let idx = self.index(self.startIndex, offsetBy: to) - return self.substring(to: idx) + return self[self.startIndex.. String { + func sub(from: Int) -> Substring { let idx = self.index(self.startIndex, offsetBy: from) - return self.substring(from: idx) + return self[idx.. String { + func sub(from: Int, to: Int) -> Substring { let start = self.index(self.startIndex, offsetBy: from) let end = self.index(self.startIndex, offsetBy: to) - return String(self[start..= 10) } @@ -94,8 +94,8 @@ public class CBPhoneNumber { Remove the last number from the phone number */ public func removeLast() { - if baseString.characters.count > 0 { - baseString = baseString.sub(to: baseString.characters.count-1) + if baseString.count > 0 { + baseString = String(baseString.sub(to: baseString.count-1)) } } @@ -106,23 +106,23 @@ public class CBPhoneNumber { */ open var formattedString : String { - if baseString.characters.count == 0 { + if baseString.count == 0 { return baseString } - else if baseString.characters.count > 11 { + else if baseString.count > 11 { return baseString } - var prefix: String? = baseString.sub(to: 1) + var prefix: String? = String(baseString.sub(to: 1)) var string = baseString if prefix != "1" { prefix = nil } else { - string = baseString.sub(from: 1) + string = String(baseString.sub(from: 1)) } - let length = string.characters.count + let length = string.count if length <= 3 { if length > 0 && prefix != nil { string = "(\(string))" @@ -130,10 +130,10 @@ public class CBPhoneNumber { } else if length <= 7 { let firstThree = string.sub(to: 3) - var partial = string.sub(from: 3, to: length-3) + var partial = String(string.sub(from: 3, to: length-3)) if prefix != nil{ - if partial.characters.count == 4 { + if partial.count == 4 { partial = "\(partial.sub(to: 3))-\(partial.sub(from: 3))" } diff --git a/CBToolkit/CBToolkit/CBSliderCollectionViewLayout.swift b/CBToolkit/CBToolkit/CBSliderCollectionViewLayout.swift index c7925ad..bb65df1 100644 --- a/CBToolkit/CBToolkit/CBSliderCollectionViewLayout.swift +++ b/CBToolkit/CBToolkit/CBSliderCollectionViewLayout.swift @@ -33,7 +33,7 @@ public class CBSliderCollectionViewLayout : UICollectionViewFlowLayout { self.sectionInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) self.minimumInteritemSpacing = 0 self.minimumLineSpacing = 0 - self.scrollDirection = UICollectionViewScrollDirection.horizontal + self.scrollDirection = UICollectionView.ScrollDirection.horizontal } /** @@ -81,7 +81,7 @@ public class CBSliderCollectionViewLayout : UICollectionViewFlowLayout { } - self.collectionView?.scrollToItem(at: IndexPath(item: currentIndex, section: 0), at: UICollectionViewScrollPosition.left, animated: true) + self.collectionView?.scrollToItem(at: IndexPath(item: currentIndex, section: 0), at: UICollectionView.ScrollPosition.left, animated: true) } diff --git a/CBToolkit/CBToolkit/CBTextField.swift b/CBToolkit/CBToolkit/CBTextField.swift index 1339c70..28fece8 100644 --- a/CBToolkit/CBToolkit/CBTextField.swift +++ b/CBToolkit/CBToolkit/CBTextField.swift @@ -110,7 +110,7 @@ import UIKit @IBInspectable public var placeholderColor: UIColor! = UIColor(white: 1, alpha: 1) { didSet { if (placeholder != nil) { - let attrs: [NSAttributedStringKey:AnyObject] = [NSAttributedStringKey.foregroundColor: self.placeholderColor, NSAttributedStringKey.font : self.font!] + let attrs: [NSAttributedString.Key:AnyObject] = [NSAttributedString.Key.foregroundColor: self.placeholderColor, NSAttributedString.Key.font : self.font!] attributedPlaceholder = NSAttributedString(string: placeholder!, attributes: attrs) } self.setNeedsDisplay() @@ -119,8 +119,8 @@ import UIKit override public var placeholder: String? { didSet { if placeholder != nil { - attributedPlaceholder = NSAttributedString(string: placeholder!, attributes: [NSAttributedStringKey.foregroundColor: placeholderColor, - NSAttributedStringKey.font : self.font!]) + attributedPlaceholder = NSAttributedString(string: placeholder!, attributes: [NSAttributedString.Key.foregroundColor: placeholderColor, + NSAttributedString.Key.font : self.font!]) } self.setNeedsDisplay() } diff --git a/CBToolkit/CBToolkit/CBTextView.swift b/CBToolkit/CBToolkit/CBTextView.swift index ca2f73c..f369d6e 100644 --- a/CBToolkit/CBToolkit/CBTextView.swift +++ b/CBToolkit/CBToolkit/CBTextView.swift @@ -17,7 +17,7 @@ import UIKit didSet { if autoExpand { if heightConstraint == nil { - _heightConstraint = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: minimumHeight) + _heightConstraint = NSLayoutConstraint(item: self, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: minimumHeight) heightConstraint!.priority = UILayoutPriority(rawValue: 1000) self.addConstraint(heightConstraint!) self.layoutIfNeeded() @@ -116,7 +116,7 @@ import UIKit NotificationCenter.default.removeObserver(self) } else { - NotificationCenter.default.addObserver(self, selector: #selector(CBTextView.textDidChange), name: NSNotification.Name.UITextViewTextDidChange, object: self) + NotificationCenter.default.addObserver(self, selector: #selector(CBTextView.textDidChange), name: UITextView.textDidChangeNotification, object: self) self.superview?.translatesAutoresizingMaskIntoConstraints = false } } From 88e90920633f0a9a72db0b6e5f734120500d3997 Mon Sep 17 00:00:00 2001 From: wes Date: Thu, 19 Jul 2018 22:50:57 -0700 Subject: [PATCH 2/3] Resolve merge issues --- CBApp/CBApp/CVLayoutCell.swift | 4 ++-- CBToolkit/CBToolkit/CBExtensions.swift | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CBApp/CBApp/CVLayoutCell.swift b/CBApp/CBApp/CVLayoutCell.swift index 0914782..4d14ee6 100644 --- a/CBApp/CBApp/CVLayoutCell.swift +++ b/CBApp/CBApp/CVLayoutCell.swift @@ -78,7 +78,7 @@ class CVLayoutCell : UICollectionViewCell, UICollectionViewDataSource, UICollect let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "GalleryCell", for: indexPath) as! GalleryCell let imgIndex = (indexPath as NSIndexPath).row % imgURLs.count - let url = URL(string: imgURLs[imgIndex])! + let url = imgURLs[imgIndex] cell.imageView.onLoadTransition = UIView.AnimationOptions.transitionCrossDissolve cell.imageView.loadImage(at: url, completion: nil) @@ -87,7 +87,7 @@ class CVLayoutCell : UICollectionViewCell, UICollectionViewDataSource, UICollect func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let imgIndex = (indexPath as NSIndexPath).row % imgURLs.count - let url = URL(string: imgURLs[imgIndex])! + let url = imgURLs[imgIndex] CBPhotoFetcher.sharedFetcher.fetchImage(at: url, completion: { (image, error, requestTime) -> Void in if image != nil { self.delegate?.openImageEditor(image!) diff --git a/CBToolkit/CBToolkit/CBExtensions.swift b/CBToolkit/CBToolkit/CBExtensions.swift index c262ff4..64ad833 100644 --- a/CBToolkit/CBToolkit/CBExtensions.swift +++ b/CBToolkit/CBToolkit/CBExtensions.swift @@ -95,15 +95,15 @@ public extension UIView { func addVerticalCenterConstraint(_ offset: CGFloat, left: CGFloat? = nil, right: CGFloat? = nil) { if let sv = self.superview { - let centerY = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: offset) + let centerY = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.centerY, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: offset) sv.addConstraint(centerY) if let r = right { - let rightConstraint = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.right, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.right, multiplier: 1, constant: r) + let rightConstraint = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.right, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.right, multiplier: 1, constant: r) sv.addConstraint(rightConstraint) } if let l = left { - let leftConstraint = NSLayoutConstraint(item: sv, attribute: NSLayoutAttribute.left, relatedBy: NSLayoutRelation.equal, toItem: self, attribute: NSLayoutAttribute.left, multiplier: 1, constant: -l) + let leftConstraint = NSLayoutConstraint(item: sv, attribute: NSLayoutConstraint.Attribute.left, relatedBy: NSLayoutConstraint.Relation.equal, toItem: self, attribute: NSLayoutConstraint.Attribute.left, multiplier: 1, constant: -l) sv.addConstraint(leftConstraint) } self.translatesAutoresizingMaskIntoConstraints = false @@ -132,8 +132,8 @@ public extension UIAlertController { - returns: The UIAlertController initialized with the provided properties. */ public class func alertWithTitle(_ title: String?, message: String?, cancelButtonTitle button: String) -> UIAlertController { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) - alert.addAction(UIAlertAction(title: button, style: UIAlertActionStyle.default, handler: nil)) + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) + alert.addAction(UIAlertAction(title: button, style: UIAlertAction.Style.default, handler: nil)) return alert } From bfeab959c3b875487905f2e68d71b3cd41a78436 Mon Sep 17 00:00:00 2001 From: wes Date: Thu, 19 Jul 2018 23:01:11 -0700 Subject: [PATCH 3/3] Updated podspec --- CBToolkit.podspec | 2 +- CBToolkit/CBToolkit/CBPhotoFetcher.swift | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CBToolkit.podspec b/CBToolkit.podspec index 70fe6b1..8ad3759 100644 --- a/CBToolkit.podspec +++ b/CBToolkit.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "CBToolkit" - s.version = "0.2.3" + s.version = "1.0" s.summary = "A UI and utility Toolkit for iOS" s.homepage = "https://github.com/WCByrne/CBToolkit" s.license = "MIT" diff --git a/CBToolkit/CBToolkit/CBPhotoFetcher.swift b/CBToolkit/CBToolkit/CBPhotoFetcher.swift index 10b9018..b6ee013 100644 --- a/CBToolkit/CBToolkit/CBPhotoFetcher.swift +++ b/CBToolkit/CBToolkit/CBPhotoFetcher.swift @@ -245,8 +245,6 @@ class CBImageFetchRequest : NSObject, NSURLConnectionDelegate, NSURLConnectionDa } - - func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { self.progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) DispatchQueue.main.async(execute: {