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

Mac1台でアプリを作る時代再び

taminif
November 09, 2017

 Mac1台でアプリを作る時代再び

Osaka Mix Leap Study #1 - Android / iOSで発表した資料です。

taminif

November 09, 2017
Tweet

More Decks by taminif

Other Decks in Programming

Transcript

  1. Realtime Database let withBlock = { (snapshot: FIRDataSnapshot) in //

    received chat data if let dictionary = snapshot.value as? [String : AnyObject] { guard let isRoleProf = dictionary["is_role_prof"] as? Bool, let timeMsec = dictionary["time_msec"] as? UInt64, let senderIdString = dictionary["sender_id"] as? String, let senderId = Int(senderIdString), let text = dictionary["text"] as? String else { return } let time:Double = Double(timeMsec) / 1000 } var data:ChatDataStruct if isRoleProf { // prof data = ChatDataStruct(messageSender: .YOU, message: text, displayTime: self.displayTimeFormatter.string(from: Date(timeIntervalSince1970: time))) } else { // member data = ChatDataStruct(messageSender: .ME, message: text, displayTime: self.displayTimeFormatter.string(from: Date(timeIntervalSince1970: time))) } self.chatTableReload(data: data) } firebaseChatObserveHandle = firebaseUserReference.child(`Firebaseͷύε `).observe(.childAdded, with: withBlock) ௥ՃࣜͰ0CTFSWFS ηοτ 'JSFCBTF͔Βϊʔ υΛड͚औͬͨ࣌ ͷॲཧΛఆٛ