Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 184.108.40.206 release ready!
Updated 25 June 2020
Today, I will discuss the UISplitViewController and how we can use it in our app.
Swift version: 5
iOS version: 13
Let start about the UISplitViewController.
A split view controller is a master or container view controller that manages child view controllers in a hierarchical interface. An example of the split view controller is Mail.app. The split view controller has supported both the iPad and iPhone, since iOS 8.
To more details about this click here.
In this tutorial, we will show the country list in master view and selected country details will display in the child view controller
Step 1: Create a project from Xcode.
File ▸ New ▸ Project…. Choose the iOS ▸ Application ▸ Single View App template and create a new project.
Step 2: Drag a Split View Controller in the main storyboard.
Now run the app.
Steps 3: Create a MasterViewController for the UItableviewController where we parse the JSON file and bind the table view.
import countries.json file in the project directory. Click here countries to download the JSON file.
Now, create the getCountryList method for parse the JSON file and call the on viewDidLoad.
Now, showing the countries in the table view.
This will look like the below image.
Step 4: Create a details view controller page and add UILabel which will show the country name from the master view controller.
Final Step: Now will pass the date from the master controller to details view controller and render it on screen.
Now, Confirm the didSelectRowAt delegate in the master view controller and access the UILabel from the details view.
I hope the above blog will help you to learn about UISplitViewController and how we will use it in our app.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.