GithubHelp home page GithubHelp logo

jrrobles979 / ios-nd-gcd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from udacity/ios-nd-gcd

0.0 0.0 0.0 762 KB

Resources for Udacity's Grand Central Dispatch course.

License: MIT License

Swift 100.00%

ios-nd-gcd's Introduction

iOS Developer Nanodegree logo

Grand Central Dispatch

Platform iOS

This repository contains resources for Udacity's Grand Central Dispatch course.

Overview

There are two parts to this repo: (1) the playgrounds about closures and (2) the FatImages projects. The FatImages projects are separated into the following steps:

Step 1

Add basic scaffolding with stub implementation of the three main methods:

    // This method downloads a huge image, blocking the main queue and
    // the UI.
    // This si for instructional purposes only, never do this.
    @IBAction func synchronousDownload(sender: UIBarButtonItem) {
    }
    
    // This method avoids blocking by creating a new queue that runs
    // in the background, without blocking the UI.
    @IBAction func simpleAsynchronousDownload(sender: UIBarButtonItem) {
    }
    
    // This code downloads the huge image in a global queue and uses a completion
    // closure.
    @IBAction func asynchronousDownload(sender: UIBarButtonItem) {
    }

Step 2

Add synchronous example, line by line.

Step 2.1

Same as aboved, but compacted into a neat and safe if-let construct.

Step 3

Add simple asynchronous method.

Step 4

Add asynchronous code running the completion closure in the background. Eventually this will crash. Explain why completion handlers should go in the main queue.

Step 4.1

Add asyncronous code that runs the completion block in the main queue. Now we're good.

Step 5

Provide user feedback with an activity indicator. It works everywhere except the synchronous method. Why? Enter the runloop and how to delay a task with GCD.

Step 5.1

Fix the synchronous method with dispatch_after()

Setup

Generally speaking, the projects can run without any additional setup. However, consult the Grand Central Dispatch course for more information.

Maintainers

@OwenLaRosa

ios-nd-gcd's People

Contributors

jarrodparkes avatar owenlarosa avatar krotondo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.