This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let twitterUser = JSONMagic(data: serverResponse)["user"]["accounts"][0]["user"].string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension JSONMagic: CustomStringConvertible { | |
| public var description: String { | |
| if self.value == nil { | |
| return "<No Value>" | |
| } | |
| return "\(self.value!)" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if let tintColor = configData["tint_color"] as? [CGFloat] where tintColor.count == 3 { | |
| self.window?.tintColor = UIColor(red: tintColor[0], green: tintColor[1], blue: tintColor[2], alpha: 1) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if let tintColor = configData["tint_color"] as? [String: CGFloat] { | |
| if let r = tintColor["r"], g = tintColor["g"], b = tintColor["b"] { | |
| self.window?.tintColor = UIColor(red: r, green: g, blue: b, alpha: 1) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func tintColor(configData: NSDictionary) -> UIColor? { | |
| guard let tintColor = configData["tint_color"] as? [String: CGFloat] else { | |
| return nil | |
| } | |
| guard let r = tintColor["red"], g = tintColor["green"], b = tintColor["blue"] else { | |
| return nil | |
| } | |
| return UIColor(red: r, green: g, blue: b, alpha: 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.window?.tintColor = self.tintColor(configData) ?? UIColor.redColor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
| return self.messageData.count ?? 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let mainBundle = NSBundle.mainBundle() | |
| let config = mainBundle.pathForResource(“Config”, ofType: “plist”)! | |
| let configData = NSDictionary(contentsOfFile: config)! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| copyrightLabel.text = configData["copyright"] as! String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| userNoteLabel.text = configData["user_note"] as? String |