I am quite new to Swift and iOS.
I am just reading some sample codes. There is a line I cannot understand:
let splitViewController = self.window!.rootViewController as UISplitViewController
What does "as" do here?
Thanks
You use the as keyword to cast data types. UIWindow rootViewController is of type UIViewController. You downcast it to UISplitViewController.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With