diff --git a/NohanaImagePicker.xcodeproj/project.pbxproj b/NohanaImagePicker.xcodeproj/project.pbxproj index 4598b76..6d1b2cb 100644 --- a/NohanaImagePicker.xcodeproj/project.pbxproj +++ b/NohanaImagePicker.xcodeproj/project.pbxproj @@ -318,11 +318,11 @@ TargetAttributes = { F208E5501CD7370B00FFC9F6 = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; F2C08D731C68651900B00181 = { CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -462,7 +462,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.nohana.NohanaImagePicker.Demo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -476,7 +477,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = jp.co.nohana.NohanaImagePicker.Demo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -607,7 +609,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -627,7 +630,8 @@ PRODUCT_BUNDLE_IDENTIFIER = jp.co.nohana.NohanaImagePicker; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/NohanaImagePicker/AlbumListEmptyIndicator.swift b/NohanaImagePicker/AlbumListEmptyIndicator.swift index 2f6f934..492d4c9 100644 --- a/NohanaImagePicker/AlbumListEmptyIndicator.swift +++ b/NohanaImagePicker/AlbumListEmptyIndicator.swift @@ -23,22 +23,22 @@ class AlbumListEmptyIndicator: UILabel { centerStyle.alignment = NSTextAlignment.center let messageAttributes = [ - NSForegroundColorAttributeName : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1), - NSFontAttributeName : UIFont.systemFont(ofSize: 26), - NSParagraphStyleAttributeName : centerStyle + NSAttributedStringKey.foregroundColor : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1), + NSAttributedStringKey.font : UIFont.systemFont(ofSize: 26), + NSAttributedStringKey.paragraphStyle : centerStyle ] let messageText = NSAttributedString(string: message, attributes: messageAttributes) let descriptionAttributes = [ - NSForegroundColorAttributeName : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1), - NSFontAttributeName : UIFont.systemFont(ofSize: 14), - NSParagraphStyleAttributeName : centerStyle + NSAttributedStringKey.foregroundColor : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1), + NSAttributedStringKey.font : UIFont.systemFont(ofSize: 14), + NSAttributedStringKey.paragraphStyle : centerStyle ] let descriptionText = NSAttributedString(string: description, attributes: descriptionAttributes) let attributedText = NSMutableAttributedString() attributedText.append(messageText) - attributedText.append(NSAttributedString(string: "\n\n", attributes: [NSFontAttributeName : UIFont.systemFont(ofSize: 6)])) + attributedText.append(NSAttributedString(string: "\n\n", attributes: [NSAttributedStringKey.font : UIFont.systemFont(ofSize: 6)])) attributedText.append(descriptionText) self.numberOfLines = 0 diff --git a/NohanaImagePicker/AlbumListViewController.swift b/NohanaImagePicker/AlbumListViewController.swift index c1e8ff2..32207f1 100644 --- a/NohanaImagePicker/AlbumListViewController.swift +++ b/NohanaImagePicker/AlbumListViewController.swift @@ -261,7 +261,7 @@ extension UIViewController { let infoButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) infoButton.isEnabled = false - infoButton.setTitleTextAttributes([NSFontAttributeName: UIFont.systemFont(ofSize: 14), NSForegroundColorAttributeName: UIColor.black], for: UIControlState()) + infoButton.setTitleTextAttributes([NSAttributedStringKey.font: UIFont.systemFont(ofSize: 14), NSAttributedStringKey.foregroundColor: UIColor.black], for: UIControlState()) self.toolbarItems = [leftSpace, infoButton, rightSpace] } @@ -292,14 +292,14 @@ extension UIViewController { NotificationCenter.default.addObserver(self, selector: #selector(AlbumListViewController.didDropPhotoKitAsset(_:)), name: NotificationInfo.Asset.PhotoKit.didDrop, object: nil) } - func didPickPhotoKitAsset(_ notification: Notification) { + @objc func didPickPhotoKitAsset(_ notification: Notification) { guard let picker = notification.object as? NohanaImagePickerController else { return } setToolbarTitle(picker) } - func didDropPhotoKitAsset(_ notification: Notification) { + @objc func didDropPhotoKitAsset(_ notification: Notification) { guard let picker = notification.object as? NohanaImagePickerController else { return } diff --git a/NohanaImagePicker/AssetDetailCell.swift b/NohanaImagePicker/AssetDetailCell.swift index 48acc54..c8804f8 100644 --- a/NohanaImagePicker/AssetDetailCell.swift +++ b/NohanaImagePicker/AssetDetailCell.swift @@ -50,7 +50,7 @@ class AssetDetailCell: UICollectionViewCell, UIScrollViewDelegate { // MARK: - Zoom - func didDoubleTap(_ sender: UITapGestureRecognizer) { + @objc func didDoubleTap(_ sender: UITapGestureRecognizer) { if scrollView.zoomScale < scrollView.maximumZoomScale { let center = sender.location(in: imageView) scrollView.zoom(to: zoomRect(center), animated: true) diff --git a/NohanaImagePicker/ContractingAnimationController.swift b/NohanaImagePicker/ContractingAnimationController.swift index 19af456..28dd324 100644 --- a/NohanaImagePicker/ContractingAnimationController.swift +++ b/NohanaImagePicker/ContractingAnimationController.swift @@ -78,7 +78,7 @@ class ContractingAnimationController: NSObject, UIViewControllerAnimatedTransiti withDuration: transitionDuration(using: transitionContext), delay: 0, options: UIViewAnimationOptions(), - animations: { _ in + animations: { toVC.view.alpha = 1 contractingImageView.frame = Size.contractingAnimationToCellRect(toVC, toCell: toCell) }) { _ in