Merge pull request #5251 from igrechuhin/cleanup

[cleanup] [ios] Code cleanup.
This commit is contained in:
Sergey Yershov 2017-01-20 18:27:16 +03:00 committed by GitHub
commit ad1440b13d
3 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ fileprivate func IPAD() -> Bool { return UI_USER_INTERFACE_IDIOM() == .pad }
func L(_ key: String) -> String { return NSLocalizedString(key, comment: "") }
func val<T>(iPhone: T, iPad: T) -> T { return IPAD() ? iPad : iPhone }
func alternative<T>(iPhone: T, iPad: T) -> T { return IPAD() ? iPad : iPhone }
func iPadSpecific( _ f: () -> Void) {
if IPAD() {

View file

@ -2,5 +2,5 @@ import UIKit
class SearchBar: SolidTouchView {
override var visibleAreaAffectDirection: VisibleArea.Direction { return val(iPhone: .top, iPad: .left) }
override var visibleAreaAffectDirection: VisibleArea.Direction { return alternative(iPhone: .top, iPad: .left) }
}

View file

@ -105,8 +105,8 @@ final class WelcomePageController: UIPageViewController {
private func updateFrame() {
let parentView = parentController.view!
view.frame = val(iPhone: CGRect(origin: CGPoint(), size: parentView.size),
iPad: CGRect(x: parentView.center.x - 260, y: parentView.center.y - 300, width: 520, height: 600))
view.frame = alternative(iPhone: CGRect(origin: CGPoint(), size: parentView.size),
iPad: CGRect(x: parentView.center.x - 260, y: parentView.center.y - 300, width: 520, height: 600))
(currentController as! WelcomeProtocolBase).updateSize()
}