mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-01 10:33:45 +00:00
[ios] rename isIPad to isiPad
To match swift naming conventions Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
c5b02a6580
commit
09c704ee8f
@@ -1,9 +1,9 @@
|
||||
extension UIViewController {
|
||||
func alternativeSizeClass<T>(iPhone: @autoclosure () -> T, iPad: @autoclosure () -> T) -> T {
|
||||
isIPad ? iPad() : iPhone()
|
||||
isiPad ? iPad() : iPhone()
|
||||
}
|
||||
|
||||
func alternativeSizeClass(iPhone: () -> Void, iPad: () -> Void) {
|
||||
isIPad ? iPad() : iPhone()
|
||||
isiPad ? iPad() : iPhone()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
var isIPad: Bool {
|
||||
var isiPad: Bool {
|
||||
if #available(iOS 14.0, *), ProcessInfo.processInfo.isiOSAppOnMac {
|
||||
return true
|
||||
}
|
||||
@@ -9,16 +9,16 @@ var isIPad: Bool {
|
||||
|
||||
func L(_ key: String) -> String { return NSLocalizedString(key, comment: "") }
|
||||
|
||||
func alternative<T>(iPhone: T, iPad: T) -> T { isIPad ? iPad : iPhone }
|
||||
func alternative<T>(iPhone: T, iPad: T) -> T { isiPad ? iPad : iPhone }
|
||||
|
||||
func iPadSpecific(_ f: () -> Void) {
|
||||
if isIPad {
|
||||
if isiPad {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
||||
func iPhoneSpecific(_ f: () -> Void) {
|
||||
if !isIPad {
|
||||
if !isiPad {
|
||||
f()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ extension GlobalStyleSheet: IStyleSheet {
|
||||
s.shadowRadius = 6
|
||||
s.cornerRadius = .modalSheet
|
||||
s.clip = false
|
||||
s.maskedCorners = isIPad ? [] : [.layerMinXMinYCorner, .layerMaxXMinYCorner]
|
||||
s.maskedCorners = isiPad ? [] : [.layerMinXMinYCorner, .layerMaxXMinYCorner]
|
||||
}
|
||||
case .modalSheetContent:
|
||||
return .addFrom(Self.modalSheetBackground) { s in
|
||||
|
||||
@@ -125,7 +125,7 @@ extension PlacePageStyleSheet: IStyleSheet {
|
||||
case .ppBackgroundView:
|
||||
return .addFrom(GlobalStyleSheet.modalSheetBackground) { s in
|
||||
s.backgroundColor = colors.pressBackground
|
||||
s.maskedCorners = isIPad ? CACornerMask.all : [.layerMinXMinYCorner, .layerMaxXMinYCorner]
|
||||
s.maskedCorners = isiPad ? CACornerMask.all : [.layerMinXMinYCorner, .layerMaxXMinYCorner]
|
||||
s.clip = false
|
||||
}
|
||||
case .ppView:
|
||||
|
||||
@@ -130,7 +130,7 @@ final class SearchOnMapTests: XCTestCase {
|
||||
searchManager.results = results
|
||||
|
||||
interactor.handle(.didSelectResult(results[0], withQuery: query))
|
||||
if isIPad {
|
||||
if isiPad {
|
||||
XCTAssertEqual(currentState, .searching)
|
||||
XCTAssertEqual(view.viewModel.presentationStep, .fullScreen)
|
||||
} else {
|
||||
@@ -145,7 +145,7 @@ final class SearchOnMapTests: XCTestCase {
|
||||
|
||||
interactor.handle(.didSelectPlaceOnMap)
|
||||
|
||||
if isIPad {
|
||||
if isiPad {
|
||||
XCTAssertNotEqual(view.viewModel.presentationStep, .hidden)
|
||||
} else {
|
||||
XCTAssertEqual(view.viewModel.presentationStep, .hidden)
|
||||
@@ -163,7 +163,7 @@ final class SearchOnMapTests: XCTestCase {
|
||||
searchManager.results = results
|
||||
|
||||
interactor.handle(.didSelectResult(results[0], withQuery: query))
|
||||
if isIPad {
|
||||
if isiPad {
|
||||
XCTAssertEqual(currentState, .searching)
|
||||
XCTAssertEqual(view.viewModel.presentationStep, .fullScreen)
|
||||
} else {
|
||||
|
||||
@@ -48,7 +48,7 @@ final class SearchOnMapInteractor: NSObject {
|
||||
case .didSelectResult(let result, let query):
|
||||
return processSelectedResult(result, query: query)
|
||||
case .didSelectPlaceOnMap:
|
||||
return isIPad ? .none : .setSearchScreenHidden(true)
|
||||
return isiPad ? .none : .setSearchScreenHidden(true)
|
||||
case .didDeselectPlaceOnMap:
|
||||
return deselectPlaceOnMap()
|
||||
case .didStartDraggingMap:
|
||||
@@ -113,7 +113,7 @@ final class SearchOnMapInteractor: NSObject {
|
||||
@unknown default:
|
||||
fatalError("Unsupported routingTooltipSearch")
|
||||
}
|
||||
return isIPad ? .none : .setSearchScreenHidden(true)
|
||||
return isiPad ? .none : .setSearchScreenHidden(true)
|
||||
case .suggestion:
|
||||
let suggestionQuery = SearchQuery(result.suggestion,
|
||||
locale: query.locale,
|
||||
|
||||
Reference in New Issue
Block a user