[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:
Kiryl Kaveryn 2025-02-05 15:34:45 +04:00 committed by Roman Tsisyk
parent e53dcf7716
commit c666a68b37

View file

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