ALAssetsLibrary is deprecated. Now What?

When developing applications for iOS9.x you will get a warning about ALAssetsLibrary is deprecated and you should not use it. You are using Assets Library framework for some years, you learned everything about it but lets face it; ALAssetsLibrary is old. And now it left short when we talk about newer and modern iOS Photos features. Luckily, Apple gave us the Photos Framework with iOS 8. You can develop applications that using user’s photos with new Photos Framework.

Photos Library provides modern API’s to us for;

  • Request and check authorization from user
  • Retrieving user’s Albums
  • Retrieving photos, videos and metadatas
  • Editing and updating Albums
  • Editing and updating images and videos
  • Listening and reacting to changes
  • Caching images

Continue reading

Creating and Parsing URL’s with NSURLComponents and NSURLQueryItems

In traditional way, we are creating our API URL’s with formatted strings for some years. We have our format ready, setting parameters and create the URL. This way can be easy but if you do not check the format, you can create wrong URL’s easily. Also, something like this is not good for your eyes;
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"", version, userName, password, email, name, gender, isSubscriber]];

What is 3rd %@? Where is name‘s placeholder?

Creating URL’s from string might be working but is very fragile. If you forgot one & character, URL can be nil and your data will not send to server. In some scenarios, your application could be crashed.

Continue reading