Nicht aus der Schweiz? Besuchen Sie lehmanns.de
macOS Programming for Absolute Beginners - Wallace Wang

macOS Programming for Absolute Beginners (eBook)

Developing Apps Using Swift and Xcode

(Autor)

eBook Download: PDF
2017 | 1st ed.
XXVI, 647 Seiten
Apress (Verlag)
978-1-4842-2662-9 (ISBN)
Systemvoraussetzungen
79,99 inkl. MwSt
(CHF 78,15)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen
Learn how to code for the iMac, Mac mini, Mac Pro, and MacBook using Swift, Apple's hottest programming language.

Fully updated to cover the new MacBook Touch Bar, macOS Programming for Absolute Beginners will not only teach complete programming novices how to write macOS programs, but it can also help experienced programmers moving to the Mac for the first time. You will learn the principles of programming, how to use Swift and Xcode, and how to combine your knowledge into writing macOS programs.

If you've always wanted to learn coding but felt stymied by the limitation of simplistic programming languages or intimidated by professional but complicated programming languages, then you'll want to learn Swift. Swift is your gateway to both Mac and iOS app development while being powerful and easy to learn at the same time, and macOS Programming for Absolute Beginners is the perfect place to start - add it to your library today.
What You'll Learn

  • Master the basic principles of object-oriented programming 
  • Use Xcode, the main programming tool used for both macOS and iOS development 
  • See what makes Swift unique and powerful as a programming language and why you should learn it 
  • Create macOS programs using Swift and Xcode 
  • Apply interface principles that follow Apple's Human Interface Guidelines
  • Take advantage of the new Touch Bar

Who This Book Is For

People who want to learn programming for the first time and for experienced programmers wanting to learn Xcode and the Mac for the first time.


Wallace Wang is a former Windows enthusiast who took one look at Vista and realized that the future of computing belonged to the Mac. He s written more than 40 computer books, including Microsoft Office for Dummies, Beginning Programming for Dummies, Steal This Computer Book, My New Mac, and My New iPad. In addition to programming the Mac and iPhone/iPad, he also performs stand-up comedy, having appeared on A&E s 'Evening at the Improv,' and having performed in Las Vegas at the Riviera Comedy Club at the Riviera Hotel & Casino. When he's not writing computer books or performing stand-up comedy, he also enjoys blogging about screenwriting at his site, The 15 Minute Movie Method, where he shares screenwriting tips with other aspiring screenwriters who all share the goal of breaking into Hollywood.
Learn how to code for the iMac, Mac mini, Mac Pro, and MacBook using Swift, Apple's hottest programming language.Fully updated to cover the new MacBook Touch Bar, macOS Programming for Absolute Beginners will not only teach complete programming novices how to write macOS programs, but it can also help experienced programmers moving to the Mac for the first time. You will learn the principles of programming, how to use Swift and Xcode, and how to combine your knowledge into writing macOS programs. If you've always wanted to learn coding but felt stymied by the limitation of simplistic programming languages or intimidated by professional but complicated programming languages, then you'll want to learn Swift. Swift is your gateway to both Mac and iOS app development while being powerful and easy to learn at the same time, and macOS Programming for Absolute Beginners is the perfect place to start - add it to your library today.What You'll LearnMaster the basic principles of object-oriented programming Use Xcode, the main programming tool used for both macOS and iOS development See what makes Swift unique and powerful as a programming language and why you should learn it Create macOS programs using Swift and Xcode Apply interface principles that follow Apple's Human Interface GuidelinesTake advantage of the new Touch BarWho This Book Is ForPeople who want to learn programming for the first time and for experienced programmers wanting to learn Xcode and the Mac for the first time.

Wallace Wang is a former Windows enthusiast who took one look at Vista and realized that the future of computing belonged to the Mac. He s written more than 40 computer books, including Microsoft Office for Dummies, Beginning Programming for Dummies, Steal This Computer Book, My New Mac, and My New iPad. In addition to programming the Mac and iPhone/iPad, he also performs stand-up comedy, having appeared on A&E s "Evening at the Improv," and having performed in Las Vegas at the Riviera Comedy Club at the Riviera Hotel & Casino. When he’s not writing computer books or performing stand-up comedy, he also enjoys blogging about screenwriting at his site, The 15 Minute Movie Method, where he shares screenwriting tips with other aspiring screenwriters who all share the goal of breaking into Hollywood.

Contents at a Glance 5
Contents 7
About the Author 17
About the Technical Reviewer 18
Acknowledgments 19
Introduction 20
Chapter 1: Understanding Programming 24
Programming Principles 25
Structured Programming 29
Event-Driven Programming 31
Object-Oriented Programming 31
Encapsulation 32
Inheritance 33
Polymorphism 34
Understanding Programming Languages 35
The Cocoa Framework 38
The View-Model-Controller Design 40
How Programmers Work 42
Summary 43
Chapter 2: Getting to Know Xcode 8 45
Giving Commands to Xcode 47
Modifying the Xcode Window 50
Creating and Managing Files 54
Creating and Customizing a User Interface 61
The Standard and Assistant Editors 63
Running a Program 67
Summary 68
Chapter 3: The Basics of Creating a Mac Program 70
Creating a Project 71
Designing a User Interface 76
Using the Document Outline and Connections Inspector 93
Summary 96
Chapter 4: Getting Help 98
Understanding the Cocoa Framework 98
Looking Up Properties and Methods in a Class File 101
Looking Up Class Files with the Help Menu 102
Looking Up Class Files with Quick Help 104
Browsing the Documentation 106
Searching the Documentation 110
Using Code Completion 111
Understanding How macOS Programs Work 113
Summary 119
Chapter 5: Learning Swift with Playgrounds 120
Using Playgrounds 121
Storing Data in Swift 125
Using Unicode Characters as Names 130
Converting Data Types 133
Computed Properties 134
Using Optional Variables 138
Linking Swift Code to a User Interface 141
Summary 144
Chapter 6: Manipulating Numbers and Strings 146
Using Mathematical Operators 146
Compound Assignment Operators 148
Using Math Functions 149
Rounding Functions 149
Calculation Functions 151
Trigonometry Functions 152
Exponential Functions 154
Logarithmic Functions 155
Using String Functions 156
Summary 157
Chapter 7: Making Decisions with Branches 159
Understanding Comparison Operators 159
Understanding Logical Operators 161
The if Statement 164
The if-else Statement 166
The if-else-if Statement 167
The switch Statement 170
Making Decisions in an macOS Program 175
Summary 188
Chapter 8: Repeating Code with Loops 190
The while Loop 191
The repeat-while Loop 193
The for-in Loop 195
Counting Through Arrays with the for-in Loop 198
Exiting Loops Prematurely 199
Using Loops in an macOS Program 201
Summary 214
Chapter 9: Arrays and Dictionaries 215
Using Arrays 216
Adding Items to an Array 217
Deleting Items from an Array 219
Querying Arrays 221
Manipulating Arrays 221
Using Dictionaries 223
Adding Items to a Dictionary 224
Retrieving and Updating Data in a Dictionary 225
Deleting Data in a Dictionary 226
Querying a Dictionary 227
Using Dictionaries in a macOS Program 228
Summary 236
Chapter 10: Tuples and Sets 238
Using Tuples 238
Accessing Data in a Tuple 240
Using Sets 243
Creating a Set 244
Adding and Removing Items from a Set 244
Querying a Set 246
Manipulating Sets 249
Summary 251
Chapter 11: Storing Code in Functions 252
Simple Functions Without Parameters or Return Values 253
Simple Functions with Parameters 255
Functions with Parameters That Return Values 257
Using Variable Parameters 259
Using Inout Parameters 260
Returning Multiple Values 262
Understanding IBAction Methods 264
Summary 265
Chapter 12: Defining Custom Data Types 266
Typealiases 267
Using Enumerations 267
Using Structures 270
Storing and Retrieving Items from a Structure 272
Combining Data Structures 275
Summary 283
Chapter 13: Creating Classes and Objects 284
Creating Classes 285
Accessing Properties in an Object 287
Computed Properties in an Object 290
Setting Other Properties 291
Using Property Observers 294
Creating Methods 296
Using Objects in an macOS Program 299
Summary 309
Chapter 14: Inheritance, Polymorphism, and Extending Classes 311
Understanding Inheritance 312
Understanding Polymorphism 319
Overriding Properties 324
Preventing Polymorphism 327
Using Extensions 327
Using Protocols 329
Defining Optional Methods and Properties in Protocols 333
Using Inheritance with Protocols 335
Using Delegates 336
Using Inheritance in a macOS Program 341
Summary 347
Chapter 15: Creating a User Interface 349
Understanding User Interface Files 350
Searching the Object Library 351
User Interface Items That Display and Accept Text 356
User Interface Items That Restrict Choices 358
User Interface Items That Accept Commands 359
User Interface Items That Group Items 359
Using Constraints in Auto Layout 361
Defining Window Sizes 362
Placing Constraints on User Interface Items 369
Editing Constraints 375
Defining Constraints in a macOS Program 378
Summary 382
Chapter 16: Working with Storyboards 383
Using Storyboards 386
Adding Scenes to a Storyboard 390
Defining the Initial Scene in a Storyboard 391
Connecting Scenes with Segues 393
Displaying Scenes from a Segue 395
Adding a Controller File to a Scene 398
Summary 403
Chapter 17: Choosing Commands with Buttons 404
Modifying Text on a Button 406
Adding Images and Sounds to a Button 412
Connecting Multiple User Interface Items to IBAction Methods 414
Working with Pop-up Buttons 419
Modifying Popup Menu Items Visually 421
Adding Pop-up Menu Items with Swift Code 424
Summary 429
Chapter 18: Making Choices with Radio Buttons, Check Boxes, Date Pickers, and Sliders 430
Using Check Boxes 432
Using Radio Buttons 436
Using a Date Picker 442
Using Sliders 447
Summary 450
Chapter 19: Using Text with Labels, Text Fields, and Combo Boxes 452
Using Text Fields 453
Using a Number Formatter 454
Using a Secure Text Field, a Search Field, and a Token Field 462
Using Combo Boxes 468
Creating an Internal List 468
Using a Data Source 472
Summary 475
Chapter 20: Designing a User Interface with Constraints 476
Constraining a Window Size 477
Constraining User Interface Items to Window Edges 479
Editing a Constraint 484
Creating Size Constraints 489
Creating Constraints Between Multiple User Interface Items 491
Deleting Constraints 494
Summary 495
Chapter 21: Using Aler ts and Panels 496
Using Alerts 496
Getting Feedback from an Alert 499
Displaying Alerts as Sheets 502
Using Panels 506
Creating an Open Panel 506
Creating a Save Panel 509
Creating a Color Panel 511
Summary 515
Chapter 22: Creating Pull-Down Menus 517
Editing Pull-Down Menus 518
Adding New Pull-Down Menu Titles to the Menu Bar 521
Adding New Commands to a Pull-Down Menu 525
Editing Commands 528
Connecting Menu Commands to Swift Code 530
Summary 543
Chapter 23: Programming the Touch Bar 544
Adding a Touch Bar 545
Creating a Swift Class File 548
Adding Items to the Touch Bar 550
Connecting Touch Bar Items to Swift Code 551
Creating a Touch Bar Program 552
Summary 560
Chapter 24: Protocol-Oriented Programming 562
Understanding Protocols 563
Using Methods in Protocols 566
Adopting Multiple Protocols 569
Protocol Extensions 570
Using Protocol Extensions to Extend Common Data Types 578
Summary 580
Chapter 25: Defensive Programming 582
Test with Extreme Values 582
Working with Optional Variables 583
Working with Optional Chaining 586
Error Handling 591
Defining Errors with Enumerations 591
Creating a Function to Identify Errors 592
Handling the Error 593
Summary 596
Chapter 26: Simplifying User Interface Design 597
Using Stack View 597
Fixing Constraint Conflicts 600
Working with Storyboard References 607
Summary 612
Chapter 27: Debugging Your Programs 613
Simple Debugging Techniques 616
Using the Xcode Debugger 621
Using Breakpoints 622
Stepping Through Code 622
Managing Breakpoints 626
Using Symbolic Breakpoints 630
Using Conditional Breakpoints 633
Summary 634
Chapter 28: Planning a Program Before and After Coding 636
Identifying the Purpose of Your Program 637
Designing the Structure of a Program 639
Designing the User Interface of a Program 640
Design a User Interface with Paper and Pencil 641
Design a User Interface with Software 642
Marketing Your Software 644
Blogging About Your Software 645
Giving Away Free Software 646
Posting Videos About Your Software 647
Give Away Free Information 648
Join Social Networks 650
Summary 651
Index 652

Erscheint lt. Verlag 28.2.2017
Zusatzinfo XXVI, 647 p. 360 illus., 349 illus. in color.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Betriebssysteme / Server Macintosh / Mac OS X
Informatik Programmiersprachen / -werkzeuge Mac / Cocoa Programmierung
Schlagworte App • Apple • Development • MacOS • OS X • programming • SWIFT • Xcode
ISBN-10 1-4842-2662-3 / 1484226623
ISBN-13 978-1-4842-2662-9 / 9781484226629
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 17,5 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