Swift for Absolute Beginners - Gary Bennett, Brad Lees

Swift for Absolute Beginners (eBook)

, (Autoren)

eBook Download: PDF
2015 | 1st ed.
XXIII, 308 Seiten
Apress (Verlag)
978-1-4842-0886-1 (ISBN)
Systemvoraussetzungen
39,58 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

The professional development team that brought you two editions of Objective-C for the Absolute Beginners and have taught thousands of developers around the world to write some of the most popular iPhone apps in their categories on the app store, have now leveraged their instruction for Swift.

Swift for Absolute Beginners 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.

Gary Bennett and Brad Lees are full-time professional iOS developers and have developed a broad spectrum of apps for Fortune 500 companies. The authors have taken their combined 12 years of writing apps, teaching online iOS courses, the experience from their first two iOS books, along with their free online instruction and free online forum to create an excellent training book.

Topics include:

  • How to be successful at learning Swift
  • Using Swift Playgrounds to learn iOS development quickly
  • What is Object Oriented Programming
  • What are Swift classes, properties, and functions
  • Proper user interface and user experience design
  • Swift data types: integers, floats, strings, booleans
  • How to use Swift data collections: arrays and dictionaries
  • Boolean logic, comparing data, and flow control
  • Writing iPhone apps from scratch
  • Avoiding Swift pitfalls

Many students have a difficult time believing they can learn to write iOS apps or just staying motivated through learning the process. This book, along with the free, live online training sessions, helps students stay motivated and overcome obstacles while they learn to be great iOS developers.



Gary Bennett is president of xcelMe.com. xcelMe teaches iPhone/iPad programming courses online. Gary has taught hundreds of students how to develop iPhone/iPad apps, and has several very popular apps on the iTunes App Store. Gary's students have some of the best-selling apps on the iTunes App Store. Gary also worked for 25 years in the technology and defense industries. He served 10 years in the U.S. Navy as a nuclear engineer aboard two nuclear submarines. After leaving the Navy, Gary worked for several companies as a software developer, chief information officer, and resident. As CIO, he helped take VistaCare public in 2002. Gary also co-authored emiPhone Cool Projects/em for Apress. Gary lives in Scottsdale, Arizona with his wife, Stefanie, and their four children.
The professional development team that brought you two editions of Objective-C for the Absolute Beginners and have taught thousands of developers around the world to write some of the most popular iPhone apps in their categories on the app store, have now leveraged their instruction for Swift.Swift for Absolute Beginners 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.Gary Bennett and Brad Lees are full-time professional iOS developers and have developed a broad spectrum of apps for Fortune 500 companies. The authors have taken their combined 12 years of writing apps, teaching online iOS courses, the experience from their first two iOS books, along with their free online instruction and free online forum to create an excellent training book.Topics include:How to be successful at learning SwiftUsing Swift Playgrounds to learn iOS development quicklyWhat is Object Oriented ProgrammingWhat are Swift classes, properties, and functionsProper user interface and user experience designSwift data types: integers, floats, strings, booleansHow to use Swift data collections: arrays and dictionariesBoolean logic, comparing data, and flow controlWriting iPhone apps from scratchAvoiding Swift pitfallsMany students have a difficult time believing they can learn to write iOS apps or just staying motivated through learning the process. This book, along with the free, live online training sessions, helps students stay motivated and overcome obstacles while they learn to be great iOS developers.

Gary Bennett is president of xcelMe.com. xcelMe teaches iPhone/iPad programming courses online. Gary has taught hundreds of students how to develop iPhone/iPad apps, and has several very popular apps on the iTunes App Store. Gary's students have some of the best-selling apps on the iTunes App Store. Gary also worked for 25 years in the technology and defense industries. He served 10 years in the U.S. Navy as a nuclear engineer aboard two nuclear submarines. After leaving the Navy, Gary worked for several companies as a software developer, chief information officer, and resident. As CIO, he helped take VistaCare public in 2002. Gary also co-authored emiPhone Cool Projects/em for Apress. Gary lives in Scottsdale, Arizona with his wife, Stefanie, and their four children.

Contents at a Glance 3
Contents 284
About the Authors 291
About the Technical Reviewer 292
Acknowledgments 293
Introduction 5
Chapter 1: Becoming a Great iOS Developer 13
Thinking like a Developer 13
Completing the Development Cycle 16
Introducing Object-Oriented Programming 18
Working with the Playground Interface 21
Summary 22
What’s Next 22
Exercises 22
Chapter 2: Programming Basics 23
Touring Xcode 23
Exploring the Workspace Window 24
Navigating Your Workspace 26
Editing Your Project Files 26
Creating Your First Swift Playground Program 27
Installing and Launching Xcode 6 28
Using Xcode 6 30
Summary 33
Exercise 34
Chapter 3: It’s All About the Data 35
Numbering Systems Used in Programming 35
Bits 35
Moore’s Law 36
Bytes 37
Hexadecimal 39
Unicode 41
Data Types 41
Declaring Constants and Variables 42
Optionals 43
Using Variables in Playgrounds 44
Summary 48
Exercises 48
Chapter 4: Making Decisions, Program Flow, and App Design 49
Boolean Logic 49
Truth Tables 51
Comparison Operators 53
Designing Apps 54
Pseudocode 54
Optionals and Forced Unwrapping 56
Optional Binding 57
Implicitly Unwrapped Optionals 58
Flowcharting 58
Designing and Flowcharting an Example App 59
The App’s Design 60
Using Loops to Repeat Program Statements 61
Count-Controlled Loops 61
Condition-Controlled Loops 62
Infinite Loops 62
Coding the Example App in Swift 63
Nested if Statements and else-if Statements 66
Removing Extra Characters 66
Improving the Code Through Refactoring 66
Running the App 67
Design Requirements 68
Summary 71
Exercises 72
Chapter 5: Object-Oriented Programming with Swift 73
The Object 74
What Is a Class? 75
Planning Classes 75
Planning Properties 76
Planning Methods 77
Implementing the Classes 79
Inheritance 86
Why Use OOP? 86
It Is Everywhere 87
Eliminate Redundant Code 87
Ease of Debugging 87
Ease of Replacement 87
Advanced Topics 87
Interface 88
Polymorphism 88
Summary 88
Exercises 89
Chapter 6: Learning Swift and Xcode 90
A Newcomer 90
Understanding the Language Symbols 91
Implementing Objects in Swift 92
Writing Another Program in Xcode 95
Creating the Project 95
Summary 109
Exercises 110
Chapter 7: Swift Classes, Objects, and Methods 111
Creating a Swift Class 111
Instance Variables 113
Methods 113
Using Class Methods 113
Using Instance Methods 114
Using Your New Class 115
Creating Your Project 115
Adding Objects 117
Writing the Class 120
Creating the User Interface 122
Hooking Up the Code 126
Running the Program 130
Taking Class Methods to the Next Level 131
Accessing the Xcode Documentation 132
Summary 133
Exercises 133
Chapter 8: Programming Basics in Swift 134
Using let vs. var 134
Understanding Collections 135
Using Array 135
Dictionary 137
Creating the BookStore Application 138
Creating Your Class 143
Introducing Instance Variables 144
Accessing Variables 145
Finishing the Bookstore Program 145
Creating the View 145
Adding Instance Variables 148
Adding a Description 150
Creating a Simple Data Model Class 152
Modifying MasterViewController 154
Modifying the DetailViewController 157
Summary 158
Exercises 159
Chapter 9: Comparing Data 160
Revisiting Boolean Logic 161
Using Relational Operators 161
Comparing Numbers 162
Creating an Example Xcode App 163
Using Boolean Expressions 167
Comparing Strings 169
Using the switch Statement 170
Comparing Dates 171
Combining Comparisons 173
Summary 174
Exercises 174
Chapter 10: Creating User Interfaces 175
Understanding Interface Builder 176
The Model-View-Controller Pattern 177
Human Interface Guidelines 178
Creating an Example iPhone App with Interface Builder 180
Using Interface Builder 184
The Document Outline 185
The Library 186
Inspector Pane and Selector Bar 187
Creating the View 188
Using Outlets 190
Using Actions 192
The Class 193
Summary 196
Exercises 196
Chapter 11: Storing Information 197
Storage Considerations 197
Preferences 198
Writing Preferences 198
Reading Preferences 199
Databases 200
Storing Information in a Database 200
Getting Started with Core Data 201
The Model 202
Managed Object Context 211
Setting Up the Interface 211
Summary 223
Exercises 223
Chapter 12: Protocols and Delegates 224
Multiple Inheritance 224
Understanding Protocols 226
Protocol Syntax 226
Delegation 226
Protocol and Delegation Example 227
Getting Started 228
How Does It Work 236
Summary 236
Exercise 236
Chapter 13: Introducing the Xcode Debugger 237
Getting Started with Debugging 238
Setting Breakpoints 239
Using the Breakpoint Navigator 240
Debugging Basics 242
Working with the Debugger Controls 244
Using the Step Controls 244
Looking at the Thread Window and Call Stack 246
Debugging Variables 247
Dealing with Code Errors and Warnings 248
Errors 248
Warnings 250
Summary 252
Chapter 14: A Swif t iPhone App 254
Let’s Get Started 254
Switches 264
Alert Views 265
App Summary 272
What’s Next? 272
Exercises 273
Index 274

Erscheint lt. Verlag 2.1.2015
Zusatzinfo XXIII, 308 p. 245 illus.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Betriebssysteme / Server
Informatik Programmiersprachen / -werkzeuge Mac / Cocoa Programmierung
Mathematik / Informatik Informatik Theorie / Studium
ISBN-10 1-4842-0886-2 / 1484208862
ISBN-13 978-1-4842-0886-1 / 9781484208861
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 15,6 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 guide for building beautiful and interactive SwiftUI apps

von Juan C. Catalan

eBook Download (2023)
Packt Publishing (Verlag)
32,39
Einführung und Sprachreferenz

von Thomas Sillmann

eBook Download (2017)
Carl Hanser Verlag GmbH & Co. KG
35,99