(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Start here https://developers.facebook.com/docs/getting-started/getting-started-with-the-ios-sdk/ | |
// Install the Facebook SDK, get it linked up, create an app, and get that setup correctly | |
// in your info.plist, appDelegate, and build settings. | |
//Note: This example uses ARC. If you aren't using ARC, made sure to release/retain objects as needed. | |
//Now for the fun part. | |
//////////////////////////// |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// | |
// FallingStuffAnimationVC.m | |
// UIGravityBehavior | |
// | |
// Created by Mark Parth Dabhi on 06/07/2016. | |
// Copyright (c) 2014 Parth Dabhi. All rights reserved. | |
// | |
#import "FallingStuffAnimationVC.h" |
# | |
# python drive.py "origin" ["waypoint" ... ] "destination" | |
# | |
# i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO | |
import sys, json, urllib2, md5, os.path, pprint | |
from math import radians, sin, cos, atan2, pow, sqrt | |
from urllib import quote_plus | |
from xml.sax.saxutils import escape | |
from optparse import OptionParser |
class Brew { | |
var temp: Float = 0.0 | |
} | |
class BrewViewModel : NSObject { | |
var brew = Brew() | |
dynamic var temp: Float = 0.0 { | |
didSet { | |
self.brew.temp = temp | |
} |
// Use Parse.Cloud.define to define as many cloud functions as you want. | |
// For example: | |
Parse.Cloud.define("hello", function (request, response) { | |
response.success("Hello world!"); | |
}); | |
Parse.Cloud.define("userWithEmailExists", function (request, response) { | |
var email = request.params.email; | |
if (email != null && email !== "") { | |
email = email.trim(); |
class API { | |
let uri = "https://api.com/endpoint" // replace your api endpoint (json) | |
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void { | |
let url: NSURL = NSURL(string: uri)! | |
let ses = NSURLSession.sharedSession() | |
let task = ses.dataTaskWithURL(url, completionHandler: {data, response, error -> Void in | |
import Foundation | |
func fatalError<T>(@autoclosure message: () -> String = "", file: StaticString = #file, line: UInt = #line) -> T { | |
fatalError(message(), file: file, line: line) | |
} | |
// Demo | |
protocol ResultType { |
import Foundation | |
func dispatch_async_batch(tasks: [() -> ()], limit: Int, completion: (() -> ())?) { | |
if tasks.count > 0 || completion != nil { | |
let q = dispatch_queue_create("dispatch_async_batch", DISPATCH_QUEUE_CONCURRENT); | |
let sema = dispatch_semaphore_create(limit); | |
dispatch_async(q, { | |
for task in tasks { | |
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER) |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>downloadables</key> | |
<array> | |
<dict> | |
<key>fileSize</key> | |
<integer>1171440164</integer> | |
<key>identifier</key> |