Skip to content

Instantly share code, notes, and snippets.

¯\_(ツ)_/¯ :godmode:

Eli Perkins eliperkins

¯\_(ツ)_/¯ :godmode:
View GitHub Profile
eliperkins / LinearGradientView.swift
Created Nov 6, 2018
lol gradients in UIKit 🙃🙃🙃
View LinearGradientView.swift
import UIKit
class LinearGradientView: UIView {
@objc var layerBacked: Bool {
didSet {
switch (layerBacked, layerView) {
case (true, .none): addLayerView()
case (false, .some): removeLayerView()
default: break
eliperkins / Squares.swift
Last active Feb 4, 2018
Generate Super Bowl Squares in a Xcode Playground
View Squares.swift
//: Playground - noun: a place where people can play
//: Super Bowl Squares - noun: free money
import Foundation
import PlaygroundSupport
enum Player: String {
case eli = "Eli"
case brian = "Brian"
case brendan = "Brendan"

Keybase proof

I hereby claim:

  • I am eliperkins on github.
  • I am eliperkins ( on keybase.
  • I have a public key whose fingerprint is 9366 A899 5661 5641 D9F3 4624 99EA EEFE A3AA 2D9A

To claim this, I am signing this object:

View AorBandC.swift
import RxSwift
let A = Observable.just(())
let B = Observable.just(())
let C = Observable.just(())
let AorB = Observable.combineLatest(A, B) { (a, b) in
return ()
View ProtocolShenanigans.swift
protocol Able {
init?(foo: String)
protocol Ible {
init(bar: Int) throws
extension Able where Self: Ible {
init?(foo: String) {

Apple TV Tech Talks

tvOS Fundamentals

  • Living Room experience
  • Always connected
  • Powerful hardware
  • Separate SDK with optional Universal Purchase
  • Developer tools and tech

Designing for tvOS

View ProtocolsPlayground.swift
// Given that a protocol unifies two types: BlogPost and PhotoPost...
protocol PostType {
var title: String { get }
struct BlogPost: PostType {
let title = "My Hot New Blog Post"
struct PhotoPost: PostType {
View MocksPlayground.swift
//: Mocks Playground
import UIKit
struct User {
struct PushNotificationController {
let registrar: PushNotificationRegistrar
init(registrar: PushNotificationRegistrar) {
View FluxPlayground.swift
//: Playground - noun: a place where people can play
import UIKit
struct Todo {
let id: NSUUID
let text: String
let complete: Bool

Implementing a Strong Code-Review Culture

As an author

  • Provide more/sufficient context around changes
  • Linking to the issue isn't always enough
  • Challenge: 2 paragraphs of context

As a reviewer

  • Offer compliments in PRs when you learn or something is done well
  • Ask questions rather than make demands/commands, engage in conversation