This file contains 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
@IBDesignable | |
class TiledImageView:UIView { | |
@IBInspectable var image:UIImage? | |
override func draw(_ rect: CGRect) { | |
guard let image = image else {return} | |
UIColor(patternImage: image).setFill() | |
let path = UIBezierPath(rect: rect) | |
path.fill() | |
} | |
} |
This file contains 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
{ | |
"images" : [ | |
{ | |
"size" : "20x20", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "20x20", |
This file contains 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
All public gists https://gist.github.com/craiggrummitt | |
Copyright 2016, Craig Grummitt | |
MIT License, http://www.opensource.org/licenses/mit-license.php |
This file contains 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
// | |
// SKMultilineLabel.swift | |
// | |
// Created by Craig on 10/04/2015. | |
// Copyright (c) 2015 Interactive Coconut. | |
// MIT License, http://www.opensource.org/licenses/mit-license.php | |
// | |
/* USE: | |
(most component parameters have defaults) | |
let multiLabel = SKMultilineLabel(text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut 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 officia deserunt mollit anim id est laborum.", labelWidth: 250, pos: CGPoint(x: size.width / 2, y: size.height / 2)) |
This file contains 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
// | |
// Extensions.swift | |
// WordSnatch | |
// | |
// Created by Craig on 24/03/2015. | |
// Copyright (c) 2015 Interactive Coconut. All rights reserved. | |
// | |
import SpriteKit | |
import UIKit |