Recommended resources for learning Swift

These resources are helpful to me, and to you, too :)

Apple Developer

1. Swift
2. Swift Blog
3. Swift Resource This lists the WWDC Swift videos, books, standard library reference
4. Welcome to Swift
5. The Swift Programming Language on iOS Developer Library
6. Swift on DevForums

Book

1. The Swift Programming Language
2. Using Swift with Cocoa and Objective-C

Raywenderlich

1. Swift Language FAQ
2. Swift Cheat Sheet and Quick Reference
3. Swift Language Highlights: An Objective-C Developer’s Perspective
4. Video Tutorial: Introduction to Swift Part 0: Introduction
5. Video Tutorial: Introduction to Swift Part 1: Variables and Constants
6. Video Tutorial: Introduction to Swift Part 2: Strings
7. Video Tutorial: Introduction to Swift Part 3: Arrays
8. Video Tutorial: Introduction to Swift Part 4: Dictionaries
9. Video Tutorial: Introduction to Swift Part 5: Control Flow
10. Video Tutorial: Introduction to Swift Part 6: Functions
11. Video Tutorial: Introduction to Swift Part 7: Classes

Others

1. Swift in flux
2. We heart Swift
3. Learn Swift
4. SwiftDevs
5. Trending Swift repos on Github
6. 100 days of Swift
7. Most voted Swift questions on Stackoverflow

348 total views, 36 views today

Posted in iOS Tagged with: ,

Design issues in Swift language’s arrays

Forked from https://yinwang0.wordpress.com/2014/07/13/swift-array. The original post is not found, so I keep a copy here

Read more ›

340 total views, 48 views today

Posted in iOS Tagged with:

Property in protocol

A protocol is a group of related properties and methods that can be implemented by any class. In iOS I can have a protocol that declares a property

@protocol MyProtocol <NSObject>

@property (nonatomic, strong) NSString *name;

@end

Read more ›

964 total views, 388 views today

Posted in iOS Tagged with: , , , ,

Custom ValueTransformer in Mantle

https://github.com/Mantle/Mantle/issues/350

332 total views, 32 views today

Posted in iOS Tagged with: , ,

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.

Prototype-cell-custom-design

Although the title specifies UITableViewCell, but the problem involves other views (UICollectionView, custom view, …) as well
Read more ›

544 total views, 28 views today

Posted in iOS Tagged with: , , , , , ,

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
Read more ›

680 total views, 24 views today

Posted in iOS Tagged with: , , , , ,

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
Read more ›

632 total views, 32 views today

Posted in iOS Tagged with: , , ,

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();
    UIGraphicsEndImageContext();

    return transparentImage;
}

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

Reference

1. UISlider with ProgressView combined

444 total views, 16 views today

Posted in iOS

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

572 total views, 24 views today

Posted in iOS Tagged with: , ,

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

452 total views, 16 views today

Posted in Programming Tagged with: , , ,