2024

  1. Localising Externally-derived User Facing Strings
  2. 5 Nov

    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…

  3. Notarising Swift Package Development Tools for Distribution
  4. 8 May

    With macOS's introduction of Gatekeeper, binaries downloaded from the internet must be code-signed before they can be run. This presents a challenge for development tools that we may wish to distribute in the form of pre-compiled binaries. However, as we shall see in this article, distributing our code-signed binaries need not be too much of a headache. Read more…

2023

  1. Code Completion for Your App's Localisations with DJAStrings
  2. 3 Jul

    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…

  3. String Localisation Advancements in Xcode 15
  4. 27 Jun

    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…

  5. UIFont Updates in iOS 17
  6. 7 Jun

    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…

  7. Preventing Scroll Hijacking by DragGesture​Recognizer Inside ScrollView
  8. 23 May

    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…

2022

  1. Blazingly-fast User Interface Testing for Fun and Profit
  2. 31 Oct

    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…

  3. Uploading App Store dSYMs to Firebase with GitHub Actions
  4. 26 Apr

    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…

  5. Simplified Project Configuration Using Multi-Platform Frameworks in Xcode 13
  6. 13 Jan

    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…

2021

  1. Resolving LLDB "Couldn't IRGen Expression" Errors When Building XCFrameworks Using Carthage
  2. 26 May

    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…

  3. Recreating the iPadOS Settings App Navigation Bar Style
  4. 4 May

    With the release of iPadOS in 2019, Apple confirmed their commitment to treating the iPad as a serious computing platform in its own right. Additions to the user interface such as slide-over and split-view multitasking, App Exposé, redesigned sidebars, and Multi-Window UIs all demonstrate how Apple is focussed on transitioning iPad from a content consumption device to a "traditional computer" replacement for many users. As their technical underpinnings are identical, iPadOS is primarily differentiated from iOS via changes to the user interface of the operating system. Read more…

  5. Fixing Multi-Level UINavigation​Controller Menu Layouts in UISplitView​Controller on iOS 14
  6. 20 Jan

    With the release of iPadOS 14, Apple introduced a new sidebar style for app navigation, designed to provide quick access to top level collections of application content. Sidebars allow users to quickly navigate to the data that they care about, and also provide a user interface that easily adapts to macOS when built using Catalyst. Building a sidebar-style app starts with using a UISplitViewController, so let's begin by taking a look at the new APIs added in iPadOS 14 to facilitate this new kind of app design. Read more…

2020

  1. How to Use Module Resources in Objective-C SPM Packages
  2. 18 Aug

    With the release of Swift 5.3, Swift Package Manager took a big step towards being able to replace legacy dependency managers like Carthage and CocoaPods. As detailed in WWDC Session 10169 Swift Packages now support the bundling of resource files within a module. What's more, as this is a new compiler feature we don't have to wait to drop pre-iOS 14 support to take advantage of it - we can begin using it as soon as we start building our apps with Xcode 12. However, at first glance it may appear that Apple has neglected to add support for module resources in Objective-C package targets, preventing us from adding SPM support to older framework projects. Fortunately this is not the case, and resource bundles are fully supported for Objective-C targets. Read more…

  3. Respecting Accessibility in Custom View Controller Transitions
  4. 29 Jun

    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…

  5. The Code Review Secrets of High Performance Teams
  6. 26 May

    There is a common misconception in many software organisations that development teams can either focus on shipping features or maintaining a high-quality codebase - but that you can't do both at the same time. This simply isn't true. Read more…

  7. Building a Unit Tested, iCloud-backed Persistent Data Model with NSUbiquitous​KeyValueStore
  8. 2 Apr

    In modern iOS applications, users expect to be able to access their data across all of their devices. Thanks to the wide array of hardware produced by Apple, this can span from portable devices such as iPhone and iPad, all the way to our desktop computers and TVs. Many apps have their data supplied by back-end services, making shared access relatively trivial across multiple platforms. However, for apps that are responsible for managing data without such provision, we can build our own data stores on top of iCloud in order to serve our users with the information they expect on whichever device they choose to use. Read more…

  9. Advanced Multi-window UIs on iPadOS with Drag & Drop and State Restoration
  10. 2 Jan

    WWDC 2019 saw the introduction of a new operating system - iPadOS - for iPad. The first features of iPadOS listed on Apple's webpage that distinguish it from iOS are Slide Over, Split View, Apps in Multiple Spaces, and App Exposé. All of these features are powered by iPadOS's multi-window user interface, and today we are going to explore how to leverage these features in your apps using the powerful new "scene" APIs introduced with iPadOS. You will see that with a relatively small architectural change, your app will benefit from multi-window support. With a little bit more work, your app can support multiple scenes to support the various different workflows of your power users. Let's get started! Read more…

2019

  1. Simplifying UICollectionView Usage With UICollectionView​DiffableDataSource
  2. 11 Dec

    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 - UICollectionView​DiffableDataSource and UITableView​DiffableDataSource. 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 UICollectionView​DiffableDataSource for simple collection views whose data isn't frequently updated in complex ways. Read more…

  3. Synchronising CALayer and UIKit Animations
  4. 26 Nov

    When building custom views on iOS with advanced and complex animations, we often have to delve in to the lower-level CALayer and CAAnimation Core Animation APIs in order to gain full control over the animations that are produced. However, the drawback of this approach is that it means our animations exist outside of the bounds of UIKit's animation API, meaning our custom views cannot be animated using UIKit's simpler block-based animation API. Instead, we have to provide separate functions on our views to allow the calling code to trigger the animations that we have provided. This adds an extra layer of complexity to our custom view's API, and makes it difficult to synchronise animations between different views. Read more…

  5. Fixing "Image Events" AppleScripts Broken in macOS 10.15 Catalina
  6. 24 Nov

    Image asset resizing is a common operation carried out by developers when building iOS applications. Perhaps not all of the icons in your application can be represented using vector graphics, so 1×, 2×, and 3× representations need to be created to support various different Retina Display configurations. Also, at the time of writing, every application needs 18 differently sized variations of its icon to be provided in order to support notifications, the application's entry in the Settings app, and search results in the iOS spotlight UI. That's an awful lot of image resizing! Read more…

  7. UIFontDescriptor​.SystemDesign
  8. 7 Nov

    As of late, Apple has been making use of a wider range of fonts in the apps that it ships with iOS than it has in previous years. This began in iOS 12 when support for Apple Card was introduced in the wallet app. A rounded type face, similar to that used on Apple Watch, was used in several places throughout the UI. Read more…

  9. Creating Custom SF Symbols Using Affinity Designer
  10. 22 Oct

    From a design perspective, one of the most exciting changes introduced in iOS 13 was the inclusion of SF Symbols. Read more…

  11. Supporting Dynamic Type with Custom Fonts on iOS
  12. 19 Oct

    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…

  13. iOS Dynamic Type Without the Dynamism
  14. 10 Oct

    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…

2016

  1. Controlling Your App Using Speech
  2. 28 Nov

    Natural language user interfaces are everywhere in tech these days. Amazon wants to assist you in the home with Alexa in the Amazon Echo. Apple recently opened up Siri to third party developers to enable you to book rides, send messages, and more, just by speaking to your phone. Google and Microsoft are both in on the act too. The soon to be released AirPods allow for a simple double tap of an AirPod to begin speaking to Siri. Read more…

  3. Spotlight Search Enhancements in iOS 10
  4. 9 Nov

    Back when iOS 9 was released, Apple made great advances to make the system Spotlight search more useful to users by allowing third-party apps to integrate their data with the Spotlight database (for more details, see Indexing App Content with Core Spotlight). By allowing your application's data to be indexed, you can increase engagement with your app by allowing users to find their content in one convenient location. Read more…

  5. Introducing Iris - Pro Camera Control for iOS
  6. 2 Nov

    tl;dr I've released a new camera app for iPhone and Apple Watch, and you can download it for free on the App Store. Read more…

  7. Supporting 3D Touch Application Shortcuts
  8. 4 Mar

    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…

  9. Supporting 3D Touch "Peek and Pop"
  10. 26 Feb

    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…

  11. Easier Swift Debugging with Mirrors
  12. 18 Feb

    As we all know, Swift is the future of iOS app development. First and foremost, Swift has been designed to be easy to learn, concise, and fast. With the release of Swift 2, Apple addressed many of the issues developers faced with Swift 1, and refined the language with syntax improvements, protocol extensions, and a modern approach to error handling. With these additions, along with the REPL and Xcode Playgrounds, now is a great time for anyone still on the fence about Swift to dive in and start seeing what all of the fuss is about. Read more…

  13. Continuity for iPhone and iPad with Handoff
  14. 12 Feb

    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…

  15. Continuity for Apple Watch and iPhone with Handoff
  16. 4 Feb

    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…

  17. Indexing App Content with Core Spotlight
  18. 28 Jan

    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…

  19. App Design on a Budget Part 2: Animation
  20. 21 Jan

    A great user interface doesn't just look great - it has to feel great too. In Part 1 we looked at ways to develop the look of a user interface, but this only considered the static design. Today we will focus on how to refine our UIs to provide a great dynamic user experience. Read more…

  21. App Design on a Budget Part 1: Tools
  22. 14 Jan

    For indie app developers, user interface design can often be the hardest part of developing an app. There is no formal logic, or provably correct way to go about designing a UI, so creating compelling user interfaces that are beautiful (and hopefully delightful) as well as functional can be a tough hurdle to clear. Worst of all, our instinct to get stuck in and start coding is easily the most inefficient way to go about testing different ideas of how a user interface should look and feel. Read more…

  23. Modern View Layout on iOS 9
  24. 7 Jan

    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…

2015

  1. Unit Testing with UIGesture​Recognizer
  2. 30 Dec

    With Xcode 7, Apple introduced UI Testing to make it easy to add black-box user interface tests for our apps. While these allow us to automate much of our UI testing, the black-box nature of this environment means that we cannot test the underlying code in our applications while running these kinds of tests. If we want to do that, we need to rely on good old-fashioned unit tests. Read more…

  3. Introducing New Features to Users
  4. 24 Dec

    Adding new features to an app is part of the standard app-update process. By giving users updates containing new functionality, we make our apps more useful and we stay competitive. However, one downside is that with each new feature we add we have to add more UI. More UI brings more complexity, which can make our apps harder to use. What's more, if our apps become difficult to use, users may give up on them entirely. Work we've done to make our apps more useful ends up driving users away - not what we wanted! Read more…

  5. Adaptive User Interfaces with UIStackView and UICollectionView
  6. 17 Dec

    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…

  7. Your Watch Complication Might Be Broken
  8. 10 Dec

    The issue described in this blog post has been resolved as of iOS 9.3 beta 6. Read more…