顯示具有 iPhone 標籤的文章。 顯示所有文章
顯示具有 iPhone 標籤的文章。 顯示所有文章

2012-05-09

Toggle network for iOS Simulator

Network fault-tolerant is important to asynchronous request. For iOS simulator can not toggle the network easily, because of its network ability is binding to its level. So that if you turn your host network off, then your iOS simulator network is also down. However, the host lost all network connection.

The firewall rule can help me do that smart, just block the site and port you would. You can use the below script:



You can change the host you want block in line 3 banHost.

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.

2012-01-10

UIScrollView 卡關排解

因為卡了三次,特別提醒自己。

若要做成兩頁,則 contentSize 要涵蓋兩頁寬度。

2011-11-18

Owned scan screen in ZBar

By studying the ZBar iPhone SDK document, I need to preview the camera on my own UIView, then, show the scanned image and text, that's all. All I need is to use ZBarReaderView and ZBarImageScanner, the mainly code snippet as below: The screen result like below:
Check out the full sample from github.