Skip to content

Instantly share code, notes, and snippets.

@akinLiu
akinLiu / Universal
Created December 24, 2012 16:39
判断设备类型
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
NSLog(@"ipad");
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
NSLog(@"iphone");
}
@akinLiu
akinLiu / showsystemFile
Created December 18, 2012 07:47
显示 隐藏 mac osx 系统文件
//显示系统文件
defaults write com.apple.finder AppleShowAllFiles -bool true
KillAll Finder
//隐藏系统文件
defaults write com.apple.finder AppleShowAllFiles -bool false
KillAll Finder
@akinLiu
akinLiu / package.sh
Created June 26, 2012 17:08 — forked from icyleaf/umeng_ios_publish_channel_package_tool.sh
iOS 友盟发布渠道自动化脚本
#
# iOS 友盟发布渠道自动化脚本
#
# - 在 Archive 的 "Post-action" 添加脚本去执行 "/bin/sh $SRCROOT/package.sh"
# - 确保在 "Provide build setting from" 选择了当前的 App
# - 在项目根目录($SRCROOT)添加 "iTunesArtwork" 文件(符合 App Store 提交要求的 512x512 px, PNG 格式)
# - 在下面 "" 设置你需要的发布渠道(空格分隔)
# - 在下面设置打包后的 ipa 的输出路径(可选)
# - 执行 "Product > Archive"
#
@akinLiu
akinLiu / transform.m
Created June 18, 2012 05:59
放大缩小动画
[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) {