forked from organicmaps/organicmaps
[ios] rename IPAD
func to isIPad
and make internal visibility
it may be used in different situations Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
parent
e53dcf7716
commit
c666a68b37
1 changed files with 4 additions and 4 deletions
|
@ -1,19 +1,19 @@
|
|||
import Foundation
|
||||
|
||||
private func IPAD() -> Bool { return UI_USER_INTERFACE_IDIOM() == .pad }
|
||||
var isIPad: Bool { return UI_USER_INTERFACE_IDIOM() == .pad }
|
||||
|
||||
func L(_ key: String) -> String { return NSLocalizedString(key, comment: "") }
|
||||
|
||||
func alternative<T>(iPhone: T, iPad: T) -> T { return IPAD() ? iPad : iPhone }
|
||||
func alternative<T>(iPhone: T, iPad: T) -> T { return isIPad ? iPad : iPhone }
|
||||
|
||||
func iPadSpecific(_ f: () -> Void) {
|
||||
if IPAD() {
|
||||
if isIPad {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
||||
func iPhoneSpecific(_ f: () -> Void) {
|
||||
if !IPAD() {
|
||||
if !isIPad {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue