Most of the text in our apps is baked in at build time, whether using strings
and stringsdict
files, or ideally the String Catalogs that were introduced with Xcode 15. However, on some occasions we may need to derive our text from a backend service, like if our app's content needs to be updated dynamically outside of our usual release cycle, or if we have user journeys based on external content hosted in a CMS. In these scenarios it is easy to lose the benefits of the platform provided localisation tooling. But with a little bit of work, we may continue to utilise NSLocalizedString
and maintain all of its benefits, even when deriving our strings from external sources. Today we will explore how to do this. Read more…
In the previous article we looked at the advancements that Apple has made in string localisation with the newly introduced String Catalogs for Xcode 15. Today we will look at how a new development tool, DJAStrings, makes using your app's localisations a breeze, with advanced code-completion and documentation features coming for free out of the box. Read more…
String localisation is the most important step to take for making your app accessible to users across the world. By translating your app's copy to multiple languages, you are able to provide the user experience that your customers expect in locations around the globe. Today we will take a look at how the process of string localisation has been managed on Apple platforms up until now, and then take a dive in to the advancements that have been made in Xcode 15. Read more…
Typography is a key design element across all Apple platforms, supported by customised fonts that are included specifically for user interfaces across iOS, macOS, watchOS and more. Starting with the San Fransisco typeface introduced in iOS 9, Apple has iterated on the standard font to include support for compressed and expanded variants, as well as introduced new typefaces to support monospaced, rounded, and seriffed fonts. As well as different visual styles, Apple platforms have a set of built in semantic font types, allowing fonts to be chosen based on their purpose, rather than specific point sizes. This allows fonts to automatically update to match the user's preferred text size settings - a feature known as Dynamic Type. It is this feature that has seen an update in iOS 17. Read more…
One of the areas where SwiftUI's declarative architecture shows its fundamental departure from UIKit's object-oriented approach is in the field of gesture handling. Today we will explore a particular difficulty caused by this, and a potential solution. Read more…
The user interface is the only part of your app that your users actually see and interact with, therefore it is important to make sure that it works. The world's greatest networking layer or expertly crafted data-storage solution will all be for nothing if your UI is broken. Despite this, view testing is often overlooked by developers, and for good reason - it can be far easier said than done, particularly given the tools specifically provided to do it. Today we will explore a solution that makes testing your UI quick and simple, using the tools you already use for testing the business logic of your app. Read more…
Back in 2015, Apple introduced Bitcode, which allows Apple to re-optimise an app's binary without the need to submit a new version. With bitcode enabled, your app is compiled and linked on the App Store during submission. Because of this, new dSYMs are generated after your app is submitted, which need to be uploaded to your crash-tracker of choice in order that crashes on customer devices can be correctly symbolicated. Today, we will be looking at how to upload these App Store dSYMs to Firebase via a job run using GitHub Actions. Read more…
With the advent of XCFrameworks in 2019, Apple made it simple to deliver a single framework package that catered for multiple platforms. However, producing a multi-platform framework still involved managing different per-platform configurations in the framework's Xcode project. This duplication of configuration could become repetitive and error prone, leading to potentially misconfigured framework versions. Now, thanks to Multi-Platform Frameworks in Xcode 13, this duplication problem has been resolved once and for all. Read more…
Pre-building your application's dependencies using Carthage and checking them in to source control has numerous advantages over not doing so. Local build times for developers as well as CI build times are vastly improved, we guarantee the consistency of built dependencies across build machines, and we don't have to dirty up our projects with a hideously over-engineered dependency manager like CocoaPods. However, doing so can lead to LLDB problems for projects developed on more than one machine i.e by development teams larger than one. Read more…
There are many accessibility options available today in iOS. Such technologies are not only to help those users with vision impairment, but also those with physical disabilities and hearing problems. To Apple's credit, many of these technologies can be utilised in 3rd party apps without any work required on the developer's behalf. However, for some accessibility options it is the developer's responsibility to take extra care when building their apps to ensure that all users can take advantage of what their applications have to offer. Today we will focus on one such accessibility setting in particular: "Reduce Motion". Read more…
Both UICollectionView
and UITableView
received significant updates at this year's WWDC, one of which was a new way to supply said views with the data that they display. This new data-providing functionality is afforded by two new classes - UICollectionViewDiffableDataSource
and UITableViewDiffableDataSource
. Most of the examples of using these new classes that Apple focussed on emphasised the benefits that apply to particularly complex collection and table views where the data being displayed is frequently changed, which in the past has been a source of headaches for developers when trying to update the view to match the new data. However, we also get worthwhile improvements to our code when using UICollectionViewDiffableDataSource
for simple collection views whose data isn't frequently updated in complex ways. Read more…
One way in which designers look to imprint branding on an app is to use a custom typeface throughout the user interface. Whilst this can give an app a distinctive look, it often comes at the expense of accessibility. This is because a key element of iOS's support for visually impaired users is the Dynamic Type system, which allows users to increase or decrease the size of text rendered across the system. Whilst it is easy for apps to support Dynamic Type when using the built-in system typeface, doing so with a custom font requires additional dev effort which is all to often overlooked. Read more…
Back in 2013 when Apple released iOS 7, they introduced a typographical system of semantically named fonts that allows app developers to produce text in their apps that is sized and weighted appropriately for any given context. Apps can specify what the text they display represents (a heading, title, body text etc) and iOS vends an appropriate font for the job. Read more…
As discussed last week in Supporting 3D Touch "Peek and Pop", implementing hardware specific features is a great way to differentiate your app and support the iOS ecosystem: Read more…
Supporting specific hardware features that ship with iOS devices is one of the primary benefits of developing completely native applications. By taking advantage of the latest hardware that Apple ships you make your app in to a first-class citizen on the platform. When more applications take the time to utilise these new hardware components it acts as encouragement for users to upgrade their devices, which supports the whole iOS ecosystem. It is also a great way to make your applications stand out from the competition. Read more…
Starting from where we left off last week (Continuity for Apple Watch and iPhone with Handoff) we will be adding Handoff support to our Counties sample application to allow transferring tasks between the iPhone and iPad. Before reading this post familiarise yourself with last week's as it provides the basis for the technique that will be discussed in this article. Read more…
Continuity was introduced with iOS 8 and Mac OS X Yosemite, and was primarily a method for first-party Apple applications to allow for transferring a task that was already in progress between an iOS device and a Mac. Very few third party appliations picked up support, so the feature only provided limited usability for most users. Read more…
The search functionality built in to iOS has for years been a weak point of the operating system, mainly due to being limited to only searching within first-party apps like Mail and Messages. This left the majority of users' content siloed in third-party applications, only to be retrieved by search functions included within those apps (if any). Read more…
In iOS 6 Apple released Auto Layout, which gave developers a declarative API for laying out user interfaces, saving us from hours of laborious and bug-prone setFrame:
coding. Since then, Apple has added complementary technologies such as Size Classes and UIStackView to aid the development of adaptive user interfaces (see Adaptive User Interfaces with UIStackView). Developing interfaces that adjust gracefully to different sized devices as well as features like Split-Screen Multitasking would be practically impossible without Auto Layout, therefore any modern approach to developing user interfaces must be based on Auto Layout. Read more…
Starting with iOS 8, Apple began encouraging developers to build "adaptive user interfaces" - interfaces that can happily scale from the iPhone 4s all the way up to much larger devices like the recently released iPad Pro. Technologies like Auto Layout made creating scalable interfaces much simpler, and iOS 8's UITraitCollection finally decoupled the device type (iPhone or iPad) from deciding how to layout an interface. With iOS 9, Apple introduced a new view class called UIStackView, which radically simplifies common layouts that would usually be accomplished with boiler-plate Auto Layout Constraints. This new view makes creating and maintaining interfaces much simpler as the nuts and bolts of Auto Layout are hidden away and the UI is described in a much higher-level, declarative manner. UIStackView also allows us to easily change our layout in order to be adaptive to size changes, as I will demonstrate with a small sample project that you can download here. Read more…