![]() ![]() Your job is to add some custom presentation controller animations to your app to make it blossom! You’ll replace the current stock animation with one that expands the tapped recipe image to a full-screen view like so: That might be OK, but your recipes deserve better! Tap on one of the recipe image, and the details screen comes up via the standard vertical cover transition. Build and run the app to see how the app looks and feels: There’s already enough code in HomeViewController.swift and DetailsViewController.swift to support the basic app. This view controller sports an image, a title and a description. HomeViewController presents DetailsViewController whenever the user taps one of the images in the list. The first view controller, HomeViewController, contains the app’s recipe list. Open the starter project and select Main.storyboard to begin the tour: Getting Startedĭownload the project materials using the Download Materials button at the top or bottom of this tutorial. In this iOS animation tutorial, you’ll create your own custom presentation controller transitions to replace the default one and liven up this tutorial’s project. The illustration below shows a “New Contact” view controller sliding up over the list of contacts: This method “gives up” the current screen to another view controller using the default presentation animation to slide the new view up to cover the current one. Transitions are always called with the same UIKit method: present(_:animated:completion:). Whether you’re presenting the camera view controller or one of your own custom-designed modal screens, it’s important to understand how these transitions are happening. Update note: Fabrizio Brancati updated this tutorial for iOS 12, Xcode 10.2 and Swift 5. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |