Skip to content

Instantly share code, notes, and snippets.

@tbuchanan
Last active August 29, 2015 14:02
Show Gist options
  • Save tbuchanan/604f4061b83ea656610a to your computer and use it in GitHub Desktop.
Save tbuchanan/604f4061b83ea656610a to your computer and use it in GitHub Desktop.
GA Research project notes- Xcode + Swift

#Notes ##Research Project ###Software: Xcode6.beta for OSX Yosemite, iOS8 ###Languages: Swift and Objective-C ####Resources: learnswift.tips, Youtube: Swift Todo App tutorial, Apple developer, Cocoa, iBooks: The Swift Programming Language,

##Where to start

  • Signup for iOS developer license; $99 per year

  • Download Xcode6.beta. (optional: iOS8 & OSX Yosemite) note: Xcode6.beta crashes A LOT so save often & push to github

  • Create new Xcode application:

      a) Start with tab-based app & name your project,
    
      b) Language set to swift
    
      c) Device is set to the desired device (iphone, iPad)
    

##Anatomy of Xcode

###Cocoa and Cocoa Touch, Objective-C and Swift Frameworks for building apps within Xcode. Cocoa is for Mac apps and Touch is for iOS apps. With its vast number of Libraries and APIs, one can create apps inheriting all the look and behavior of OSX.

With a built-in IDE debugging is run in real-time.

Although Swift was launched to be the future language of Cocoa/Xcode development Objective-C will not 
be going away soon. There are still many Cocoa libraries written in Objective-C and as the Objective-C 
has been around for several years it is currently more stable than Swift.

###Interface Builder (displays all views) IB methods are easily recognized by their prefix @IB:

	@IBOutlet: links code to UI. (ie. show / hide text field, UI Table View)
	 
	@IBAction: method triggered by UI objects (ie. button click) 

##Delegate page loader: AppDelegate.swift file loads app

##View: Main.storyboard (Views)

##Controller: Tab Controller (similar to object controller in Rails)

 FirstView Controller ("index" page)
 
 SecondViewController (Add new Todo page)    	

##Model: Taskmanager.swift file (model)

	struc: sets up the “structure" to store data into an object
 
	var tasks =  [array] to push data into

##View + Controller integration

###DEMO table view drag / drop creation (similar to HTML & CSS) Buttons, Centering, Fonts, Placeholders, Background Images, Color, etc

 Click properties for table events (also drag and drop):
      
      a) delegate
           delegate object - object which is clicked
           delegate method - method which is enacted upon: block, defer, alter, execute, etc
      
      b) datasource:
           A data source is almost identical to a delegate. The difference is in the relationship with the delegating object. Instead of           being delegated control of the user interface, a data source is delegated control of data(persisted)

####Swift terminology

struc: sets up the “structure" to store data into an object

let: constant

println: same as console.log in javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment