How to detect a jailbroken device programmatically?

Why is it necessary to detect a jailbroken device? Sometimes it’s necessary to restrict iOS app to run only on non-jailbroken devices. For example, it might be useful for media applications to make content piracy more difficult

How to use NSLog and print only for debugging?

Why NSLog and print are dangerous? Using NSLog and print are very popular logging mechanisms in iOS applications. However, in most cases logging to standard output is useful only for debugging applications and is useless in the released application.

TUTORIAL: Using UICollectionView with UICollectionViewFlowLayout

Showing data in a gridview is a beautiful and space-saving solution for graphical data (e.g movies, books, pictures etc). It has been popular long before Apple introduced UICollectionView in iOS 6 – a powerful and highly customisable way

UIPageViewController: how to get current page index and current visible controller?

UIPageViewController has the viewControllers array property. The currently visible viewController is always the first one in the viewControllers array. Example: Objective-C: Swift: The easiest way to get the current index is to have the itemIndex property in every content controller and just retrieve its

Comparison of system fonts on iOS 8 and iOS 9

Background Until iOS 9 the well known system font for apps was Helvetica Neue. In iOS 9 Apple changed the default font to San Francisco. For developers it’s not a big issue as long as system fonts

Private iOS API: Toggle location services programmatically

Use this snippet to toggle location services on your device programmatically. Snippet: Required entitlements: com.apple.locationd.authorizeapplications is required Download the example entitlement file from here: location.entitlements Compatibility: Confirmed working on jailbroken iOS 9.0  

Private iOS API: Toggle mobile data programmatically

Use this snippet to toggle mobile (cellular) data on your device programmatically. Snippet: Required entitlements: This requires com.apple.CommCenter.fine-grained entitlement on iOS 8.3+. Works without entitlement on iOS 8.1.2. Download the example entitlement file from here: cellular.entitlements Compatibility: Confirmed working on

Jailbreak development: Toggle airplane mode programmatically

There’re plenty of iOS development materials online, but not that much information regarding iOS jailbreak development. Therefore, I’m gonna share a bunch of code snippets to solve simple tasks in jailbreak development that I found myself useful

Private iOS API: Kill another application programmatically

Use this snippet to kill any application programmatically. Snippet: Required entitlements: This requires com.apple.multitasking.termination. Download the example entitlement file from here: killapp.entitlements Compatibility: Confirmed working on jailbroken iOS 8.1.2, iOS 8.4, iOS 9.0 Additional headers: Download BackBoardServices.h

Jailbreak development: Launch another application

There’re plenty of iOS development materials online, but not that much information regarding iOS jailbreak development. Therefore, I’m gonna share a bunch of code snippets to solve simple tasks in jailbreak development that I found myself useful