Skip to content
Swift - Swift Switching to a New XIB View Demo - Demo 19 of 30
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Switching XIB.xcodeproj
Switching XIB


Swift - Swift Switching to a New XIB View Demo - Demo 19 of 30

App created in Xcode 11.0 using Swift 5.0, iOS Deployment Target 13.0 and tested on a iPhone 11 Pro Max Emulator

In this demo app we demonstrate how to code swift Switching Views to the old XIB view.

There are so many interesting things within swift. This demo shows one way to use Switching View option to a XIB file in an app. We no longer use XIB files since its been upgraded to storyboards. But you might come across this if you are maintaining a legacy app. So it will give you an idea of how to switch via code from the view controller to the XIB view and then also back via code by just dismissing the previous action.

As the user gets into the app they are greeted with a title label on top 'Switching New XIB View Demo' and the view label right below 'Main View'. Then right below is one large color filled button which give instructions for what to click and view 'Click for XIB View'. The button is colored green with a blue color for the font. The background of the main view is in orange.

When the user clicks the button, they are taken to the XIB view. The view has a top title label 'XIB View' to let the user know they have arrived. Followed by a button labeled 'Click for Main View. The background of the XIB view is in green. Also, all of the transitions were done via code.

Coming soon:
Details and the screen cap images of the app in use can be found on Digital Mirko.

Screen Cap on a iPhone 11 Pro Max device:(shown below)
(Left image) App started.
(Middle Image) Button Clicked 'Click for XIB View ' user taken to the XIB view.
(Right image) Button Clicked 'Click for Main View ' user taken back to main view

You can’t perform that action at this time.