This commit is contained in:
izumi 2018-10-05 18:21:50 +09:00
parent f44c660e17
commit 5c7102fad6
10 changed files with 21 additions and 21 deletions

View File

@ -613,7 +613,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
@ -634,7 +634,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};

View File

@ -23,22 +23,22 @@ class AlbumListEmptyIndicator: UILabel {
centerStyle.alignment = NSTextAlignment.center
let messageAttributes = [
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
NSAttributedString.Key.foregroundColor : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1),
NSAttributedString.Key.font : UIFont.systemFont(ofSize: 26),
NSAttributedString.Key.paragraphStyle : centerStyle
]
let messageText = NSAttributedString(string: message, attributes: messageAttributes)
let descriptionAttributes = [
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
NSAttributedString.Key.foregroundColor : config.color.empty ?? UIColor(red: 0x88/0xff, green: 0x88/0xff, blue: 0x88/0xff, alpha: 1),
NSAttributedString.Key.font : UIFont.systemFont(ofSize: 14),
NSAttributedString.Key.paragraphStyle : centerStyle
]
let descriptionText = NSAttributedString(string: description, attributes: descriptionAttributes)
let attributedText = NSMutableAttributedString()
attributedText.append(messageText)
attributedText.append(NSAttributedString(string: "\n\n", attributes: [NSAttributedStringKey.font : UIFont.systemFont(ofSize: 6)]))
attributedText.append(NSAttributedString(string: "\n\n", attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 6)]))
attributedText.append(descriptionText)
self.numberOfLines = 0

View File

@ -240,7 +240,7 @@ class AlbumListViewController: UITableViewController, EmptyIndicatable, Activity
var isLoading = true
func setUpActivityIndicator() {
activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
activityIndicator = UIActivityIndicatorView(style: .gray)
let screenRect = Size.screenRectWithoutAppBar(self)
activityIndicator?.center = CGPoint(x: screenRect.size.width / 2, y: screenRect.size.height / 2)
activityIndicator?.startAnimating()
@ -261,7 +261,7 @@ extension UIViewController {
let infoButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
infoButton.isEnabled = false
infoButton.setTitleTextAttributes([NSAttributedStringKey.font: UIFont.systemFont(ofSize: 14), NSAttributedStringKey.foregroundColor: UIColor.black], for: UIControlState())
infoButton.setTitleTextAttributes([NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14), NSAttributedString.Key.foregroundColor: UIColor.black], for: UIControl.State())
self.toolbarItems = [leftSpace, infoButton, rightSpace]
}

View File

@ -25,7 +25,7 @@ class AnimatableNavigationController: UINavigationController, UINavigationContro
self.delegate = self
}
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
switch operation {
case .push where fromVC is AssetListViewController:

View File

@ -30,7 +30,7 @@ class AssetCell: UICollectionViewCell {
let droppedImage: UIImage? = nohanaImagePickerController.config.image.droppedSmall ?? UIImage(named: "btn_select_m", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
let pickedImage: UIImage? = nohanaImagePickerController.config.image.pickedSmall ?? UIImage(named: "btn_selected_m", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
pickButton.setImage(droppedImage, for: UIControlState())
pickButton.setImage(droppedImage, for: UIControl.State())
pickButton.setImage(pickedImage, for: .selected)
}
}

View File

@ -38,7 +38,7 @@ class AssetDetailListViewController: AssetListViewController {
let droppedImage: UIImage? = nohanaImagePickerController.config.image.droppedLarge ?? UIImage(named: "btn_select_l", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
let pickedImage: UIImage? = nohanaImagePickerController.config.image.pickedLarge ?? UIImage(named: "btn_selected_l", in: nohanaImagePickerController.assetBundle, compatibleWith: nil)
pickButton.setImage(droppedImage, for: UIControlState())
pickButton.setImage(droppedImage, for: UIControl.State())
pickButton.setImage(pickedImage, for: .selected)
}
}
@ -76,7 +76,7 @@ class AssetDetailListViewController: AssetListViewController {
}
DispatchQueue.main.async {
let toIndexPath = IndexPath(item: indexPath.item, section: 0)
self.collectionView?.scrollToItem(at: toIndexPath, at: UICollectionViewScrollPosition.centeredHorizontally, animated: false)
self.collectionView?.scrollToItem(at: toIndexPath, at: UICollectionView.ScrollPosition.centeredHorizontally, animated: false)
}
}

View File

@ -35,7 +35,7 @@ class AssetListViewController: UICollectionViewController, UICollectionViewDeleg
return CGSize.zero
}
var numberOfColumns = nohanaImagePickerController.numberOfColumnsInLandscape
if UIInterfaceOrientationIsPortrait(UIApplication.shared.statusBarOrientation) {
if UIApplication.shared.statusBarOrientation.isPortrait {
numberOfColumns = nohanaImagePickerController.numberOfColumnsInPortrait
}
let cellMargin: CGFloat = 2

View File

@ -77,7 +77,7 @@ class ContractingAnimationController: NSObject, UIViewControllerAnimatedTransiti
UIView.animate(
withDuration: transitionDuration(using: transitionContext),
delay: 0,
options: UIViewAnimationOptions(),
options: UIView.AnimationOptions(),
animations: {
toVC.view.alpha = 1
contractingImageView.frame = Size.contractingAnimationToCellRect(toVC, toCell: toCell)

View File

@ -99,7 +99,7 @@ class MomentViewController: AssetListViewController, ActivityIndicatable {
override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
switch kind {
case UICollectionElementKindSectionHeader:
case UICollectionView.elementKindSectionHeader:
let album = momentAlbumList[indexPath.section]
guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "MomentHeader", for: indexPath) as? MomentSectionHeaderView else {
fatalError("failed to create MomentHeader")
@ -125,7 +125,7 @@ class MomentViewController: AssetListViewController, ActivityIndicatable {
var isLoading = true
func setUpActivityIndicator() {
activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
activityIndicator = UIActivityIndicatorView(style: .gray)
let screenRect = Size.screenRectWithoutAppBar(self)
activityIndicator?.center = CGPoint(x: screenRect.size.width / 2, y: screenRect.size.height / 2)
activityIndicator?.startAnimating()

View File

@ -106,9 +106,9 @@ open class NohanaImagePickerController: UIViewController {
guard let navigationController = storyboard.instantiateViewController(withIdentifier: viewControllerId) as? UINavigationController else {
fatalError("navigationController init failed.")
}
addChildViewController(navigationController)
addChild(navigationController)
view.addSubview(navigationController.view)
navigationController.didMove(toParentViewController: self)
navigationController.didMove(toParent: self)
// setup albumListViewController
guard let albumListViewController = navigationController.topViewController as? AlbumListViewController else {