![]() ![]() This means that changes made by your second view controller won't be reflected in your first view controller, because your second one is using a copy of the array, not the same array. Keep in mind that when you pass an array in Swift, you're passing it by value, unlike Objective-C, which passes it by reference. Serdar's code example is right, that's the way to access another tab's view controller and give it data. Of the screen, even though it doesn't yet do anything:ġ1:00 When we select a recording, we notice we're missing a button toĭismiss the modal view controller.H. ![]() Label for the name of the selected recording.ġ0:46 Running the app, we now see the mini player embedded at the bottom Some of the subviews not needed for the mini player, like the text field and the We duplicate the play view controller in the storyboard, removing "Present Modally." This makes the player show up from the bottom of the screen.Ġ8:37 We need a second player to go into the empty spot of our root viewĬontroller. We change this segue's kind from "Show Detail" to Instead of pushing it onto the navigation stack. Embedding the PlayerĠ7:50 The next step is to present the play view controller modally We are ignoring thisįact in today's episode and instead focusing on the layout on iPhone. Supports iPad - hence the use of a split view controller. Run the app, and see that everything works the same way as before, with theĪddition of a blank space where the mini player will go.Ġ7:31 As a side note, we should mention that the sample app also View controller to be a split view controller: func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ?) -> Bool Ġ6:57 We update the type of the root view controller in our storyboard, Try to run this, we get a crash because the app delegate still expects the root Pick the split view controller as content for the large container view. Vertical constraint between the two, and we give the player's container a fixedĠ4:22 We mark the new view controller as the initial controller, and we Using layoutĬonstraints, we pin the container views to the superview's edges, we add a On top, and a smaller one for the mini player at the bottom. ![]() Step before updating our code, we're going to draw out these changes in theĠ2:54 We add a new view controller with two container views: a large one Hierarchy, and the detail view controller is the player:Ġ2:21 For the new version, we want to wrap this entire split viewĬontroller in a new container, which will be displayed at the top of the screen.Īt the bottom, we'll have another container holding the mini player. There'sĪ split view controller at the root, its master is the folder view controller Updating the StoryboardĠ1:53 The storyboard shows us the overall structure of the app. Playing the selected recording while we browse the folders. Would be nice to add a mini player at the bottom of the screen that keeps When we exit this view controller, playback is stopped. Today, we're working with the MVC version - the most commonly usedĪrchitecture in Cocoa - and we'll see what we need to do in order to implementĠ1:20 Currently, a selected recording is played by pushing a new play When we select a recording, it opens in a simple player.Ġ0:58 In the book, we wrote out a simple voice notes app in variousĪrchitectural patterns, but adding a feature might work differently in eachĪrchitecture. The recordingsĪre saved in a folder structure, which we can freely organize by creating newįolders and subfolders. New feature to the example app from the book.Ġ0:24 The app lets us record and play back voice memos. 00:06 We recently launched the early access version of our new book, App
0 Comments
Leave a Reply. |