From 52a40aa1771d067a3fc514109885e6a204b07d48 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 27 Nov 2017 14:04:03 +0300 Subject: [PATCH] [MAPSME-5993] [ios] Code cleanup. --- iphone/Maps/Categories/String+BoundingRect.swift | 6 +++--- iphone/Maps/Common/Common.swift | 2 +- .../Content/Gallery/Photos/PhotoScalingView.swift | 2 +- iphone/Maps/UI/Welcome/WhatsNewController.swift | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iphone/Maps/Categories/String+BoundingRect.swift b/iphone/Maps/Categories/String+BoundingRect.swift index 66dcb88b5e..ef9f0336a0 100644 --- a/iphone/Maps/Categories/String+BoundingRect.swift +++ b/iphone/Maps/Categories/String+BoundingRect.swift @@ -2,10 +2,10 @@ import UIKit extension String { func size(width: CGFloat, font: UIFont, maxNumberOfLines: Int = 0) -> CGSize { - if (isEmpty) { - return CGSize(width: width, height: 0); + if isEmpty { + return CGSize(width: width, height: 0) } - + let maximumHeight = maxNumberOfLines == 0 ? CGFloat.greatestFiniteMagnitude : font.lineHeight * CGFloat(maxNumberOfLines + 1) let constraintSize = CGSize(width: width, height: maximumHeight) let options: NSStringDrawingOptions = [.usesLineFragmentOrigin, .usesFontLeading] diff --git a/iphone/Maps/Common/Common.swift b/iphone/Maps/Common/Common.swift index eac2f5c84e..f83fa81c67 100644 --- a/iphone/Maps/Common/Common.swift +++ b/iphone/Maps/Common/Common.swift @@ -1,6 +1,6 @@ import Foundation -fileprivate func IPAD() -> Bool { return UI_USER_INTERFACE_IDIOM() == .pad } +private func IPAD() -> Bool { return UI_USER_INTERFACE_IDIOM() == .pad } func L(_ key: String) -> String { return NSLocalizedString(key, comment: "") } diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift index 6a70541e75..6ff0e486b5 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/Gallery/Photos/PhotoScalingView.swift @@ -50,7 +50,7 @@ final class PhotoScalingView: UIScrollView { private func centerScrollViewContents() { let horizontalInset: CGFloat = contentSize.width < bounds.width ? (bounds.width - contentSize.width) * 0.5 : 0 let verticalInset: CGFloat = contentSize.height < bounds.height ? (bounds.height - contentSize.height) * 0.5 : 0 - contentInset = UIEdgeInsetsMake(verticalInset, horizontalInset, verticalInset, horizontalInset) + contentInset = UIEdgeInsets(top: verticalInset, left: horizontalInset, bottom: verticalInset, right: horizontalInset) } private func updateImage(_ photo: GalleryItemModel?) { diff --git a/iphone/Maps/UI/Welcome/WhatsNewController.swift b/iphone/Maps/UI/Welcome/WhatsNewController.swift index dbc03f8ca4..339b30d561 100644 --- a/iphone/Maps/UI/Welcome/WhatsNewController.swift +++ b/iphone/Maps/UI/Welcome/WhatsNewController.swift @@ -3,11 +3,11 @@ import UIKit final class WhatsNewController: MWMViewController, WelcomeProtocol { static var welcomeConfigs: [WelcomeConfig] = [ -// WelcomeConfig(image: #imageLiteral(resourceName: "img_whats_new_route"), -// title: "whats_new_title_route", -// text: "whats_new_message_route", -// buttonTitle: "whats_new_next_button", -// buttonAction: #selector(nextPage)), + // WelcomeConfig(image: #imageLiteral(resourceName: "img_whats_new_route"), + // title: "whats_new_title_route", + // text: "whats_new_message_route", + // buttonTitle: "whats_new_next_button", + // buttonAction: #selector(nextPage)), WelcomeConfig(image: #imageLiteral(resourceName: "img_whats_new_ugc"), title: "whats_new_ugc_title", text: "whats_new_ugc_message",