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
[UIView animateWithDuration:0.1 | |
animations:^{ | |
self.testView.transform = CGAffineTransformMakeScale(1.2,1.2); | |
} | |
completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.05 | |
animations:^{ | |
self.testView.transform = CGAffineTransformMakeScale(0.9,.9); | |
} | |
completion:^(BOOL finished) { |
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
# | |
# iOS 友盟发布渠道自动化脚本 | |
# | |
# - 在 Archive 的 "Post-action" 添加脚本去执行 "/bin/sh $SRCROOT/package.sh" | |
# - 确保在 "Provide build setting from" 选择了当前的 App | |
# - 在项目根目录($SRCROOT)添加 "iTunesArtwork" 文件(符合 App Store 提交要求的 512x512 px, PNG 格式) | |
# - 在下面 "" 设置你需要的发布渠道(空格分隔) | |
# - 在下面设置打包后的 ipa 的输出路径(可选) | |
# - 执行 "Product > Archive" | |
# |
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
//显示系统文件 | |
defaults write com.apple.finder AppleShowAllFiles -bool true | |
KillAll Finder | |
//隐藏系统文件 | |
defaults write com.apple.finder AppleShowAllFiles -bool false | |
KillAll Finder |
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
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
NSLog(@"ipad"); | |
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { | |
NSLog(@"iphone"); | |
} |
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
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) |
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
<?php | |
/** | |
* img.ly class for Kohana v3.0.x | |
* | |
* @author icyleaf <icyleaf.cn@gmail.com> | |
* @link http://icyleaf.com | |
* @version 0.1 | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class imgly { |
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*)toImage | |
{ | |
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0.0); | |
[self.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return img; | |
} |
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
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
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
if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { | |
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { | |
if (!granted) { | |
//检测到不可用 | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
//回到主线程做出相应提示 | |
}); | |
} | |
}]; | |
} |
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
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
NSSortDescriptor *descriptor1 = [[NSSortDescriptor alloc] initWithKey:@"endCalYear" ascending:YES]; | |
NSSortDescriptor *descriptor2 = [[NSSortDescriptor alloc] initWithKey:@"endMonth" ascending:YES]; | |
NSSortDescriptor *descriptor3 = [[NSSortDescriptor alloc] initWithKey:@"periodLength" ascending:YES]; | |
NSArray *sortDescriptors = @[descriptor1, descriptor2, descriptor3]; | |
[fetchRequest setSortDescriptors:sortDescriptors]; |
OlderNewer