cs193p – Lecture #2 – Applying MVC

Please note, this blog entry is from a previous course. You might want to check out the current one.

The second lecture continues with the demo showing features of Swift and stacks in the interface builder.

The lecture as well as its slides are available via iTunes named “Applying MVC”. The code for the demo is available on GitHub.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #1 – Course Overview and Introduction to iOS, Xcode, and Swift

Please note, this blog entry is from a previous course. You might want to check out the current one.

The cs193p course has started a new edition #Spring2016 featuring iOS 9.

Like every year lecture #1 is an general introduction of the course with an overview about iOS, MVC and a life demonstration of creating a calculator app.

The lecture as well as its slides are available via iTunes named “Course Overview and Introduction to iOS, Xcode, and Swift”. The code for the demo is available on GitHub.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #13 Application Lifecycle and Core Motion

Please note, this blog entry is from a previous course. You might want to check out the current one.

NSNotification

Notifications provide a way to react to asynchronous events. e.g.:

NSNotificationCenter.defaultCenter()

func addObserverForName(String, // name of the "radio station"
    object: AnyObject?, // broadcaster (or nil for "anyone")
    queue: NSOperationQueue?) // queue to execute the closure on 
    { (notification: NSNotification) -> Void in
        let info: [NSObject:AnyObject]? = notification.userInfo // notification-specific information
}

Continue reading “cs193p – Lecture #13 Application Lifecycle and Core Motion”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #12 Dynamic Animation

Please note, this blog entry is from a previous course. You might want to check out the current one.

The twelfth lecture addresses a different approach to animation, creating sets of behaviors defining how items should interact with each other and the environment.

First we create an animator inside a reference view:

var animator = UIDynamicAnimator(referenceView: UIView)

Continue reading “cs193p – Lecture #12 Dynamic Animation”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #11 Unwind Segues, Alerts, Timers, View Animation

Please note, this blog entry is from a previous course. You might want to check out the current one.

The eleventh lecture is theory only, starting with detailed discussion about the final project (which might only be interesting for Stanford students).

Unwind Segue

Unwind Segues provide a way to segue back to MVCs which directly or indirectly presented the current segue.
Continue reading “cs193p – Lecture #11 Unwind Segues, Alerts, Timers, View Animation”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #10 Table View

Please note, this blog entry is from a previous course. You might want to check out the current one.

Though the lecture is called table view it starts with a “bonus topic”:

UITextField

The keyboard appears when a text field becomes first responder (becomeFirstResponder) and desperadoes when it resigns to be first responder (resignFirstResponder). To know when the return key has been pressed (functextFieldShouldReturn) or when editing has ended (textFieldDidEndEditing) is controlled via delegates or target/action notifications.
Continue reading “cs193p – Lecture #10 Table View”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #9 Scroll View and Multithreading

Please note, this blog entry is from a previous course. You might want to check out the current one.

The lecture starts with additional information on how to control the appearance of a view in different size classes and how to inspect constraints in various size classes.

Scroll Views

Adding sub views to a scroll view works similar like adding views to any other view. The only important difference is to define the content size of the scroll view:

scrollView.contentSize = CGSize(width: 3000, height: 2000)
logo.frame = CGRect(x: 2700, y: 50, width: 120, height: 180)
scrollView.addSubview(logo)
aerial.frame = CGRect(x: 150, y: 200, width: 2500, height: 1600)
scrollView.addSubview(aerial)

Continue reading “cs193p – Lecture #9 Scroll View and Multithreading”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail