Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying iOS 17 Programming for Beginners
  • Table Of Contents Toc
  • Feedback & Rating feedback
iOS 17 Programming for Beginners

iOS 17 Programming for Beginners

By : Ian Lockett, Ahmad Sahar
4.6 (21)
close
close
iOS 17 Programming for Beginners

iOS 17 Programming for Beginners

4.6 (21)
By: Ian Lockett, Ahmad Sahar

Overview of this book

In a world with nearly 2 million apps on the App Store, the demand for skilled iOS developers has never been higher. "iOS 17 Programming for Beginners, Eighth Edition" is your gateway to this lucrative and dynamic field. This hands-on guide is tailored for those who are new to iOS and takes you on a journey from learning the Swift language to crafting your own app and seeing it thrive on the App Store. Our approach is hands-on and practical. Each chapter is designed to be a stepping stone in your development journey, providing step-by-step tutorials, real-life examples, and clear explanations of complex concepts. As you progress, you'll not only be skilled in Swift but also incorporate cutting-edge technologies into your apps. You'll learn how to publish your creations and harness the power of iOS 17 through a straightforward and easy to program example app divided into manageable parts. By the time you've completed this book, you'll possess the skills and knowledge to not only develop and publish captivating apps but also leverage online resources to continually enhance your app development prowess.
Table of Contents (34 chapters)
close
close
1
Part 1: Swift
11
Part 2: Design
16
Part 3: Code
26
Part 4: Features
32
Other Books You May Enjoy
33
Index

Exploring sets

Let’s say you’re writing a Movies app and you want to store a list of movie genres. You could do this with a set.

A set stores values in an unordered list. Here’s what it looks like:

Figure 5.4: Set

All values are of the same type.

If you create a set using the let keyword, its contents can’t be changed after it has been created. If you want to change the contents after creation, use the var keyword.

Let’s look at how to work with sets. You’ll create a set by assigning a value to it in the next section.

Creating a set

Imagine that you are creating a Movies app and you would like to store movie genres in your app. As you have seen for arrays and dictionaries, you can create a set by declaring it and assigning a new value to it. Add the following code to your playground and click the Run button to run it:

var movieGenres: Set = ["Horror", "Action", "Romantic Comedy...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY