Get Ready For The Big Screen(s) Apple made a big splash this week with the new iPad Pro. In the promo videos, they've shown off using the USB-C port to connect the iPad to an external display for creative tasks. This is a feature that few people know already exists on all iOS devices. You can connect an external display via a lightning adapter or AirPlay Screen Mirroring to an Apple TV. With this small amount of code, you can listen for the connection/disconnection of displays and set up a separate window and view controller hierarchy for the external display to augment your app's main content. import UIKit class ViewController: UIViewController { // For demo purposes. We're just showing a string description // of each UIScreen object on each screen's view controller @IBOutlet var screenLabel: UILabel! static func makeFromStoryboard() - ViewController { return UIStoryboard(name: "Main", bundle: nil) .instantiateInitialViewController() as! ViewController } } @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { // The main window shown on the device's display // The main storyboard will set this up automatically var window: UIWindow? // References to our windows that we're creating var windowsForScreens = [UIScreen: UIWindow]() // Create our view controller and add text to our test label private func addViewController(to window: UIWindow, text: String) { let vc = ViewController.
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
iOS
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
This article is related to
iOS
0 Comments