Implement the privacy-focused UIPasteboard API in your apps

Phone and laptop on table
Phone and laptop on table
Photo by Priscilla Du Preez on Unsplash.

With the introduction of iOS 14, Apple has given users new insight into what apps are doing. One key feature involves the often-overlooked pasteboard (or as most know it, the clipboard). Previously, any app could inspect the pasteboard contents whenever they wanted. Usually, this was for automatically extracting links or phone numbers, but it left the gates open for more malicious snooping.

Now, whenever an app inspects the value of the pasteboard, the user is notified by a temporary popup telling them that they have potentially given important information to this app.

How to add and respond to multiple complication types

Miniature figurines alongside Apple products
Miniature figurines alongside Apple products
Photo by insung yoon on Unsplash.

With watchOS 7, you can now add multiple complications to your app, exposing different types of views onto your data. Whilst the demo at WWDC 2020 showed how to add multiple complications, it did not detail how to handle interacting with them. For a good user experience when a complication is tapped, you want to open your app in a state that’s relevant to that particular complication.

This article will show you how to add different complications, update them when their descriptions change, and also respond to a particular complication type being tapped.

For our example, we’ll create a simple…

How to manage app development when working on your own

Hand holding a blank post-it
Hand holding a blank post-it
Photo by Kelly Sikkema on Unsplash.

Managing All the Things

As an indie developer, you don’t have anyone else to rely on to do certain tasks. You’re responsible for everything pre- and post-launch:

  • Idea creation — You have that little lightbulb moment and you need to get that down quickly and flesh out a few points you’re trying to achieve with it.
  • Functional aspects — As your idea grows, you start thinking about how people will use the app and what they will expect to be able to do.
  • Technical requirements — All the behind-the-scenes stuff you’ll need to implement and either re-use or research if it’s the first time…

Color pickers are used frequently in both iOS and Mac apps to differentiate folders/lists/items in Apple’s own app’s like Shortcuts and Reminders and many indie app’s offer similar functionality.

With SwiftUI 2 Apple added the ColorPicker control and you think great, one quick line of code and I have a color picker, but this isn’t constrained, users can pick any color imaginable, great for paint apps, not so great where we are trying to maintain a style to our app and deal with overlaid text or graphics.

Recently watching a non-tech family member discover they can customize their messaging app…

How to create snippets and how to share them across your machines or team

Neon sign of scissors.
Neon sign of scissors.
Photo by Jude Beck on Unsplash.

I recently started a new side project in a language (Perl) and framework (Logitech Media Server aka Slim Server) I’d never used before. This combination and my lack of experience meant there was no way of debugging. It was logging everything and muddling your way through.

Don’t panic! What I’m going to describe is completely agnostic to the language/frameworks used.

I use Visual Studio Code as my editor of choice for most things these days and I was getting fed up with typing the same old things over and over, so I looked into what options VS Code had to…

SwiftUI allows you to very easily create action sheets, those slide up dialog’s that almost fill the screen in iOS. There are many different ways to create these but most have subtle side effects, from un-clickable toolbar buttons to un-dismissable sheets. In this article I’ll detail how to reliably create multiple toolbar buttons that display multiple action sheets with buttons to dismiss them.

We are using functionality that is part of SwiftUI 2 supported by iOS 14 and up. If you are targeting anything lower this will not work.

Creating the sheet views

We’ll create the action sheet views first to stop Xcode continually…

Andrew Jackson

Indie app developer & solution architect at a global corporation.

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