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 printFonts() { | |
| let fontFamilyNames = UIFont.familyNames() | |
| for familyName in fontFamilyNames { | |
| print("------------------------------") | |
| print("Font Family Name = [\(familyName)]") | |
| let names = UIFont.fontNamesForFamilyName(familyName) | |
| print("Font Names = [\(names)]") | |
| } | |
| } |
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 UIColor { | |
| class func HTSDColorWithHexString (hex:String) -> UIColor { | |
| var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString | |
| if (cString.hasPrefix("#")) { | |
| cString = (cString as NSString).substringFromIndex(1) | |
| } | |
| if (cString.characters.count != 6) { |
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
| public extension UITableView { | |
| func registerClass(myClass:AnyClass) { | |
| let bundle = NSBundle(forClass: myClass) | |
| self.registerNib(UINib(nibName: String(myClass), bundle: bundle), forCellReuseIdentifier: String(myClass)) | |
| } | |
| func dequeue<T where T:UITableViewCell>(myclass:T.Type) -> T { | |
| return self.dequeueReusableCellWithIdentifier(String(myclass)) as! T | |
| } |
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
| import Foundation | |
| import UIKit | |
| extension UIView { | |
| func constraintForAttribute(attribute:NSLayoutAttribute) -> NSLayoutConstraint? { | |
| for constraint in self.constraints { | |
| if constraint.firstAttribute == attribute { | |
| return constraint | |
| } |
OlderNewer