Swift4 auto convert

This commit is contained in:
haranicle 2017-10-02 23:08:23 +09:00
parent df819fffb9
commit 688ced9981
5 changed files with 22 additions and 18 deletions

View File

@ -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;
};

View File

@ -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

View File

@ -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
}

View File

@ -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)

View File

@ -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