That said, every rose has its thorns, and even your neighborhood playground may have a few inexplicable empty beer cans lying around by the preschool swing set.įirst, full disclosure: Xcode playgrounds and Swift Playgrounds on the iPad are a bit unstable. In fact, this more modular design is preferable. ![]() ![]() If you also need the view to have an API that does rely on the app’s custom types, you can layer that on afterwards with an extension. But oftentimes this is not necessary and you’d be better off to develop your custom view in the way Apple would, with a clean external API that relies only on standard basic types like String and UIImage. Or you might place key logic in the view controller expected to use the view. This final point is an important one: you might build a view to be configured by your app’s model type, like your User type. If you develop your view within your app, you will be tempted to think of the view as an outgrowth of your app, and to build it in such a way that it depends on your app. Seeing and working on a single view in isolation help you focus on the problem at hand rather than get distracted by the rest of the app.Įnforced modularity. Developing a view in the context of an app is distracting. So playgrounds can be faster, which keeps you in a state of flow.įocus. Although you could develop the view by repeatedly doing Build & Run on your app, you’d waste a lot of time compiling and then navigating through the app to the new view. This is often the case when you’re developing a moderately complex custom UIView subclass. More exactly, they’re great when you want rapid, iterative development of a well-isolated module. But since it seems like it’s not a common practice, I thought it might be interesting to share a few notes and examples of how we have used playgrounds developing the Topology app. There are WWDC sessions that go through the ins and outs of playgrounds. ![]() The talk was at NSMeetup, the local San Francisco meetup for iOS development, and someone in the audience asked if you can use Auto Layout in Xcode playgrounds.Īnswer: yes, you can! And playgrounds are great for UI development – flawed, but great. Last week, Agnes gave a talk on how we use–and love!–Auto Layout here at Topology.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |