Skip to content

Instantly share code, notes, and snippets.

View neilkimmett's full-sized avatar

Neil Kimmett neilkimmett

View GitHub Profile
module.exports = theo => {
theo.registerFormat('ios.color.swift', result => {
return `🎉`;
});
}
/* Default page background */
export const colorGray10 = "#f7f7f7";
/* ClassPass' key brand color */
export const colorBrand = "#0055ff";
"scripts": {
"web": "theo colors.yml - transform web - format scss > colors.scss",
"js": "theo color.yml - format module.js > colors.js",
"all": "yarn web && yarn js"
}
/* Default page background */
$color-gray10: rgb(247, 247, 247);
/* ClassPass' key brand color */
$color-brand: rgb(0, 85, 255);
"scripts": {
"web": "theo colors.yml - transform web - format scss > colors.scss"
}
global:
type: color
category: color
props:
colorGray10:
value: "#f7f7f7"
comment: Default page background
colorBrand:
value: "#0055ff"
comment: ClassPass' key brand color
{
"dependencies": {
"theo": "salesforce-ux/theo"
}
}
@neilkimmett
neilkimmett / KeyboardManagerViewController.swift
Last active February 18, 2016 10:58
Swift implementation of Soroush Khanlou's keyboard manager view controller
extension UIEdgeInsets {
static var zero: UIEdgeInsets {
return UIEdgeInsetsZero
}
}
// Inspired by "Many Controllers Make Light Work" by Soroush Khanlou
// http://khanlou.com/2016/02/many-controllers/
class KeyboardManagerViewController: UIViewController {
let scrollView: UIScrollView
import UIKit
public func draw(size: CGSize, drawBlock: (CGContext) -> ()) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, true, 0.0)
defer {
UIGraphicsEndImageContext()
}
guard let context = UIGraphicsGetCurrentContext() else {
return nil
class WKInterfaceButton : WKInterfaceObject {
func setTitle(title: String?)
func setAttributedTitle(attributedTitle: NSAttributedString?)
func setBackgroundColor(color: UIColor?)
func setBackgroundImage(image: UIImage?)
func setBackgroundImageData(imageData: NSData?)
func setBackgroundImageNamed(imageName: String?)