Working independently with our new custom view

Now that we've successfully created our own custom view, let's take this a step further and extract this into its own file, so that we can work on this independently should we ever need to. To do that, follow these steps:

  1. Create a new file in our Xcode project called RecipeView, by highlighting the group name in the file tree, then right-click and select New File:
  1. Select SwiftUI View from the User Interface options and click Next. Call your new file RecipeView.swift and click Create.

    Once you've done that, you should see some boilerplate code again, however, you'll be presented with the following ...

Get Learn SwiftUI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.