Skip to content

Instantly share code, notes, and snippets.

@juliengdt
juliengdt / SomePlayground.swift
Last active September 21, 2019 15:55
Strongly Type Identifiers For Class Or Struct By Using Protocol and associated types
/*
In response of Tom Lokhort's article.
A third alternative: alternative 2 under steroïds
---
Source: http://tom.lokhorst.eu/2017/07/strongly-typed-identifiers-in-swift
*/
struct GenericIdentifier<T>: RawRepresentable, Hashable, Equatable {
let rawValue: String
@NatashaTheRobot
NatashaTheRobot / WatchConnectivitySingletonDemo.swift
Last active December 29, 2022 14:44
WatchConnectivity Singleton Demo
//
// WatchSessionManager.swift
// WatchConnectivityDemo
//
// Created by Natasha Murashev on 9/3/15.
// Copyright © 2015 NatashaTheRobot. All rights reserved.
//
import WatchConnectivity
@higepon
higepon / API.swift
Last active July 31, 2023 16:00
An example of JSON API call in Swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
@evadne
evadne / gist:4544569
Last active August 14, 2023 05:04
Todd Laney’s enhancements to Sticky Headers + UICollectionViewFlowLayout
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//