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 attributeTextWithLink() -> NSMutableAttributedString { | |
| let styledText = NSMutableAttributedString(string: self) | |
| styledText.addAttribute(NSForegroundColorAttributeName, value: UIColor(hexString: GlynkColors.hex867B8C), range: NSRange(location: 0, length: self.characters.count)) | |
| let linkAttributes = [ | |
| NSForegroundColorAttributeName: UIColor.red, //(hexString: GlynkColors.hex867B8C), | |
| NSUnderlineColorAttributeName: UIColor.lightGray, | |
| NSUnderlineStyleAttributeName: NSUnderlineStyle.styleSingle.rawValue ] as [String : Any] |
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
| # sample.py | |
| import falcon | |
| import json | |
| class QuoteResource: | |
| def on_get(self, req, resp): | |
| """Handles GET requests""" | |
| quote = { | |
| 'quote': 'I\'ve always been more interested in the future than in the past.', | |
| 'author': 'Grace Hopper' |
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
| /// Generated Alamofire Router | |
| import Alamofire | |
| import Foundation | |
| public typealias JSONDictionary = [String: AnyObject] | |
| public typealias Username = String | |
| public typealias ObjectId = String | |
| public typealias Email = 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
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView() | |
| newView.backgroundColor = UIColor.redColor() | |
| newView.translatesAutoresizingMaskIntoConstraints = false | |
| view.addSubview(newView) | |
| let views = ["view": view, "newView": newView] | |
| let horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:[view]-(<=0)-[newView(100)]", options: NSLayoutFormatOptions.AlignAllCenterY, metrics: nil, views: views) |
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 UIKit | |
| class CustomView: UIView { | |
| override var intrinsicContentSize: CGSize { | |
| return CGSize(width: 100, height: 100) | |
| } | |
| } | |
| class ViewController: UIViewController { |
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 viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView() | |
| newView.backgroundColor = UIColor.red | |
| newView.translatesAutoresizingMaskIntoConstraints = false | |
| view.addSubview(newView) | |
| let horizontalConstraint = newView.centerXAnchor.constraint(equalTo: view.centerXAnchor) | |
| let verticalConstraint = newView.centerYAnchor.constraint(equalTo: view.centerYAnchor) |
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 viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | |
| newView.backgroundColor = UIColor.red | |
| newView.translatesAutoresizingMaskIntoConstraints = true | |
| view.addSubview(newView) | |
| newView.center = CGPoint(x: view.bounds.midX, y: view.bounds.midY) | |
| newView.autoresizingMask = [UIViewAutoresizing.flexibleLeftMargin, UIViewAutoresizing.flexibleRightMargin, UIViewAutoresizing.flexibleTopMargin, UIViewAutoresizing.flexibleBottomMargin] |
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 viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView() | |
| newView.backgroundColor = UIColor.red | |
| newView.translatesAutoresizingMaskIntoConstraints = false | |
| view.addSubview(newView) | |
| let horizontalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0) | |
| let verticalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 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
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView() | |
| newView.backgroundColor = UIColor.red | |
| newView.translatesAutoresizingMaskIntoConstraints = false | |
| view.addSubview(newView) | |
| let horizontalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0) | |
| let verticalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 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
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let newView = UIView() | |
| newView.backgroundColor = UIColor.red | |
| newView.translatesAutoresizingMaskIntoConstraints = false | |
| view.addSubview(newView) | |
| let horizontalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerX, multiplier: 1, constant: 0) | |
| let verticalConstraint = NSLayoutConstraint(item: newView, attribute: NSLayoutAttribute.centerY, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerY, multiplier: 1, constant: 0) |