Skip to content

Instantly share code, notes, and snippets.

View mattbischoff's full-sized avatar

mb mattbischoff

View GitHub Profile
@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;

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:

//
// LCKAlertPresenter.h
// Quotebook
//
// Created by Matthew Bischoff on 9/1/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import Foundation;
<?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>
@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;
@mattbischoff
mattbischoff / UITextField+LCKHacks.h
Created December 1, 2013 00:22
Used instead of `hasText` due to an inscrutable bug in iOS 7.
#import <UIKit/UIKit.h>
@interface UITextField (LCKHacks)
/// Fixes a bug in UIKit where the `hasText` methods sometimes returns the string's length instead of a BOOL in iOS 7.0.x.
- (BOOL)actuallyHasText;
@end
// Run this in the viewDidLoad of a new Core Data project with the Master-Detail Application Template
// Replace the file name with your momd's filename.
- (void)testCoreDataEquality {
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"TestCoreDataISEqual" withExtension:@"momd"];
NSManagedObjectModel *model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
NSPersistentStoreCoordinator *storeCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
[storeCoordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil];
NSManagedObjectContext *mainQueueContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
@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.