Skip to content

Instantly share code, notes, and snippets.


Craig Grummitt craiggrummitt

View GitHub Profile
craiggrummitt / TiledImageView.swift
Last active Oct 31, 2019
Renders a tiled image in a view. Also renders in the storyboard.
View TiledImageView.swift
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)
craiggrummitt / Contents.json
Created Aug 1, 2018
Add to Asset Catalog with icon files generated by Photoshop App Icon Template in
View Contents.json
"images" : [
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
"size" : "20x20",
View MIT-license
All public gists
Copyright 2016, Craig Grummitt
MIT License,
craiggrummitt / SKMultilineLabel.swift
Last active Apr 11, 2020
Multi line label in Sprite Kit in Swift
View SKMultilineLabel.swift
// SKMultilineLabel.swift
// Created by Craig on 10/04/2015.
// Copyright (c) 2015 Interactive Coconut.
// MIT License,
/* 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))
craiggrummitt / SKTexture gradient extension
Last active Apr 29, 2019
SKTexture gradient extension
View SKTexture gradient extension
// Extensions.swift
// WordSnatch
// Created by Craig on 24/03/2015.
// Copyright (c) 2015 Interactive Coconut. All rights reserved.
import SpriteKit
import UIKit
You can’t perform that action at this time.