Skip to content

Instantly share code, notes, and snippets.

@correia
correia / swift-kvo-example.swift
Last active April 16, 2023 02:38
A quick example for how to use Foundation style KVO from Swift. (Official documentation from Apple is forthcoming.)
//
// Swift-KVO
//
// Created by Jim Correia on 6/5/14.
// Copyright (c) 2014-2015 Jim Correia. All rights reserved.
//
// Update: 6/17/2014
//
// KVOContext has gone away; use the same idiom you'd use from Objective-C for the context
//
@mayoff
mayoff / ArrowLayer.h
Created November 27, 2012 06:44
A CALayer subclass that draws a very simple arrow
#import <QuartzCore/QuartzCore.h>
@interface ArrowLayer : CALayer
@property (nonatomic) CGFloat thickness;
@property (nonatomic) CGFloat startRadians;
@property (nonatomic) CGFloat lengthRadians;
@property (nonatomic) CGFloat headLengthRadians;
@property (nonatomic, strong) UIColor *fillColor;