UITableViewCell and model

The most common UI element in iOS is UITableView, and the most common task is to display the UITableViewCell using the model.


Although the title specifies UITableViewCell, but the problem involves other views (UICollectionView, custom view, …) as well
Continue reading

232 total views, 4 views today

Understanding weak self and strong self

Blocks are wonderful. To avoid retain cycle you often see the weakSelf – strongSelf dance like this

__weak __typeof__(self) weakSelf = self;
    self.block = ^{
        __typeof__(self) strongSelf = weakSelf;
        [strongSelf doSomething];
        [strongSelf doSomethingElse];

I bet you have read many articles out there about this and have some understanding. But here I want give some more note
Continue reading

244 total views, 4 views today

Force only one View Controller to be landscape

In my app, I only want portrait mode, except for the Movie Player View Controller which must be landscape
Here are the solutions together with my experience

Suppose MainViewController is the window.rootViewController and the MoviePlayerViewController is displayed via presentation
Continue reading

244 total views, 4 views today

Create Progress Slider in iOS

Progress Slider is very common in video player to indicate the current playback time and the playable duration (stream buffered)

Screen Shot 2014-06-26 at 12.52.47 AM

Here the slider minimum track color is blue, while the progress view underneath is red

How to do it

1. Add UISlider to your view (in Interface Builder or code)
2. Place an UIProgressView exactly behind your UISlider
3. Make the maximum track image invisible

- (void)viewDidLoad
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    [self.slider setMaximumTrackImage:[self transparentImage] forState:UIControlStateNormal];

- (UIImage *)transparentImage
    UIGraphicsBeginImageContextWithOptions((CGSize){ 1, 1 }, NO, 0.0f);
    UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext();

    return transparentImage;

I tried to set maximumTrackTintColor to clearColor but it didn’t work


1. UISlider with ProgressView combined

188 total views, 8 views today

Recommended iOS developers to follow on Twitter

Here is the list of iOS developers you should follow on Twitter, in no particular order

My list

Other lists

1. 30 Most Inspiring People to Follow On Twitter [For iOS Developers]
2. 40+ iOS Developers and Experts to Follow on Twitter
3. Who are good iOS developers to follow to twitter?
4. Raywenderlich tutorial team
5. objc.io contributors

340 total views, no views today

Recommended websites for online learning

Here is the list of useful online learning websites that I found useful

1. 2U
2. MIT Open Courseware
3. Udacity Recommended
4. Edx
5. Coursera Recommended
6. Microsoft Virtual Academy
7. Lynda
8. Code.org Recommended
9. TopCoder
10. TheNextWeb Academy
11. Memrise
12. MongoDB University
13. Google University Consortium Recommended
14. OpenStudy
15. Curious
16. CS50.tv
17. Codeschool Recommended
18. Berkeley Open Computing Facility
19. Team Tree House
20. Khan Academy Recommended
21. OpenYale Courses
22. The Open University

192 total views, no views today

Recommended Screencasts and Videos for iOS

Here is the list of Screencasts I found helpful during iOS development


1. NSScreencast
2. Quality Coding
3. Raywenderlich video


1. UIConf video
2. NSConference video
3. Çingleton video
4. AltConf video
5. WWDC video
6. Apple TechTalk video
7. Renaissance sessions
8. 360iDev video
9. Raywenderlich TechTalk video
10. Standford iPhone courses

192 total views, no views today

Recommended articles for iOS

Here is the lists of useful articles I found during iOS development

1. Learning SDKs
2. Leveling Up
3. Experimentally Yours
4. The Universal Troubleshooting Process
5. Thoughts on Debugging
6. Coders in the Hands of an Angry God

332 total views, no views today

Recommended Toolbox for iOS

Here is the list of iOS Toobox I found useful during iOS development


1. Recommended iOS libraries

Other Toolbox

1. What’s in my iOS Toolbox?
2. What’s in my iOS Toolbox? (2)
3. Resources for Mac and iOS Developers
4. The Valuable Toolset for iOS Development
5. iOS: Tools of the Trade
6. iOS Developer Tools
7. 217+ Mobile development resources
8. Worthy iOS libraries
9. Worthy iOS development tools
10. 75 Essential Tools for iOS Developers
11. iOS Developer Toolbox by defagos
12. Mac and iOS Development Toolbox
13. iOS-Toolbox by MartinKiss
14. Tools for Running an iOS Consulting Studio
15. iOS Dev Tools: The raywenderlich.com Podcast Episode 4
16. iOS Dev Tools
17. Cocoa Controls
18. Swift Toolbox

360 total views, no views today