Skip to content

Instantly share code, notes, and snippets.

View jzucker2's full-sized avatar

Jordan Zucker jzucker2

  • PubNub
  • San Francisco
View GitHub Profile
@jzucker2
jzucker2 / Golang.md
Last active May 23, 2017 05:41
Golang Notes
@jzucker2
jzucker2 / Podfile
Created November 30, 2016 00:20
Podfile for iOS 7
source 'https://github.com/CocoaPods/Specs.git'
# optionally complete and uncomment if compilation issues arise
# project '<path to project relative to this Podfile>/<name of project without extension>'
# workspace 'MyPubNubProject'
target 'application-target-name' do
# Should only use this with projects
# that must have a minimum deployment
# target of iOS 7
@jzucker2
jzucker2 / Podfile
Created November 30, 2016 00:18
Podfile for iOS 8 and up
source 'https://github.com/CocoaPods/Specs.git'
# optionally complete and uncomment if compilation issues arise
# project '<path to project relative to this Podfile>/<name of project without extension>'
# workspace 'MyPubNubProject'
use_frameworks!
target 'application-target-name' do
# Can only support iOS 8 or higher with frameworks,
@jzucker2
jzucker2 / Concurrency.md
Last active October 19, 2016 06:06
Notes about Concurrency
@jzucker2
jzucker2 / CoreDataNotes.md
Last active December 28, 2016 13:51
Core Data Notes

Notes about Text Programming on iOS

This is a collection of notes from the Text Programming Guide for iOS

Handling keyboard notifications in a scrollview:

// Call this method somewhere in your view controller setup code.
- (void)registerForKeyboardNotifications
{
    [[NSNotificationCenter defaultCenter] addObserver:self
@jzucker2
jzucker2 / Switch.swift
Created October 12, 2016 20:43
Swift Switch Statements
// Inspired by http://stackoverflow.com/questions/25724527/swift-test-class-type-in-switch-statement
for thing in things {
switch thing {
case 0 as Int:
println("zero as an Int")
case 0 as Double:
println("zero as a Double")
case let someInt as Int:
println("an integer value of \(someInt)")

Collection View Notes

This is a colection of notes about UICollectionView programming.

Deleting:

[self.collectionView performBatchUpdates:^{
   NSArray* itemPaths = [self.collectionView indexPathsForSelectedItems];
 
   // Delete the items from the data source.
@jzucker2
jzucker2 / AppDelegate10.m
Last active July 14, 2022 08:55
UserNotifications on iOS 10
// Make sure to include this at the top of AppDelegate.m
@import UserNotifications;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Check Notification Settings on launch
[[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
switch (settings.authorizationStatus) {
// This means we have not yet asked for notification permissions
case UNAuthorizationStatusNotDetermined:
@jzucker2
jzucker2 / APSReadReceipts.swift
Last active August 15, 2016 21:03
PubNub Push Read Receipts
import UIKit
import PubNub
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var client: PubNub?
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {