Instantly share code, notes, and snippets.

@JaviLorbada
JaviLorbada / buddybuild_postclone.sh
Created May 7, 2017
buddybuild_postclone phase
View buddybuild_postclone.sh
echo "Updating Swiftlint..."
brew uninstall --force swiftlint
brew install swiftlint
brew switch swiftlint 0.18.1
echo "Creating Xcodeproj..."
swift package generate-xcodeproj \
--enable-code-coverage
echo "Xcodebuild tests!"
@JaviLorbada
JaviLorbada / RAC ViewModel Action on button pressed
Last active Apr 13, 2017
RAC ViewModel Action after button pressed with textfield char count as button enabled condition
View RAC ViewModel Action on button pressed
import Result
import ReactiveCocoa
import ReactiveSwift
import UIKit
import XCPlayground
struct ViewModel {
// do not expose the implementation detail
private let (codeSignal, codeSink) = Signal<String, NoError>.pipe()
@JaviLorbada
JaviLorbada / CustomFontPlayground.swift
Created Aug 31, 2015
Load custom fonts within Swift playgrounds
View CustomFontPlayground.swift
//: Playground - noun: a place where people can play
import UIKit
let fontURL = NSBundle.mainBundle().URLForResource("PillGothic300mg-bold", withExtension: "ttf")
CTFontManagerRegisterFontsForURL(fontURL!, CTFontManagerScope.Process, nil)
var pillGothicFontBold = UIFont(name: "PillGothic300mg-bold", size: 30)
var attrs = [NSFontAttributeName : pillGothicFontBold!,