Skip to content

Instantly share code, notes, and snippets.

View toblerpwn's full-sized avatar

Sean Conrad toblerpwn

View GitHub Profile
@toblerpwn
toblerpwn / phoneUtilities.m
Created February 26, 2015 02:00
un-optimized phone number parsing code
/**
* Parses a string using the phone's carrier region (when available, ZZ otherwise).
* This uses the country the sim card in the phone is registered with.
* For example if you have an AT&T sim card but are in Europe, this will parse the
* number using +1 (AT&T is a US Carrier) as the default country code.
* This also works for CDMA phones which don't have a sim card.
*/
- (NBPhoneNumber*)parseWithPhoneCarrierRegion:(NSString*)numberToParse error:(NSError**)error
{
numberToParse = [NBPhoneNumberUtil normalizeNonBreakingSpace:numberToParse];
@toblerpwn
toblerpwn / CustomCollectionFlowLayout.h
Last active April 5, 2022 22:11
Sticky Headers at the top of a UICollectionView! -- // -- http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i -- // -- still needs work around contentInsets.bottom and oddly-sized footers.
//
// CustomCollectionFlowLayout.h
// evilapples
//
// http://stackoverflow.com/questions/13511733/how-to-make-supplementary-view-float-in-uicollectionview-as-section-headers-do-i
//
//
#import <UIKit/UIKit.h>