Skip to content

Instantly share code, notes, and snippets.

Erica Sadun erica

Block or report user

Report or block erica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keypath Literal Getter Promotion

  • Proposal: SE-nnnn
  • Authors: TBD
  • Review Manager: TBD
  • Status: Awaiting implementation
View monoid.swift
import Foundation
// 3456789012345678901234567890123456789012345678901234567890123456789012345678
Monoid reduction, for strictly binary operation combination.
Note: The monoid approach does not throw right now.
View ali.swift
import AppKit
struct AttributableString {
let attributedString: NSAttributedString
extension AttributableString: ExpressibleByStringLiteral {
init(stringLiteral: String) {
self.attributedString = NSAttributedString(string: stringLiteral)
View rounding.swift
// More String Interpolation
public extension String {
/// The direction from which a string floats when
/// padded with repeated characters.
enum PaddingDirection { case left, right, center }
/// Returns a new string repeatedly padded with a character on
/// either or both sides of the source string.
View CGRect+Geometry.swift
erica sadun,
Core Geometry
import Foundation
import QuartzCore

Firebase for Dummies

Visit to begin. Most tutorial projects can be simple JSON storage sinks accessed from iOS.

Create a new Firebase database

  1. Click Add Project
  2. Enter a project name.
  3. Disable "Use the default settings for sharing Google Analytics for Firebase data".
  4. Click Continue.

Scavenger Hunt

Time: 10 minutes

  • Use Xcode documentation, online searches, and personal knowlege.
  • No helping each other. You're building your own search skills. We'll discuss strategies at the end.
  • Remember, iOS changes rapidly. You're looking for the latest APIs.
  • When you're done or time is up, send your answers privately to me in Zoom.


View CrayonModel.swift
import UIKit
let crayonDictionary = ["Sepia": #colorLiteral(red: 0.6171875, green: 0.35546875, blue: 0.25, alpha: 1.0),
"Beaver": #colorLiteral(red: 0.5703125, green: 0.43359375, blue: 0.35546875, alpha: 1.0),
"Caribbean Green": #colorLiteral(red: 0.0, green: 0.796875, blue: 0.59765625, alpha: 1.0),
"Electric Lime": #colorLiteral(red: 0.796875, green: 0.99609375, blue: 0.0, alpha: 1.0),
"Gray": #colorLiteral(red: 0.54296875, green: 0.5234375, blue: 0.5, alpha: 1.0),
"Pacific Blue": #colorLiteral(red: 0.0, green: 0.61328125, blue: 0.765625, alpha: 1.0),
"Burnt Sienna": #colorLiteral(red: 0.91015625, green: 0.453125, blue: 0.31640625, alpha: 1.0),
"Manatee": #colorLiteral(red: 0.55078125, green: 0.5625, blue: 0.62890625, alpha: 1.0),
You can’t perform that action at this time.