This is the code repository for iOS 14 Programming for Beginners - Fifth Edition, published by Packt.
Get started with building iOS apps with Swift 5.3 and Xcode 12
If you're a beginner looking to work and experiment with powerful iOS 14 features such as widgets and App Clips to create your own apps, this iOS programming guide is for you. The book offers a comprehensive introduction for experienced programmers who are new to iOS, taking you through the entire process of learning the Swift language, writing your own apps, and publishing them on the App Store.
This book covers the following exciting features:
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
if (test expression)
{
Statement upon condition is true
}
Following is what you need for this book: This book is for anyone who has programming experience but is new to Swift and iOS app development. Experienced programmers looking to explore the latest iOS 14 features will also find this book useful.
With the following software and hardware list you can run all code files present in the book (Chapter 1-26).
Chapter | Software required | OS required |
---|---|---|
1 to 26 | Xcode 12 or later | macOS 10.15 Catalina, macOS 11.0 Big Sur, or later |
26 | Apple Developer account | macOS 10.15 Catalina, macOS 11.0 Big Sur, or later |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
Click on the following link to see the Code in Action:
The UITableViewDelegate method that is triggered when a user taps a row in the table view is tableView(_:didSelectRowAt:). Add this method between the extension's curly braces. It should look like the following:
//MARK: UITableViewDelegate
extension LocationViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt
indexPath: IndexPath) {
if let cell = tableView.cellForRow(at: indexPath) {
cell.accessoryType = .checkmark
selectedCity = manager.locationItem(at: indexPath)
tableView.reloadData()
}
}
}
When the user taps a row on the Locations screen, a checkmark will appear in that row, and the selectedCity property is assigned the corresponding LocationItem instance in the locations array. For example, if you tap the third row, the LocationItem instance with the values "Charleston" and "NC" is assigned to selectedCity.
Ahmad Sahar is a trainer, presenter, and consultant at Tomafuwi Productions, specializing in conducting training courses for macOS and iOS, macOS Support Essentials certification courses, and iOS Development courses. He is a member of the DevCon iOS and MyCocoaHeads online communities in Malaysia, and has conducted presentations and talks for both groups. In his spare time, he likes building and programming LEGO Mindstorms robots.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。