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
static let loremText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor." | |
static let loremTextLong = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officiae deserunt mollit anim id est laborum." |
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
imageView.layer.borderWidth = 1 | |
imageView.layer.masksToBounds = false | |
imageView.layer.borderColor = UIColor.white.cgColor | |
imageView.layer.cornerRadius = imageView.frame.height / 2 | |
imageView.clipsToBounds = true | |
imageView.backgroundColor = .white | |
imageView.contentMode = .scaleAspectFill |
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 titleText = NSMutableAttributedString(string: "Title") | |
let paragraphStyle = NSMutableParagraphStyle() | |
paragraphStyle.lineSpacing = 0.5 | |
paragraphStyle.lineHeightMultiple = 0.7 | |
// Line spacing attribute | |
titleText.addAttribute(NSAttributedString.Key.paragraphStyle, value:paragraphStyle, range:NSMakeRange(0, titleText.length)) |
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
class TwoTriangleView: UIView { | |
@IBInspectable var fillColor1: UIColor? { | |
didSet { | |
self.setNeedsDisplay() | |
} | |
} | |
@IBInspectable var fillColor2: UIColor? { | |
didSet { |
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
git submodule update --init --recursive |
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
defaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool YES |
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
git submodule add git@mygithost:billboard lib/billboard | |
# https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
class CustomView: UIView { | |
override func draw(_ rect: CGRect) { | |
super.draw(rect) | |
// draw stuff |
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
struct DataObject { | |
var title: String? | |
var publishDate: Date | |
var imageUrl: String? | |
// other properties | |
var expirationDate : Date | |
var documentHTML: 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
let transition: CATransition = CATransition() | |
transition.duration = 0.5 | |
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) | |
transition.type = kCATransitionMoveIn | |
transition.subtype = kCATransitionFromTop | |
self?.view.window?.layer.add(transition, forKey: kCATransition) |