Swift 5 for Absolute Beginners -  Gary Bennett,  Stefan Kaczmarek,  Brad Lees

Swift 5 for Absolute Beginners (eBook)

Learn to Develop Apps for iOS
eBook Download: PDF
2019 | 5. Auflage
XXI, 373 Seiten
Apress (Verlag)
978-1-4842-4868-3 (ISBN)
Systemvoraussetzungen
46,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Stay motivated and overcome obstacles while learning to use Swift Playgrounds and Xcode 10.2 to become a great iOS developer. This book, fully updated for Swift 5, is perfect for those with no programming background, those with some programming experience but no object-oriented experience, or those that have a great idea for an app but haven't programmed since school.

Many people have a difficult time believing they can learn to write iOS apps. Swift 5 for Absolute Beginners will show you how to do so. You'll learn Object-Oriented Programming (OOP) and be introduced to User Interface (UI) design following Apple's Human Interface Guidelines (HIG) using storyboards and the Model-View-Controller (MVC) pattern before moving on to write your own iPhone and Apple Watch apps from scratch.

What You'll Learn

  • Work with Swift classes, properties, and functions
  • Examine proper User Interface (UI) and User Experience (UX) design
  • Understand Swift data types: integers, floats, strings, and booleans
  • Use Swift data collections: arrays and dictionaries
  • Review Boolean logic, comparing data, and flow control
  • Use the Xcode debugger to troubleshoot problems with your apps
  • Store data in local app preferences and Core Data databases


Who This Book Is For

Anyone who wants to learn to develop apps for the Mac, iPhone, iPad, and Apple Watch using the Swift programming language. No previous programming experience is necessary.




Stefan Kaczmarek is a software Engineer with over 20 years of experience specializing in mobile applications, large-scale software systems, project management, network protocols, encryption algorithms, and audio/video codecs. He has experience developing iOS software from webcams to fitness to education to point of sale. Stefan is also the author of Swift 4 For Absolute Beginners and Objective-C For Absolute Beginners.


Brad Lees has more than a decade of experience in application development and server management. He has specialized in creating and initiating software programs in real-estate development systems and financial institutions. His career has been highlighted by his positions as information systems manager at The Lyle Anderson Company, product development manager for Smarsh, vice president of application development for iNation, and IT manager at The Orcutt/Winslow Partnership, the largest architectural firm in Arizona. A graduate of Arizona State University, Brad and his wife, Natalie, reside in Phoenix with their five children.

Stay motivated and overcome obstacles while learning to use Swift Playgrounds and Xcode 10.2 to become a great iOS developer. This book, fully updated for Swift 5, is perfect for those with no programming background, those with some programming experience but no object-oriented experience, or those that have a great idea for an app but haven't programmed since school.Many people have a difficult time believing they can learn to write iOS apps. Swift 5 for Absolute Beginners will show you how to do so. You'll learn Object-Oriented Programming (OOP) and be introduced to User Interface (UI) design following Apple's Human Interface Guidelines (HIG) using storyboards and the Model-View-Controller (MVC) pattern before moving on to write your own iPhone and Apple Watch apps from scratch.What You'll LearnWork with Swift classes, properties, and functionsExamine proper User Interface (UI) and User Experience (UX)designUnderstand Swift data types: integers, floats, strings, and booleansUse Swift data collections: arrays and dictionariesReview Boolean logic, comparing data, and flow controlUse the Xcode debugger to troubleshoot problems with your appsStore data in local app preferences and Core Data databases Who This Book Is ForAnyone who wants to learn to develop apps for the Mac, iPhone, iPad, and Apple Watch using the Swift programming language. No previous programming experience is necessary.

Table of Contents 4
About the Authors 11
About the Technical Reviewer 13
Introduction 14
Chapter 1: Becoming a Great iOS Developer 21
Thinking like a Developer 21
Completing the Development Cycle 25
Introducing Object-Oriented Programming 27
Working with the Playground Interface 31
Summary 32
What’s Next 33
Chapter 2: Programming Basics 34
Touring Xcode 34
Exploring the Workspace Window 35
Navigating Your Workspace 37
Editing Your Project Files 38
Creating Your First Swift Playground Program 40
Installing and Launching Xcode 10.2 40
Using Xcode 10.2 42
Xcode Playground IDE: Editor and Results Areas 44
Summary 46
Chapter 3: It’s All About the Data 47
Numbering Systems Used in Programming 47
Bits 47
Moore’s Law 49
Bytes 49
Hexadecimal 51
Unicode 53
Data Types 53
Declaring Constants and Variables 54
Optionals 56
Using Variables in Playgrounds 57
Summary 61
Chapter 4: Making Decisions, Program Flow, and App Design 63
Boolean Logic 64
Truth Tables 65
Comparison Operators 67
Designing Apps 68
Pseudocode 68
Optionals and Forced Unwrapping 72
Optional Binding 73
Implicitly Unwrapped Optionals 74
Flowcharting 74
Designing and Flowcharting an Example App 75
The App’s Design 76
Using Loops to Repeat Program Statements 77
Count-Controlled Loops 77
Condition-Controlled Loops 78
Infinite Loops 78
Coding the Example App in Swift 79
Nested if Statements and else if Statements 83
Removing Extra Characters 83
Improving the Code Through Refactoring 84
Running the App 84
Design Requirements 86
Summary 89
Chapter 5: Object-Oriented Programming with Swift 92
The Object 93
What Is a Class? 94
Planning Classes 95
Planning Properties 95
Planning Methods 98
Implementing the Classes 100
Inheritance 108
Why Use OOP? 109
OOP Is Everywhere 110
Eliminate Redundant Code 110
Ease of Debugging 110
Ease of Replacement 110
Advanced Topics 111
Interface 111
Polymorphism 111
Value Orientated Programming 112
Summary 113
Chapter 6: Learning Swift and Xcode 114
A Newcomer 114
Understanding the Language Symbols 115
Implementing Objects in Swift 116
Writing Another Program in Xcode 119
Creating the Project 119
Summary 136
Chapter 7: Swift Classes, Objects, and Methods 138
Creating a Swift Class 138
Properties 140
Methods 140
Using Type Methods 141
Using Instance Methods 142
Using Your New Class 143
Creating Your Project 143
Adding Objects 146
Writing the Class 150
Creating the User Interface 153
Hooking Up the Code 157
Running the Program 161
Taking Type Methods to the Next Level 162
Accessing the Xcode Documentation 163
Summary 164
Chapter 8: Programming Basics in Swift 166
Using let vs. var 166
Understanding Collections 167
Using Arrays 167
Using the Dictionary Class 170
Creating the BookStore Application 172
Creating Your Class 176
Introducing Properties 177
Accessing Properties 178
Finishing the BookStore Program 179
Creating the View 179
Adding Properties 182
Adding a Description 184
Creating a Simple Data Model Class 186
Modifying the MasterViewController 188
Modifying the DetailViewController 192
Summary 194
Chapter 9: Comparing Data 196
Revisiting Boolean Logic 196
Using Relational Operators 197
Comparing Numbers 198
Creating an Example Xcode App 199
Using Boolean Expressions 203
Comparing Strings 204
Using the switch Statement 206
Comparing Dates 207
Combining Comparisons 209
Summary 210
Chapter 10: Creating User Interfaces 212
Understanding Interface Builder 213
The Model-View-Controller Pattern 214
Human Interface Guidelines 216
Creating an Example iPhone App with Interface Builder 218
Using Interface Builder 224
The Document Outline 226
The Object Library 226
Inspector Pane and Selector Bar 230
Creating the View 230
Using Outlets 233
Using Actions 237
The Class 239
Summary 242
Chapter 11: Storing Information 244
Storage Considerations 244
Preferences/UserDefaults 245
Writing Preferences 245
Reading Preferences 247
Databases 248
Storing Information in a Database 248
Getting Started with Core Data 249
The Model 251
Managed Object Context 259
Setting Up the Interface 259
Summary 275
Chapter 12: Protocols and Delegates 277
Multiple Inheritance 277
Understanding Protocols 279
Protocol Syntax 280
Delegation 280
Protocol and Delegation Example 281
Getting Started 282
How It Works 294
Summary 295
Chapter 13: Introducing the Xcode Debugger 296
Getting Started with Debugging 297
Setting Breakpoints 298
Using the Breakpoint Navigator 300
Debugging Basics 302
Working with the Debugger Controls 305
Using the Step Controls 305
Looking at the Thread Window and Call Stack 307
Debugging Variables 307
Dealing with Code Errors and Warnings 309
Errors 309
Warnings 311
Summary 312
Chapter 14: A Swift iPhone App 313
Let’s Get Started 313
Switches 328
Alert Controllers 329
App Summary 337
Chapter 15: Apple Watch and WatchKit 339
Considerations When Creating a watchOS App 339
Creating an Apple Watch App 340
Adding More Functionality 358
Summary 365
Index 366

Erscheint lt. Verlag 26.6.2019
Zusatzinfo XXI, 360 p. 272 illus.
Sprache englisch
Themenwelt Informatik Betriebssysteme / Server Macintosh / Mac OS X
Informatik Programmiersprachen / -werkzeuge Mac / Cocoa Programmierung
Informatik Theorie / Studium Compilerbau
Schlagworte App • Develop • Ios • iPad • iPhone • Mac • Software • SWIFT
ISBN-10 1-4842-4868-6 / 1484248686
ISBN-13 978-1-4842-4868-3 / 9781484248683
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 15,8 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
A practical guide to implementing, managing, and optimizing macOS Big …

von Nava Herta Nava

eBook Download (2021)
Packt Publishing (Verlag)
34,79