Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MapSwift - lesson 0

MapSwift - lesson 0

leveton

May 01, 2017
Tweet

More Decks by leveton

Other Decks in Programming

Transcript

  1. iOS > Tabbed Application Product Name: ‘MapSwift’ Organization Name: your

    name Organization id and bundle id: reverse domain of your name Language: Swift Devices: iPhone Check ‘Create a Git Repository’ Creating a new Xcode project
  2. The Run Loop “Run loops are what separates interactive apps

    from command-line tools” - Nicolas Bouilleaud The run loop allows your app to wait for the user to touch the screen before responding. The run loop ‘listens’ for this touch event.
  3. The Run Loop Think of it as a taxi cab

    that circles a city block over and over waiting to pick you up. Or like a Pneumatic tube at a bank drive-through waiting for you to put a message in it, so that it can whisk it away.
  4. The Run Loop There is exactly one run loop for

    each thread. There are six types of events that will cause a run loop to deliver a message. Besides touch events, they can be timers or messages from other apps. touch, shake, rotate, tap, timers, message data from outside processes
  5. The Run Loop The important thing to remember is that

    the main thread (good old main()) starts an event loop at app launch that ‘listens’ for these events. Swift has hidden main()
  6. The Lifecycle of an iOS app Info.plist (just XML under

    the hood) for high level app configuration
  7. Cocoa Touch The framework that separates iOS development from other

    types of Swift development import Foundation import UIKit
  8. Object Oriented Programming Concepts Each will have its own slide…

    Methods and Properties Encapsulation Inheritance Polymorphism Introspection Delegation Reference semantics
  9. Methods and properties The methods are what the object does,

    the properties are the things the object has. Some find it easier to think of methods as verbs and properties as nouns. Methods and properties are declared within the class scope.
  10. Methods and properties Swift methods are public by default. They

    can be set to private. Your ability to do this is known as encapsulation...
  11. Encapsulation Objects hide as much information as they can You

    cannot get an object’s data unless that object exposes its data.