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
xcodebuild -exportArchive -archivePath $projectname.xcarchive -exportPath $projectname -exportFormat ipa -exportProvisioningProfile “Provisioning Profile Name” |
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
#import "MyViewController.h" | |
#import <AVFoundation/AVFoundation.h> | |
@interface MyViewController () | |
@property (strong, nonatomic) IBOutlet UIView *movieView; | |
@property (strong, nonatomic) AVPlayer *player; | |
@end | |
@implementation MyViewController |
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
- (UIImage*)screenshot | |
{ | |
// Create a graphics context with the target size | |
// On iOS 4 and later, use UIGraphicsBeginImageContextWithOptions to take the scale into consideration | |
// On iOS prior to 4, fall back to use UIGraphicsBeginImageContext | |
CGSize imageSize = [[UIScreen mainScreen] bounds].size; | |
if (NULL != UIGraphicsBeginImageContextWithOptions) | |
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0); | |
else | |
UIGraphicsBeginImageContext(imageSize); |
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)showFonts | |
{ | |
NSArray *familyNames = [UIFont familyNames]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames = [UIFont fontNamesForFamilyName:[familyNames objectAtIndex:indFamily]]; |
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
po [[NSString alloc] initWithData:[request HTTPBody] encoding:4] |
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
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" | |
find "${SRCROOT}" -ipath "${SRCROOT}/pods" -prune -o \( -name "*.h" -or -name "*.m" \) -not -path "${SRCROOT}/Libs/*" -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
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
+ (CGSize)sizeOfVideoAtPath:(NSString *)path | |
{ | |
NSURL *url; | |
AVAsset *asset; | |
NSArray *tracks; | |
url = [NSURL fileURLWithPath:path]; | |
asset = [[AVURLAsset alloc] initWithURL:url options:nil]; | |
tracks = [asset tracksWithMediaType:AVMediaTypeVideo]; | |
if(tracks != nil) |
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) pushViewController:(UIViewController *)viewController animated:(BOOL)animated { | |
newViewController.view.frame = //original frame | |
[self addChildViewController:newViewController]; | |
[self transitionFromViewController:oldViewController | |
toViewController:newViewController | |
duration:(animated?0.35f:0) | |
options:0 | |
animations:^{ |