2012-04-24

Git hooks Xcode version

Xcode has two fields to set version information to app. Version is for releasing number, build is for building number, find more information in Information Property List Key Reference.


Since Xcode 4.0 starting to support git version control, so that we could bind git tag and commit hash text with Xcode field. The steps in the pseudo-code are below:


  1. $ git commit -am "COMMIT LOG"
  2. trigger post-commit hooking
  3. Setting the tag number and new commit hash to plist.


In the real code is like below:


Put the code in a file to PROJECT_FOLDER/.git/hooks/post-commit, and make it executable.

2012-04-19

TEPopUp uses resizableImageWithCapInsets



TEPopUp show a pop-up view that stands on a translucent view, it can add something in the dialog view easily.


TEPopUp dialog use the api, UIImage resizableImageWithCapInsets:, it needs not a full size picture as its background picture, instead of a 28x28 pixel small picture. Obviously, this technical can reduce the who app size. The main core code cuts the area of pattern image, from the center point to right-bottom corner by UIEdgeInsetsMake. Then, the UIImage returns a new instance thats already expand image to appropriate size.