Skip to content

Instantly share code, notes, and snippets.

View mattbischoff's full-sized avatar

mb mattbischoff

View GitHub Profile
@mattbischoff
mattbischoff / TMDashboardViewController.m
Created January 31, 2014 02:48
Receive UIKeyCommands without a text view or text field as the first responder.
@implementation TMDashboardViewController
#pragma mark - UIResponder
- (BOOL)canBecomeFirstResponder {
return YES;
}
- (NSArray *)keyCommands {
static NSArray *keyCommands;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>%d messages in your inbox</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@messages@ in your inbox</string>
<key>messages</key>
<dict>
//
// LCKAlertPresenter.h
// Quotebook
//
// Created by Matthew Bischoff on 9/1/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import Foundation;

Keybase proof

I hereby claim:

  • I am mattbischoff on github.
  • I am matthewbischoff (https://keybase.io/matthewbischoff) on keybase.
  • I have a public key whose fingerprint is EECC 1F2E 27A9 2D5D 29F2 1E33 09F3 0AD2 B628 A4CD

To claim this, I am signing this object:

@mattbischoff
mattbischoff / LCKIndexedFetchedResultsController.h
Last active August 29, 2015 14:10
LCKIndexedFetchedResultsController is a NSFetchedResultsController subclass that attempts to solve the problem of sorting a fetched collection into correctly alphabetized sections for every locale. It does things like making sure that the `#` character shows up at the bottom instead of the top of the section index titles.
//
// LCKIndexedFetchedResultsController.h
// Quotebook
//
// Created by Andrew Harrison on 7/26/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import CoreData;
//
// LCKConcurrentOperation.h
// LCKOperations
//
// Created by Twig on 12/19/13.
// Copyright (c) 2013 Lickability. All rights reserved.
//
@import Foundation;
@mattbischoff
mattbischoff / FetchedResultsControllerTableViewDataSource.h
Last active August 29, 2015 14:15
FetchedResultsControllerTableViewDataSource. Please stop writing this over and over again.
//
// FetchedResultsControllerTableViewDataSource.h
// Flock
//
// Created by Matthew Bischoff on 2/14/15.
// Copyright (c) 2015 Lickability. All rights reserved.
//
@import Foundation;
@import CoreData;
@mattbischoff
mattbischoff / Quotebook URL Scheme.md
Created March 5, 2012 04:28
Quotebook 2.0 URL Scheme

General Navigation

  • quotebook:// — Opens the app
  • quotebook://quotes — Goes to the Quotes Tab
  • quotebook://authors — Goes to the Authors Tab
  • quotebook://sources — Goes to the Sources Tab
  • quotebook://tags — Goes to the Tags tab

Adding Quotes

  • quotebook://add?quote=Stay%20Hungry.%20Stay%20Foolish.&author=Steve%20Jobs&source=Whole%20Earth%20Catalog&rating=5
  • Adds a quote "Stay Hungry. Stay foolish." to the user's Quotebook with the author Steve Jobs, the source Whole Earth Catalog with a rating of 5 stars.
extension Dictionary {
func typedValueForKey<T>(key: Key) -> T? {
return self[key] as? T
}
}
extension Array {
func typedValueAtIndex<T>(index: Index) -> T? {
@mattbischoff
mattbischoff / NSURL+DataURI.swift
Last active November 20, 2015 20:16
An extension on `NSURL` to support Data URIs. See https://en.wikipedia.org/wiki/Data_URI_scheme
import Foundation
/// An extension on `NSURL` to support Data URIs.
extension NSURL {
/// `true` if the receiver is a Data URI. See https://en.wikipedia.org/wiki/Data_URI_scheme.
var dataURI: Bool {
return scheme == "data"
}