Skip to content

Instantly share code, notes, and snippets.


Curtis Herbert parrots

View GitHub Profile
parrots / ModernSegmentedControl.swift
Created Jun 28, 2019
A segmented control without the borders. Allows for a subtle background on the unselected states, and a tint on the selected state.
View ModernSegmentedControl.swift
// ModernSegmentedControl.swift
// Created by Curtis Herbert on 3/8/18.
import Foundation
@objc final class ModernSegmentedControl: UIControl {
parrots / AsyncOperation.swift
Last active May 17, 2021
A Swifty version of an AsyncOperation which solves two common problems I ran into. (see comment below for issues addressed)
View AsyncOperation.swift
// AsyncOperation.swift
// Slopes
import Foundation
class AsyncOperation: Operation {
private let stateLock = NSLock()
private var observers: [NSKeyValueObservation] = [NSKeyValueObservation]()

Keybase proof

I hereby claim:

  • I am parrots on github.
  • I am parrots ( on keybase.
  • I have a public key whose fingerprint is 43FD FA59 6C6F 3419 9FC5 4702 9D99 E4DB 59AD B11F

To claim this, I am signing this object:

View CachingInterfaceController.h
@import WatchKit;
@interface CachingInterfaceController : WKInterfaceController
- (void)updateLabel:(WKInterfaceLabel *)label withString:(NSString *)string;
- (void)updateLabel:(WKInterfaceLabel *)label asHidden:(BOOL)hidden;
- (void)updateImage:(WKInterfaceImage *)image withImageNamed:(NSString *)imageName;
- (void)updateImage:(WKInterfaceImage *)image withBaseNameForAnimation:(NSString *)baseName withRange:(NSRange)range duration:(NSTimeInterval)duration repeatCount:(NSInteger)repeatCount;
- (NSString *)currentImageNameForImage:(WKInterfaceImage *)image;
parrots /
Created Apr 9, 2015
Watchkit versioning build phase
git=`sh /etc/profile; which git`
branch_name=`$git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,'`
git_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'`
simple_branch_name=`$git rev-parse --abbrev-ref HEAD`
if [ $CONFIGURATION != "Release" ]; then
parrots / CBCImageView
Created Dec 17, 2014
Work around IB_Designable bug with template images and Interface Builder
View CBCImageView
@import UIKit;
IB_DESIGNABLE @interface CBCImageView : UIImageView
@implementation CBCImageView
- (void)awakeFromNib
parrots /
Last active Jan 23, 2019 — forked from DAddYE/
OSX Defaults
#!/usr/bin/env sh
# This is script with usefull tips taken from:
#echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
#defaults write NSGlobalDomain AppleKeyboardUIMode -int 3