Files
comaps/iphone/Maps/Bridging/BridgeControllers.swift
Yannik Bloscheck 15c7e71866 [ios] Switched OSM profile to SwiftUI and redesigned it
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2025-07-06 13:30:59 +02:00

25 lines
744 B
Swift

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