This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For actual device testing, disabled the script running by uncomment following two lines. | |
########################################################################################## | |
#echo "SCRIPT RUNNING ABORTED. COMMENT THIS OUT TO GENERATE UNIVERSAL FRAMEWORK" | |
#exit 0 | |
########################################################################################## | |
set -e | |
set +u | |
# Avoid recursively calling this script. | |
if [[ $SF_MASTER_SCRIPT_RUNNING ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################################## | |
# Fix Symlinks | |
# | |
# Usage : Copy this file into the Framework directory, | |
# Execute it passing the Framework Name in argument. | |
# | |
########################################################## | |
if [ -z $1 ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)fillProfile | |
{ | |
RevMobAds *revmob = [RevMobAds session]; | |
[[FBRequest requestForGraphPath:@"me?fields=id,gender,age_range,birthday"] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { | |
if (error == nil) { | |
NSString *gender = [result objectForKey:@"gender"]; | |
if (gender != nil) | |
revmob.userGender = [gender isEqualToString:@"male"] ? RevMobUserGenderMale : RevMobUserGenderFemale; | |
NSNumber *minAge = [[result objectForKey:@"age_range"] objectForKey:@"min"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
NSCharacterSet *cs = [[NSCharacterSet characterSetWithCharactersInString:@"0123456789+-"] invertedSet]; | |
NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs] componentsJoinedByString:@""]; | |
return [string isEqualToString:filtered]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PORTRAIT | |
---------------------------------------------- | |
iPhone Retina HD 5.5 1242×2208 | |
iPhone Retina HD 4.7 750×1334 | |
iPhone Non Retina 3.5 320 x 480 | |
iPhone Retina 3.5 640 x 960 pixels | |
iPhone Retina 4 inch 640 x 1136 pixels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameOrOrientationChanged:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameOrOrientationChanged:) name:UIApplicationDidChangeStatusBarFrameNotification object:nil]; | |
- (void)statusBarFrameOrOrientationChanged:(NSNotification *)notification | |
{ | |
/* | |
This notification is most likely triggered inside an animation block, | |
therefore no animation is needed to perform this nice transition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//setting up the first video based on previous recording | |
CMTimeRange videoDuration = CMTimeRangeMake(kCMTimeZero, [self.previousRecording duration]); | |
AVAssetTrack *clipVideoTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; | |
AVAssetTrack *clipAudioTrack = [[self.previousRecording tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; | |
[compositionVideoTrack insertTimeRange:videoDuration ofTrack:clipVideoTrack atTime:nextClipStartTime error:nil]; | |
[compositionAudioTrack insertTimeRange:videoDuration ofTrack:clipAudioTrack atTime:nextClipStartTime error:nil]; | |
//our first track instruction - set up the instruction layer, then check the orientation of the track | |
//if the track is in landscape-left mode, it needs to be rotated 180 degrees (PI) | |
AVMutableVideoCompositionLayerInstruction *firstTrackInstruction = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL) validateEmail: (NSString *) candidate { | |
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; | |
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; | |
return [emailTest evaluateWithObject:candidate]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |