swift Archive

TUTORIAL: Creating custom layouts for UICollectionView

In the previous part of this tutorial, basic usage of UICollectionViewFlowLayout was discussed.  UICollectionViewFlowLayout is a powerful and convenient way to create beautiful collections, but sometimes a more sophisticated approach is needed. This tutorial will show, how

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

Swift Application size – an unexpected pitfall of Swift

Recently I have successfully finished my first commercial Swift project. The last step was easy – create the production build. As I’m usually developing both for Android and iOS, it’s interesting to compare binary sizes for Android

iOS TUTORIAL: Creating a custom tabbar using Storyboard in Xcode

Custom tabbar Custom tabbar is a quite common task for an iOS developer. It’s normal –  the look and feel of the standard tabbar in iOS 7+ is quite good, but it doesn’t suite always into the app’s

IBOutletCollection in Swift?

When I tried to write IBOutletCollection in a Swift class, I was badly surprised that Xcode didn’t help me to write it. I was wondering if IBOutletCollection is supported at all in Swift and yes it is!

TUTORIAL: Creating an iOS App Extension to perform custom actions with Safari content

iOS App Extension From all the new features introduced in iOS 8, app extensions are definitely the most exciting ones, especially Action Extensions as they “help users view or transform content within the context of another app”

iOS Orientations: Landscape orientation for only one View Controller

Updated for iOS 9.3 in June 2016. In an iOS app, there can often be situations, when it’s necessary to support landscape orientation for only one view controller. All other views should be in portrait. A movie player or a gallery are nice

TUTORIAL: Draw a nice triangle view with a border using CAShapeLayer

Drawing a custom-shaped background view with a CAShapeLayer is an easy way, how to decorate the app and make its titles or headers more distinguished. The demo app The demo app for this tutorial contains only one view with a background image, a

TUTORIAL: Developing iOS Applications with iBeacons in Objective-C and Swift

Since Apple introduced iBeacons in iOS 7, those small cute devices have slowly, but confidently conquered museums, exhibitions, retail stores and universities. Apple uses iBeacons in their retail stores and the technology will definitely be getting even more