Skip to content

Instantly share code, notes, and snippets.

@calebhicks
calebhicks / FirebaseType.swift
Created October 28, 2015 22:34
A simple Swift protocol for Firebase objects with default save() and delete() implementations.
//
// FirebaseType.swift
//
import Foundation
import Firebase
protocol FirebaseType {
// properties
@calebhicks
calebhicks / Stack.swift
Last active June 22, 2018 16:29
A simple Core Data written in Swift. Inspired by the fantastic Core Data book by Florian Kugler and Daniel Eggert at https://www.objc.io/books/core-data/
//
// Stack.swift
//
import Foundation
import CoreData
class Stack {
static let sharedStack = Stack()
@calebhicks
calebhicks / DateHelpers.swift
Created October 21, 2015 17:13
Swift Date Helpers
extension NSDate
{
func isGreaterThanDate(dateToCompare : NSDate) -> Bool
{
//Declare Variables
var isGreater = false
//Compare Values
if self.compare(dateToCompare) == NSComparisonResult.OrderedDescending
{
@calebhicks
calebhicks / StorePurchaseController.h
Last active August 29, 2015 14:17
StorePurchaseController
//
// SSInAppPurchaseController.h
// SimpleStore
//
// Created by Joshua Howland on 7/2/14.
// Copyright (c) 2014 DevMountain. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
@calebhicks
calebhicks / ViewController.m
Created February 21, 2015 18:06
Using NSEnum to Label Sections
//
// ViewController.m
// UIColorCategory
//
// Created by Caleb Hicks on 2/21/15.
// Copyright (c) 2015 DevMountain. All rights reserved.
//
#import "ViewController.h"
@calebhicks
calebhicks / POTimer.h
Created January 21, 2015 02:55
POTimer
//
// POTimer.h
// Wired In
//
// Created by Caleb Hicks on 6/23/14.
// Copyright (c) 2014 Caleb Hicks. All rights reserved.
//
#import <Foundation/Foundation.h>
@calebhicks
calebhicks / Settings.m
Created November 9, 2014 19:31
Sample Settings Class
//
// Settings.m
// Sample
//
// Created by Caleb Hicks on 7/2/14.
// Copyright (c) 2014 Caleb Hicks. All rights reserved.
//
#import "Settings.h"
@calebhicks
calebhicks / image picker sample
Created September 6, 2014 17:54
image picker sample for ryan
// goes above interface and implementation
typedef NS_ENUM(NSInteger, ActionSheetButton){
ActionSheetFromLibrary,
ActionSheetTakePicture
};
#import <MobileCoreServices/MobileCoreServices.h>
// methods
@calebhicks
calebhicks / ParseAccountViewController
Created July 30, 2014 05:37
Parse Login/Signup View Controller Sample
//
// WIAccountTableViewController.m
// Wired In
//
// Created by Caleb Hicks on 7/17/14.
// Copyright (c) 2014 We Are Wired In. All rights reserved.
//
#import "WIAccountTableViewController.h"
#import <Parse/Parse.h>
@calebhicks
calebhicks / NTOnboardController.m
Last active August 29, 2015 14:04
Onboard Controller
//
// NTOnboardController.m
//
// Created by Caleb Hicks on 7/10/14.
//
// Readme: Subscribe to the notification for onboardedKey where you want to run something for onboarding.
// In your App Delegate or initial view controller, insantiate NTOnboardController and call -checkOnboarded.
// NTOnboardController will send the onboardedKey notification if the user has not been onboarded.
//
// Enjoy! Comment or @calebhicks with questions.