Skip to content

Instantly share code, notes, and snippets.

View cjazz's full-sized avatar

Adam Chin cjazz

View GitHub Profile
@cjazz
cjazz / showSizes.swift
Created May 25, 2023 01:16 — forked from swiftui-lab/showSizes.swift
A debugging modifier for SwiftUI views (showSizes)
// Author: SwiftUI-Lab (swiftui-lab.com)
// Description: Implementation of the showSizes() debugging modifier
// blog article: https://swiftui-lab.com/layout-protocol-part-2
import SwiftUI
struct MeasureExample: View {
var body: some View {
VStack {
@cjazz
cjazz / longPressGestureForUITableViews.m
Last active December 7, 2016 04:30
Cool long press gesture using CGAffineTransformMakeScale simulate moving tv cells up or down in a UITableView
#pragma mark - Long press to move cells up and down
- (IBAction)longPressGestureRecognized:(id)sender {
UILongPressGestureRecognizer *longPress = (UILongPressGestureRecognizer *)sender;
UIGestureRecognizerState state = longPress.state;
CGPoint location = [longPress locationInView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
@cjazz
cjazz / LoginFireBaseVC.m
Created November 23, 2016 17:42
LoginFireBaseVC - Implements Logging auth for Firebase : Facebook/Twitter & set Email/PW. Also, captures email address & profile images
//
// LoginVC.m
//
// Created by Adam Chin on 7/14/16.
//
// This implementation is an example of Login Methods to Firebase
// Google's MBaaS. It includes login auths to Facebook and Twitter
// as well as Email Logging.
//
// Client Requirements:
@cjazz
cjazz / testCollectionVC.m
Created November 1, 2016 19:22
UICollectionView - demoing 2 horizontal UICollectionViews with a top profile image
//
// testCollectionViC.m
//
// Created by Adam Chin
// Copyright © 2016 HushBox. All rights reserved.
//
#import "testCollectionVC.h"
#import "CoreDataController.h"
#import "CoreDataHelper.h"
@cjazz
cjazz / Reachability.h
Last active October 30, 2016 21:37
Reachability Manager to use with Tony Millions Reachability
/*
Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@cjazz
cjazz / TwitterAPIBundle.m
Last active October 30, 2016 21:18
Helper to get Twitter app creds from Info.plist
//
// TwitterAPIBundle.m
//
// Created by Adam Chin on 10/26/15.
//
#import "TwitterAPIBundle.h"
static NSString * const TwitterAPIKey = @"TwitterAPIKey";
static NSString * const TwitterSecret = @"TwitterSecret";
@cjazz
cjazz / TwitterAPIBundle.h
Created October 30, 2016 21:17
Helper to get Twitter app creds from Info.plist
//
// TwitterAPIBundle.h
//
//
// Created by Adam Chin on 10/26/15.
#import <Foundation/Foundation.h>
@interface TwitterAPIBundle : NSObject
@cjazz
cjazz / GlobalUI.m
Created October 30, 2016 19:59
A Collection of common UI methods
//
// GlobalUI.m
//
// Created by Adam Chin on 7/7/15.
//
#import "GlobalUI.h"
@implementation GlobalUI
@cjazz
cjazz / LoginVC.m
Created October 30, 2016 19:50
Auth0 + Facebook & Twitter
//
// LoginVC.m
//
// Created by Adam Chin on 7/14/16.
// The following is an example of Auth0
// Logging into Email/Social services with a custom UI
// Interface Builder requirements are:
// 2 Social buttons
// Email/Password UITextFields
// button to fire didTapEmailLogin
@cjazz
cjazz / SetRequiredTextField.h
Created January 2, 2016 15:04
Set Required Text Fields - Red
// Set Required TextField red on the outside
// Simple Implementation:
// 1. Set a property for UITextField, ex: textField
// 2. in ViewWillAppear call [self setRequiredTextFieldStyle:self.textField];
-(void)setRequiredTextFieldStyle:(UITextField*)textField
{
textField.layer.shadowColor = [UIColor redColor].CGColor;
textField.layer.shadowRadius = 4.0;
textField.layer.shadowOpacity = 0.9;
textField.layer.shadowOffset = CGSizeZero;