Please open the ProductTableViewController.swift class and add the following import statements to it: import SAPFiori It is time to populate the table view with data from the backend. The base View Controller is created and set as initial screen after the Onboarding flow. The screen will be visible after you completed the Onboarding flow. If you run the app now, you should see a screen with an empty UITableView. Instead of instantiating the MainSplitViewController the UIStoryboard will instantiate the initial View Controller and cast it to the ProductTableViewController. With: let productTableViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateInitialViewController() as! ProductTableViewControllerĪppViewController = productTableViewController SplitViewController.preferredDisplayMode =. SplitViewController.modalPresentationStyle =. Let splitViewController = UIStoryboard(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "MainSplitViewController") as! UISplitViewController Replace the following code inside the showApplicationScreen(completionHandler:) method: let appDelegate = ( as! AppDelegate) We deleted those so we have to make sure that our ProductTableViewController will be instantiated instead. Once you’ve opened the file, you can quickly jump to the showApplicationScreen(completionHandler: (Error?) -> Void) function by using the jump bar at the top of the editor area pane.Ĭurrently the code will try instantiating the first screen of the Master-Detail View. Hint: You can use the Open Quickly feature of Xcode to search for the ApplicationUIManager class with Command + Shift + O. In Xcode, open ApplicationUIManager.swift and locate the method showApplicationScreen(completionHandler: (Error?) -> Void). The ApplicationUIManager is a class responsible for managing initial and Splash screens for the Onboarding UI flow. The name in the hierarchy stack should change now and display the name of the added class.Īll the setup is done now for a new and fresh UI, the last step would be changing the ApplicationUIManager.swift code to load the new View Controller instead of the old Master-Detail View ones. Under Custom Class enter the ProductTableViewController and hit return. Backing up a View Controller in storyboard is simple, select the view controller and click on the Identity Inspector icon on the right-hand side. Go back to the Main.storyboard and select the UITableViewController. Please don’t forget to check that Swift is selected as language before creating the class. In the upcoming dialogue make sure that Subclass of: is UITableViewController and choose ProductTableViewController as class name. Choose File -> New -> File… or simply right-click to open the context menu and click on New File…. Select the top-level group in the Project navigator on the left-hand side. To actually work with the View Controller a subclass of UITableViewController must be created and connected to the UI representative in Interface Builder. Check the box Is Initial View Controller, an arrow should appear next to the View Controller. In the Main.storyboard select the UITableViewController and go to the Attributes Inspector on the right sidebar. To give the app the correct entry point it is necessary to make the newly added UITableViewController an initial View Controller. This will later display a list of products and implement the FUISearchBar and FUIBarcodeScanner. Next add a new UITableViewController to the storyboard from the Object Library. Select all View Controllers and delete them. Open the Main.storyboard in Interface Builder to delete the existing generated UI. The app contains a Master-Detail View which has to be removed to add a UITableViewController displaying a list of products. Please open up the TutorialApp created in the above mentioned tutorial group. This tutorial uses the generated app out of the Set Up the SAP BTP SDK for iOS tutorial group.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |