Image for post
Image for post

This is the first article of a series on how to automate iOS development and build a continuous deployment pipeline to Apple’s App Store Connect by using fastlane and GitHub actions. The goal is to combine these two tools and create a pipeline to automatically test, build and submit new versions, all done in the cloud.

Why do we want to automate our iOS app development?

Distributing a new app version can cause quite a headache. Often many individual steps have to be performed. Especially when multiple developers are working on an app at the same time, consistent processes are necessary.
App automation helps you to save time, reduce complexity and achieve a more reliable and consistent development process. …


Back in 2013 Apple introduced layout guides as part of the iOS 7 auto-layout. The `topLayoutGuide` and `bottomLayoutGuide` are properties of `UIViewController` and help you to safely align your view in the root view. Apple pays attention that your view doesn’t clip behind the status bar or navigation bar and thereby only uses the safe layout area. These two layout guides are now deprecated.

With the release of iOS11, Apple introduced new layout guides. This was mainly done due to the growing number of new iPhones and iPads with different screen sizes, aspect ratios and resolutions.

Image for post
Image for post

Safe Area Layout Guides to the rescue!

Image for post
Image for post

The Safe Area Layout Guides provides you with a variety of additional layout anchors.
If you use storyboards, simply activate the Safe Area Layout Guides option and you’re done. …


Introduction

Swift is heavily influenced by different programming paradigms from functional, imperative and object-oriented programming. This allows you as a developer to write very powerful and flexible code.

Protocol oriented programming in Swift helps you to bypass problems of object oriented-programming surrounding inheritance and their undesired complexity. But protocols still struggle with some compiler limitations when it comes to the usage of generic types. Type erasure is a pattern that can help us to bypass these limitations.

Protocol-oriented programming was featured by Apple on a WWDC 2015 presentation. …


This article explains Apple’s memory management in Swift. Even if it gets handled mostly automatic there are still some pitfalls. Choosing the correct reference type to describe the relationship between objects help you to avoid memory leaks.

Automatic Reference Counting

Apple’s implementation for automatic tracking and managing of memory usage is called ARC (Automatic Reference Counting). It automatically frees up the memory when objects aren’t referenced anymore. To know which objects are still in use it tracks the relationship between objects by increasing and decreasing a reference count. Objects can only be deallocated when the reference count is zero. ARC only applies to instances of Classes. Structs, Enums and Value-Types are not passed by reference. …


Image for post
Image for post

The guard statement has been implemented in Swift 2.0. Since then there are quite a lot rumor about its usage.

guard is not a general-purpose mechanism. This post wants to clarify some of these to help you understand WHEN and WHEN NOT to use this statement.

The basics of guard

First of all let’s clarify why guard was invented. Let’s take a look at the form of a guard statement.

guard condition else {
statements
}

To be honest it strongly looks like “if-else-statement” version without the if part. Perhaps that’s the reason for a mostly common misunderstanding that guard is only a reverse version of an if-statement. That would make guard quite useless because we could just negate the condition with our classic if-statement. …


With Android 6.0 Marshmallow (API 23) Google has finally included a new permissions model similar to iOS.

What’s new?

The new model is quite a change for app developers, because they have to handle permission requests at runtime and can’t rely on the fact that they are automatically granted by installing the app. In addition users can revoke them at any time.

This means you have to handle new situations:

  • your app still has to work even when the user denies the permission.
  • the user may revoke permissions later on.
  • you can explain yourself why your app needs the the requested permission.
Image for post
Image for post

Explain yourself

As a developer it is important to explain why you need the requested permissions. This helps to build up trust in your app. Major apps are doing this by using the two dialog system. …


Image for post
Image for post

Update (26 Jul 2017):

This how-to article should also work with the latest tvOS 11 beta versions.

I recently installed the public iOS 10 beta to try all of these fancy new features. Unfortunately I had to find out that remote controlling my homekit devices stopped working. Normally Apple TV acts like a hub for it when I’m on the way. After googling I found out that iOS 10 homekit handling was overhauled and requires an iPad or Apple TV with the latest beta installed to get it working again. …

About

Chris

I’m a Software Engineer from Düsseldorf. Passionate about programming languages & technologies with vocation for agile topics.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store