Making Connections

There are a few common things people want to do when they’re building their apps. If any of these seem like something that fits in your app, have a look at the playground apps referenced there for some code or helpful things you can use in your own app.

For example, if you want to display (and select) photos from a person’s photo library, check out the Image Gallery sample app. There are a lot of moving pieces in that app and walk-through. Apple has some excellent tutorials that walk you through a lot of that content, which you can access here: https://developer.apple.com/tutorials/sample-apps/

The playground apps I talk about below come from my Adventures feed, which you can subscribe to here:

https://www.thecodehub.ie/playgrounds/

My Closet is a walk-through that takes you through a really common progression coders might go through when moving from a prototype to a working app.

The first part of the walk-through explains how to move from the first pass at turning your Keynote prototype into code and shows you how to use #Previews to make sure your designs will hold up to all sorts of variations in your content. We make good use of a List, too, to display a collection of things.

The second part of the walk-through adds features, bit by bit. We start with making our closet contents available throughout the app, then take the next logical step and add the ability to edit our closet. Since we might have a lot of items, we also add search and a few other features you’d expect to find in an app that keeps track of a number of items.

Beach Cleanup shows you how to take the About Me sample app and turn it into your own living, breathing prototype.

In particular, this app shows you…

  • … how to change an existing app template and make it your own
  • … some fun animation effects in the HomeView
  • … how to create a re-usable Logo view in BeachLogoView
  • … how to make your own data type in the Beach file and then use it to plot points on a Map in the FavoritesView

ChatBot shows you how to build an interface that allows a person to type in a question and get it answered. You’ll see how we use the QuestionAnswerer file to do all the heavy lifting of responding to anything a person types in, and then even how we keep a list of the interactions between the ChatBot and the user in the ChatBotView.


Like My Connected App, Space Photo will show you how to connect to a server over the internet, decode the data it sends you, and display it in a simple user interface.

The NASA Photo of the Day API might no longer be in service, but can you read the code and see how to make a network request, receive the response, and turn it into something we can use in our app?

This one is more advanced, as it comes from the Develop in Swift Data Collections material.


Drawing Canvas shows you how to add a canvas for your users to draw on with a few simple customization options. You can use that CanvasViewWrapper and CanvasView to embed this same functionality in your own app.

App-Wide Settings is a great place to look if you are…

  • … implementing a Settings Screen that will affect your app’s look or feel
  • … or looking to implement links that will take you from one screen to the next

My Connected App is a work-in-progress, but will show you how to interact with sources of data across the web, which is something we often do, leveraging the work of others to make our apps more engaging and useful.

There is more to come in the walk through, but this showcases connecting to a weather service and reading data taken from a sports API (or application programming interface — somewhere that tells us it can give us information back in a certain format that we can use).


Sharing Photos is an app that uses the Image Gallery app to show you how to share images with others via the built-in Share Sheet. Tap on the Simple Photo Sharing Example to see the code from SimpleImageSharingView in action.


Modal Sheets is a simplified example of how you might show a sheet that covers your app’s screen, which is a common thing to do when a person is editing or adding details to their data in your app.

From the ContentView the EditView will display over the screen so you can change the name being displayed.


Drawing Flags is an exercise to help you practice your layout skills by using flags of the world for your design inspiration.

You’ll also get some tips, in the walk-through, of best practices for naming files and views.


So go visit https://www.thecodehub.ie/playgrounds/ if you want to see how to implement some of the ideas you might have for your app. And, if you’re reading this on an iPad or a Mac with Playgrounds installed, you can click here to subscribe to the Adventures feed easily.