E-Book, Englisch, 293 Seiten, eBook
Bennett / Lees Swift for Absolute Beginners
1. Auflage 2015
ISBN: 978-1-4842-0886-1
Verlag: APRESS
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 293 Seiten, eBook
ISBN: 978-1-4842-0886-1
Verlag: APRESS
Format: PDF
Kopierschutz: 1 - PDF Watermark
Zielgruppe
Popular/general
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;3
2;Contents;284
3;About the Authors;291
4;About the Technical Reviewer;292
5;Acknowledgments;293
6;Introduction;5
7;Chapter 1: Becoming a Great iOS Developer;13
7.1;Thinking like a Developer;13
7.2;Completing the Development Cycle;16
7.3;Introducing Object-Oriented Programming;18
7.4;Working with the Playground Interface;21
7.5;Summary;22
7.6;What’s Next;22
7.7;Exercises;22
8;Chapter 2: Programming Basics;23
8.1;Touring Xcode;23
8.1.1;Exploring the Workspace Window;24
8.1.2;Navigating Your Workspace;26
8.1.3;Editing Your Project Files;26
8.2;Creating Your First Swift Playground Program;27
8.2.1;Installing and Launching Xcode 6;28
8.2.2;Using Xcode 6;30
8.3;Summary;33
8.4;Exercise;34
9;Chapter 3: It’s All About the Data;35
9.1;Numbering Systems Used in Programming;35
9.1.1;Bits;35
9.1.1.1;Moore’s Law;36
9.1.2;Bytes;37
9.1.3;Hexadecimal;39
9.1.4;Unicode;41
9.2;Data Types;41
9.3;Declaring Constants and Variables;42
9.4;Optionals;43
9.5;Using Variables in Playgrounds;44
9.6;Summary;48
9.7;Exercises;48
10;Chapter 4: Making Decisions, Program Flow, and App Design;49
10.1;Boolean Logic;49
10.1.1;Truth Tables;51
10.1.2;Comparison Operators;53
10.2;Designing Apps;54
10.2.1;Pseudocode;54
10.2.2;Optionals and Forced Unwrapping;56
10.2.2.1;Optional Binding;57
10.2.2.2;Implicitly Unwrapped Optionals;58
10.2.3;Flowcharting;58
10.2.4;Designing and Flowcharting an Example App;59
10.2.5;The App’s Design;60
10.2.6;Using Loops to Repeat Program Statements;61
10.2.6.1;Count-Controlled Loops;61
10.2.6.2;Condition-Controlled Loops;62
10.2.6.3;Infinite Loops;62
10.3;Coding the Example App in Swift;63
10.3.1;Nested if Statements and else-if Statements;66
10.3.2;Removing Extra Characters;66
10.3.3;Improving the Code Through Refactoring;66
10.3.4;Running the App;67
10.3.5;Design Requirements;68
10.4;Summary;71
10.5;Exercises;72
11;Chapter 5: Object-Oriented Programming with Swift;73
11.1;The Object;74
11.2;What Is a Class?;75
11.3;Planning Classes;75
11.3.1;Planning Properties;76
11.3.2;Planning Methods;77
11.3.3;Implementing the Classes;79
11.4;Inheritance;86
11.5;Why Use OOP?;86
11.5.1;It Is Everywhere;87
11.5.2;Eliminate Redundant Code;87
11.5.3;Ease of Debugging;87
11.5.4;Ease of Replacement;87
11.6;Advanced Topics;87
11.6.1;Interface;88
11.6.2;Polymorphism;88
11.7;Summary;88
11.8;Exercises;89
12;Chapter 6: Learning Swift and Xcode;90
12.1;A Newcomer;90
12.2;Understanding the Language Symbols;91
12.3;Implementing Objects in Swift;92
12.4;Writing Another Program in Xcode;95
12.4.1;Creating the Project;95
12.5;Summary;109
12.6;Exercises;110
13;Chapter 7: Swift Classes, Objects, and Methods;111
13.1;Creating a Swift Class;111
13.1.1;Instance Variables;113
13.1.2;Methods;113
13.1.2.1;Using Class Methods;113
13.1.2.2;Using Instance Methods;114
13.2;Using Your New Class;115
13.2.1;Creating Your Project;115
13.2.2;Adding Objects;117
13.2.3;Writing the Class;120
13.2.4;Creating the User Interface;122
13.2.5;Hooking Up the Code;126
13.2.6;Running the Program;130
13.2.7;Taking Class Methods to the Next Level;131
13.3;Accessing the Xcode Documentation;132
13.4;Summary;133
13.5;Exercises;133
14;Chapter 8: Programming Basics in Swift;134
14.1;Using let vs. var;134
14.2;Understanding Collections;135
14.2.1;Using Array;135
14.2.2;Dictionary;137
14.3;Creating the BookStore Application;138
14.3.1;Creating Your Class;143
14.3.2;Introducing Instance Variables;144
14.3.3;Accessing Variables;145
14.4;Finishing the Bookstore Program;145
14.4.1;Creating the View;145
14.4.2;Adding Instance Variables;148
14.4.3;Adding a Description;150
14.4.4;Creating a Simple Data Model Class;152
14.4.5;Modifying MasterViewController;154
14.4.6;Modifying the DetailViewController;157
14.5;Summary;158
14.6;Exercises;159
15;Chapter 9: Comparing Data;160
15.1;Revisiting Boolean Logic;161
15.2;Using Relational Operators;161
15.2.1;Comparing Numbers;162
15.2.2;Creating an Example Xcode App;163
15.3;Using Boolean Expressions;167
15.3.1;Comparing Strings;169
15.4;Using the switch Statement;170
15.4.1;Comparing Dates;171
15.4.2;Combining Comparisons;173
15.5;Summary;174
15.6;Exercises;174
16;Chapter 10: Creating User Interfaces;175
16.1;Understanding Interface Builder;176
16.2;The Model-View-Controller Pattern;177
16.3;Human Interface Guidelines;178
16.4;Creating an Example iPhone App with Interface Builder;180
16.4.1;Using Interface Builder;184
16.4.2;The Document Outline;185
16.4.3;The Library;186
16.4.4;Inspector Pane and Selector Bar;187
16.4.5;Creating the View;188
16.4.6;Using Outlets;190
16.4.7;Using Actions;192
16.4.8;The Class;193
16.5;Summary;196
16.6;Exercises;196
17;Chapter 11: Storing Information;197
17.1;Storage Considerations;197
17.2;Preferences;198
17.2.1;Writing Preferences;198
17.2.2;Reading Preferences;199
17.3;Databases;200
17.4;Storing Information in a Database;200
17.5;Getting Started with Core Data;201
17.6;The Model;202
17.6.1;Managed Object Context;211
17.6.2;Setting Up the Interface;211
17.7;Summary;223
17.8;Exercises;223
18;Chapter 12: Protocols and Delegates;224
18.1;Multiple Inheritance;224
18.2;Understanding Protocols;226
18.3;Protocol Syntax;226
18.4;Delegation;226
18.5;Protocol and Delegation Example;227
18.6;Getting Started;228
18.7;How Does It Work;236
18.8;Summary;236
18.9;Exercise;236
19;Chapter 13: Introducing the Xcode Debugger;237
19.1;Getting Started with Debugging;238
19.1.1;Setting Breakpoints;239
19.1.2;Using the Breakpoint Navigator;240
19.1.3;Debugging Basics;242
19.1.4;Working with the Debugger Controls;244
19.1.5;Using the Step Controls;244
19.1.6;Looking at the Thread Window and Call Stack;246
19.1.7;Debugging Variables;247
19.2;Dealing with Code Errors and Warnings;248
19.2.1;Errors;248
19.2.2;Warnings;250
19.3;Summary;252
20;Chapter 14: A Swif t iPhone App;254
20.1;Let’s Get Started;254
20.1.1;Switches;264
20.1.2;Alert Views;265
20.2;App Summary;272
20.3;What’s Next?;272
20.4;Exercises;273
21;Index;274