I hereby claim:
- I am nrewik on github.
- I am nrewik (https://keybase.io/nrewik) on keybase.
- I have a public key ASA5UgYMoNUfaxy7wRAk2xm85HAyTz_7wYbTiX52ZZyv9go
To claim this, I am signing this object:
| // | |
| // UILabel+FontSize.Swift | |
| // | |
| // Created by Nutchaphon Rewik on 7/11/15. | |
| // Copyright (c) 2015 Nutchaphon Rewik. All rights reserved. | |
| // | |
| import UIKit | |
| extension UILabel{ |
| import UIKit | |
| extension NSDate{ | |
| /** | |
| Create all dates in specific month and year as in `gregorian` calendar | |
| **Usage Example** | |
| `NSDate.datesInMonthCalendar(month: 8, year: 2015)` |
| // | |
| // UIImage+Orientation.swift | |
| // DrCloudPatient | |
| // | |
| // Created by DW78 on 8/21/15. | |
| // Copyright (c) 2015 DW78. All rights reserved. | |
| // | |
| import UIKit |
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import XCPlayground | |
| XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true) | |
| class ExampleChainingRequest: NSObject{ | |
| private var session: NSURLSession! |
| func getUserData(#token: String) -> Promise<User>{ | |
| return Promise<User>{ fulfill, reject in | |
| let task = NSURLSession.sharedSession().dataTaskWithURL(self.getCurrentUserURL){ data , res , err in | |
| if let err = err{ | |
| return reject(err) | |
| } | |
| let user = User(data: data) | |
| return fulfill(user) | |
| } | |
| task.resume() |
| // 1. login post request | |
| NSURLSession.sharedSession().dataTaskWithRequest(loginRequest){ data , res , err in | |
| // let token = data... | |
| // we have token. | |
| let getCurrentUserURL = NSURL(string: getUserDataURL + "?token=\(token)")! | |
| // 2. get current user data | |
| NSURLSession.sharedSession().dataTaskWithURL(getCurrentUserURL){ data , res , err in | |
| // we have user data, and we get currentUserID |
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import XCPlayground | |
| public typealias Validator = String -> Bool | |
| public typealias ValidatorTransformer = Validator -> Validator | |
| public typealias ValidatorCombiner = ( Validator , Validator ) -> Validator | |
| public enum Rule{ |
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import XCPlayground | |
| extension UIView{ | |
| var snapshot: UIImage{ | |
| UIGraphicsBeginImageContextWithOptions(bounds.size, false, 0); |
I hereby claim:
To claim this, I am signing this object:
| import UIKit | |
| let text = "Saw yet kindness too replying whatever marianne. Old sentiments resolution admiration unaffected its mrs literature. (https://www.google.com/), Situation admitting promotion at or to perceived be. Mr acuteness we as estimable enjoyment up. An held late as felt know." | |
| let font = UIFont.preferredFont(forTextStyle: .body) | |
| let highlightFont = UIFont.preferredFont(forTextStyle: .headline) | |
| let attributedText = NSMutableAttributedString(string: text, attributes: [ | |
| .font : font | |
| ]) |