mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
[ios] Switched OSM profile to SwiftUI and redesigned it
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
db1ef9b148
commit
15c7e71866
24
iphone/Maps/Bridging/BridgeControllers.swift
Normal file
24
iphone/Maps/Bridging/BridgeControllers.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
|
||||
|
||||
/// Class for accesing SwiftUI views from Objective-C code
|
||||
@objc class BridgeControllers: NSObject {
|
||||
/// The `ProfileView`
|
||||
@objc static func profile() -> UIViewController {
|
||||
return UIHostingController(rootView: ProfileView())
|
||||
}
|
||||
|
||||
/// The `ProfileView` for presentation in an alert
|
||||
@objc static func profileAsAlert() -> UIViewController {
|
||||
return UIHostingController(rootView: ProfileView(isPresentedAsAlert: true))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Class for using the SwiftUI `ProfileView` in the interface builder
|
||||
class ProfileBridgeController: UIHostingController<ProfileView> {
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
super.init(coder: aDecoder, rootView: ProfileView())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user