Category Archives: Objective-C

Objective-C: Generics

Re-watching the WWDC 2015, you probably noticed that it was all about Swift. That’s a given, with the release of Swift 2.0 back then, Apple announced a lot of additions to the Swift programming language such as protocol extensions, new error handling API and some additional syntax to name a few. That’s not the end … Continue reading Objective-C: Generics

iOS: Data Protection

iOS is based on the same core technologies as OS X, and benefits from years of hardening and security development. According to Apple’s iOS Security Guide, iOS security can be viewed in four layers: System architecture: The secure platform and hardware foundations of iPhone, iPad, and iPod touch. Encryption and Data Protection: The architecture and … Continue reading iOS: Data Protection

iOS: UIPasteboard, UIMenuController & UIMenuItem

There are times that you need to copy and paste items on your device, few words won’t be a problem but several paragraphs will. UIPasteboard is a built-in class that allows you to copy items to the pasteboard in iOS and paste it somewhere else. A user then selects an item (e.g., words, images, etc..) … Continue reading iOS: UIPasteboard, UIMenuController & UIMenuItem

iOS: NSLayoutConstraint

With the release of Xcode 5 and iOS 7 the need to learn, understand, and use auto layout increased. Auto layout were introduced in iOS 6.0; with auto layout, it is easier to design the interface for multiple screen sizes and also for multiple languages (e.g., Arabic, Japanese, Chinese, etc..). It’s not hard to design … Continue reading iOS: NSLayoutConstraint

iOS: NSDate & NSDateFormatter

One of the commonly used classes in building iOS apps are the NSDate (which allows us to deal with dates) and, of course, NSDateFormatter (which allows us to format the date and time to be printed). It is very likely that somewhere in your app, you may need to work with a lot of dates … Continue reading iOS: NSDate & NSDateFormatter

Clang Language Extensions: instancetype

Objective-C is a rapidly evolving language faster than many other. ARC, object literals, subscripting, blocks: in the span of just three years, this is just an example of how fast it grows. One of the latest addition to ObjC is instancetype. Clang adds a keyword instancetype that, as far as I can see, replaces id … Continue reading Clang Language Extensions: instancetype

iOS: AVPickerDimView

AVPickerDimView alpha AVPickerDimView is a simple class combination of UIView, UIActionSheet, and UIPickerView. Installation There are 3 ways to download and import the files to your project: Download: Using git subtree (recommended) git subtree add –prefix=AVPickerDimView –squash https://github.com/anjerodesu/AVPickerDimView.git master Using git submodule git submodule add https://github.com/anjerodesu/AVPickerDimView.git AVPickerDimView Download as zip Download the file: AVPickerDimView Project … Continue reading iOS: AVPickerDimView

iOS: NSString+HTMLHelper

NSString+HTMLHelper is a collection of methods that helps me deal with HTML tags and URLs. NSString+HTMLHelper Download Link GitHub Sample Usage: Please look at the demo project. It has sample codes on how to use the category. Methods: // Class Methods + (NSString *)mimeTypeFromURL:(NSURL *)pathForResource; + (NSString *)mimeTypeFromResource:(NSString *)pathForResource ofType:(NSString *)type; // Instance Methods – … Continue reading iOS: NSString+HTMLHelper

Snippets: NSLog and Macros Tips and Tricks

Tricks Some NSLog tricks I’m using on my escapade. These snippets are preprocessor macros that will help your debugging moments easier if not a lot. ALog This snippet will log everything every time you use it in a line. It will display the method name, the line number and the argument you gave. #define ALog(fmt, … Continue reading Snippets: NSLog and Macros Tips and Tricks

iOS: Venues using Foursquare API and iOS MapKit

Foursquare (foursquare) in their own words is a location-based mobile platform that makes cities easier to use and more interesting to explore. By “checking in” via a smartphone app or SMS, users share their location with friends while collecting points and virtual badges. Foursquare guides real-world experiences by allowing users to bookmark information about venues … Continue reading iOS: Venues using Foursquare API and iOS MapKit