Reputation: 956
I have an SwiftUI based native WatchOS app. I have 4 views that the user can swipe left and right to get to. This feature is not directly a SwiftUI feature so I am using WKInterfaceController.reloadRootConrollers(withNamesandContext:) However the screen sometimes just loads a blank screen when swiping. I don't see anything wrong in this code...
import WatchKit
import Foundation
import SwiftUI
class HostingController : WKHostingController<MeetingView> {
override init(){
super.init()
displayViews()
}
func displayViews() {
WKInterfaceController.reloadRootControllers(withNamesAndContexts: [
(name: "OneViewController", context: [:] as AnyObject),
(name: "TwoViewController", context: [:] as AnyObject),
(name: "ThreeViewController", context: [:] as AnyObject),
(name: "FourViewController", context: [:] as AnyObject),
])
}
override var body: MainView {
return MainView()
}
}
Upvotes: 0
Views: 282
Reputation: 956
Appears to have been a WatchOS bug... it is no longer a problem.
Upvotes: 0