Skip to content

Instantly share code, notes, and snippets.

View SuperY's full-sized avatar
🎯
Focusing

SuperY SuperY

🎯
Focusing
View GitHub Profile
@SuperY
SuperY / cellAutolayout
Created June 14, 2014 13:12
UITableViewCell Editing with Autolayout
- (void)awakeFromNib
{
[super awakeFromNib];
for (NSLayoutConstraint *cellConstraint in self.constraints)
{
[self removeConstraint:cellConstraint];
id firstItem = cellConstraint.firstItem == self ? self.contentView : cellConstraint.firstItem;
id seccondItem = cellConstraint.secondItem == self ? self.contentView : cellConstraint.secondItem;
@SuperY
SuperY / VersonContro.sh
Created April 25, 2014 13:13
Set Xcode build number by the building time
version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PRODUCT_SETTINGS_PATH`
version=`expr $version + 1`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH
#/usr/libexec/PlistBuddy -c \"Set :CFBundleShortVersionString $version\" $PRODUCT_SETTINGS_PATH 这行代码会让version也自增,一般不需要"
#From 'http://blog.csdn.net/kafeidev/article/details/8221273'
@SuperY
SuperY / version_by_git_commit_number.sh
Last active August 26, 2016 14:13
编译把Git的提交次数作为小版本号
#Git 版本数
VERSION_NUMBER=`git rev-list head | sort | wc -l | awk '{print $1}'`
#VERSION_HASH=`git rev-list head | head -1`
echo $VERSION_NUMBER
#echo $VERSION_HASH