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

Rate My Talk: Hacking Cloud Kit and iOS 8 Exten...

Rate My Talk: Hacking Cloud Kit and iOS 8 Extensions

The first day of #NSSpain, together with @bogdanIusco, @mirceaSV, @Eldorado234, @sofokli1 we made an app that allows to rate the Talks. It was a TON of Fun and we *almost* :( won.

Manu Carrasco Molina

September 19, 2014
Tweet

More Decks by Manu Carrasco Molina

Other Decks in Programming

Transcript

  1. D O E S I T H U R T

    ? # H A C K @ N S PA I N
  2. O N LY I F Y O U U S

    E S W I F T ? # H A C K @ N S S PA I N
  3. O N LY I F Y O U U S

    E S W I F T ! # H A C K @ N S S PA I N
  4. T H E I D E A • @mennenia: “Somebody

    make an Extension” • @stuffmc: “We should ˒ Talks!” • @bogdanIusco: “Somebody do something with CloudKit”
  5. T H E T E A M & T H

    E TA S K S • @stuffmc: CloudKit • @bogdanIusco: CloudKit • @mirceaSV: UICollectionViewController • @Eldorado234: Research on iPhone • + @sofokli1 + People not being on Twitter (Yes, they exist!)
  6. S C H E D U L E . J

    S O N ? • “Luis, ¡dame un JotaSON!” • “No tenemos” • “…”
  7. S C H E D U L E . J

    S O N ? • “¿Teneis un Excel?” • => .csv => .componentsSeparatedByString
  8. I N S E R T I N T O

    C L O U D K I T let publicDB = CKContainer.defaultContainer().publicCloudDatabase let talkRecord = CKRecord(recordType: "Talks") talkRecord.setValue(attributes[3], forKey: "name") publicDB.saveRecord(talkRecord, completionHandler: { (savedTalk, error) -> Void in println("\(savedTalk) has no \(error)") })
  9. G E T T H O S E TA L

    K S func fetchAllTalks(finishCallback: (Array<Talk>) -> Void) { let predicate = NSPredicate(value: true) let query = CKQuery(recordType: “Talks”, predicate: predicate) query.sortDescriptors = [NSSortDescriptor(key: "begin", ascending: true)] publicDB.performQuery(query, inZoneWithID: nil) { (records, error) -> Void in self.allTalks = Array<Talk>() for record in records { let talk = Talk(record: record as CKRecord) self.allTalks?.append(talk) } dispatch_async(dispatch_get_main_queue(), { () -> Void in finishCallback(self.allTalks!) }) } }
  10. 7 D E V S , N O D E

    S I G N E R S WA R N I N G
  11. E X T E N S I O N S

    , E X T E N S I O N S , E X T E N S I O N S , … i O S 8 i s o u t ! ! !
  12. G E T T H E C O D E

    G I T H U B . C O M / S T U F F M C / R AT E M Y TA L K