Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mayoff
mayoff / Arrow.swift
Last active May 13, 2022 07:30
UIBezierPath category to create an arrow (now with a Swift version!)
// Swift 2.2 syntax / API
import UIKit
extension UIBezierPath {
class func arrow(from start: CGPoint, to end: CGPoint, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat) -> Self {
let length = hypot(end.x - start.x, end.y - start.y)
let tailLength = length - headLength
@terhechte
terhechte / slow_kvo_dictionary_example1.m
Created December 7, 2011 20:17
Example 1 of slow and fast NSDictionary access
//
// slow_kvo_dictionary_example.m
//
// Created by Benedikt Terhechte on 07.12.11.
// appventure.me
//
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])