Under The BridgeUnder The Bridge

Musings
Core ML 3: How To Train Your Device Model

So things have certainly been moving right along since last we posted in 2017 in the iOS machine learning world haven’t they? Whilst we have our accustomed healthy skepticism of the frothily wild-eyed claims of The Universal Panacea Of Machine Learning you see floating around — 

CONCERNED PARENT: If all your friends jumped off a bridge, would you?

MACHINE LEARNING ALGORITHM: “YESSSS!!!!”

— this new being able to train models on our devices thing as well as all the other new stuff in CoreML 3 is a bit of a tipping point from “curiosity” to “something to think of serious applications for” we’d say!

If you haven’t taken much notice of the lingo so far and need some bringing up to speed, check out this course list from our friends at CourseDuck

The World’s Best Machine Learning Courses & Tutorials in 2020

And if you want lots and lots and lots of cross-platform machine learning resources, check out the awesome list

Awesome-Mobile-Machine-Learning

But we’re focusing on the device training today, and from what we can tell the reigning authority in that space is Matthijs Holleman’s blog, most notably the four piece series On-device training with Core ML completed last month:

  1. Introduction to on-device training
  2. Rock, Paper, Scissors (Lizard? Spock?)
  3. k-Nearest Neighbors
  4. Training a Neural Network

For sure read that whole series, and check out the rest of the blog too, we particularly liked

Core ML and Combine

And now you have a Combine processing chain that, every time you send it a UIImage object with imagePublisher.send(image), will automatically run a Core ML model on that image and process the results. Pretty cool!

And if you like those enough to pay for more, he’s got not just one but two books out: Machine Learning by Tutorials and Core ML Survival Guide — which we’re pretty sure makes him the go-to guru of iOS machine learning!

Other good introductions to new features and related goodies:

Working with Create ML’s MLDataTable to Pre-Process Non-Image Data

4 Techniques You Must Know for Natural Language Processing on iOS

Face Detection and Recognition With CoreML and ARKit, and Snapchat For Cats

Advancements in Apple’s Vision Framework: 2019 Year-in-Review

Text recognition on iOS 13 with Vision, SwiftUI and Combine

Build a Core ML Recommender Engine for iOS Using Create ML

MakeML’s Automated Video Annotation Tool for Object Detection on iOS

And here are some examples of classifiers and detectors we figure look useful, interesting, or just amusing:

Sound Classification on iOS Using Core ML 3 and Create ML

How to Build a Song Recommender Using Create ML MLRecommender

Building a Fake News Detector with Turicreate

Using Core ML and Natural Language for Sentiment Analysis on iOS

Detecting Pets with the iOS Vision Framework

iOS Build Cat Vs Dog Image Classifier Using Vision In 5 minutes

Photo Stacking in iOS with Vision and Metal

Using Sky Segmentation to create stunning background animations in iOS

And in that last category, our Machine Learning Rise Of Skynet Award goes to

Building a Face Detecting Robot with URLSessionWebSocketTask, CoreML, SwiftUI and an Arduino

Some time ago I created a little side project that involved an Arduino-powered servo motor that menacingly pointed at people’s faces with the help of CoreML, mimicking the Team Fortress 2 Engineer’s Sentry Gun. With iOS 13, I decided to re-write that using the new Socket APIs and SwiftUI…

“Mimicking,” he says now, but just you wait…

2020 iOS Conference Calendar

And as we begin another glorious year of iOS development, time to start planning our conference visits and talks for this year! Actually, it’s already closed for the earlier ones, so this year we’re going to expand our listings with the latest known CFP, so you can get an early start on planning next next year’s schedule too!

And if you haven’t given a talk before and don’t know where to start, we recommend you check this out:

How to deliver a talk at a programming conference

And if you’re really really serious about this conference thing, check out this dude:

What I’ve learned after sending 147 proposals to 36 conferences in a year

An inspiration to us all!

JANUARY: 

FEBRUARY:

  • 3: dotSwift — Paris, France — CFP
  • 12-13: MGS20 — San Francisco, US — see website 
  • 20-21: MobOS — Cluj-Napoca, RomaniaCFP closed 11.15

MARCH:

  • 2: QCon — London, UK — see website
  • 10-13: Appdevcon — Amsterdam, Netherlands — CFP closed 12.01
  • 12: T3chFest — Madrid, Spain — see website
  • 12-13: Mobile Trends — Krakow, Poland — see website
  • 18-20: try! Swift — Tokyo, Japan — CFP
  • 19-20: iOSCon— London, UK — CFP closed 11.06
  • 24-25: MacAdUK— London, UK — see website
  • 28: CodeFest— Novosibirsk, Russia — CFP
  • 30-April 1: MobileTechCon — Munich, Germany — see website

APRIL:

  • 9: QCon — Beijing, China — see website
  • 15-17: Devoxx — Paris, France — CFP
  • 16: MGS Singapore — Singapore — see website 
  • 27-29: GOTO Chicago— Chicago, US — see website 
  • 28-29: CodeMobile— London, UK CFP closed 11.15
  • ??: NSNorth— Montreal, Canada — see website 

MAY:

JUNE:

JULY:

AUGUST:

  • 13: MGS Canada — Toronto, CA — see website
  • 13: SwiftTO — Toronto, CA — see website 
  • 16-19: 360|iDev— Denver, US — see website
  • 31- Aug 1: try! Swift — New York, US — CFP
  • ??: SwiftConf — Cologne, Germany — see website 

SEPTEMBER:

  • 6-9: iOSDevUK— Aberystwyth, UK — see website 
  • 16-17: MGS Europe — Berlin, Germany — see website 
  • ??: NSSpain Logroño, Spain — see website 
  • ??:  /dev/world — Melbourne, Australia — see website 

OCTOBER:

  • 7-8: SwiftLeeds — Leeds, UK —  see website
  • 7-8: Canvas — Birmingham, UK — see website 
  • 8-9: UXDX — Dublin, Ireland — CFP 
  • 19-21: QCon Munich — Munich, Germany see website 
  • ??: FrenchKit — Paris, France — see website 
  • ??: #Pragma— Bologna, Italy — see website 
  • ??: GOTO Berlin— Berlin, Germany  see website
  • ??: Swift by Northwest— Portland, US  see website
  • ??: Mobiconf Krakow, Poland — see website 
  • ??: Server-Side Swift Copenhagen, Denmark — see website 

NOVEMBER:

  • ?? Swift HeroesTurin, Italy — see website 
  • ?? Swift AlpsCrans-Montana, Switzerland — see website 
  • ?? BA: SwiftableBuenos Aires, Argentina — see website 
  • ?? Swift & FikaStockholm, Sweden — see website 
  • ??: Mobile EraOslo, Norway see website 
  • ??: NSBrazilSão Paulo, Brazil see website 
  • ??: GOTO Copenhagen— Copenhagen, Denmark  see website

DECEMBER:

  • ??: heise MacDev— Karlsruhe, Germany  see website
  • ??: DevTernity— Riga, Latvia  see website 
  • ??: KotlinConf— Copenhagen, Denmark  see website 

 

Other resources to keep an eye on as the year progresses:

CocoaConferences

Find your next tech conference

Tech Events Online

The Best Swift and iOS conferences in 2020

The Complete List of Mobile (iOS and Android) Conferences in 2020

And a presentation tip for those code snippets!

Rx For Reacting To Combine-ations

Remember all the fuss about FRP back when Reactive Cocoa was all the new hotness? Kinda a good chuckle as 2020 approaches, isn’t it? Whilst its appeal turned out to be, as they say, selective, it and later FRP libraries such as RxSwift do have a following among those who don’t mind fighting the framework (have us tell you the story of the MQTT/Core Data/RAC stack we parachuted in to save the day for some time, if you want to see a visibly apoplectic troll, but hey, we managed to drag it across the liquidity event finish line, it’s all good) but general consensus is of the RxNot mindset that designing for maintainability is difficult enough already without seriously considering an architecture lacking any first party support and actively hostile to established platform paradigms…

… and then, all of a sudden! Here. We. Are. With. Combine:

Introducing Combine: Combine is a unified declarative framework for processing values over time. Learn how it can simplify asynchronous code like networking, key value observing, notifications and callbacks.

Combine in Practice: Expand your knowledge of Combine, Apple’s new unified, declarative framework for processing values over time. Learn about how to correctly handle errors, schedule work and integrate Combine into your app today.

Well, that’s certainly a great deal of previously passionate architectural debates rendered instantly obsolete, t‘isn’t it now? OK, Rx fans, take yourselves a victory lap for being all ahead of the game, grab yourself the RxSwift to Apple’s Combine Cheat Sheet and call it a day. The rest of us, well, time to get catching up now!

The first bookmark you need is this veritable epic of online documentation, by virtually unanimous agreement the most comprehensive and reliable source on this subject, not excluding Apple:

Using Combine by Joseph Heck

The book is available online at no cost. If you find the content useful, please consider supporting the effort with a purchase of the PDF or ePub version. The money collected for sales of this book will go to hiring editors (copyediting and technical editing), and if sufficient funds exist, hiring graphic design for diagrams. The content for this book, including sample code and tests, are sourced from the GitHub repository

However, if that’s a little intimidating to dive right into, here’s our picks for the best quick reads and views to get started:

SwiftUI & Combine: Better Together

Combine101 by a coauthor on the inevitable Wenderlich book

Swift Combine Framework Tutorial: Getting Started

Getting started with the Combine framework in Swift

A Crash Course in Combine

OK then, now that we’ve got some basic grounding, let’s take a look at some real example apps:

MovieSwiftUI: “SwiftUI & Combine app using MovieDB API. With a custom Flux (Redux) implementation.”

2048-swiftui: “2048 game using SwiftUI and Combine.”

CombineSlotMachine: “A basic slot machine game that demonstrates using the Combine framework in a UIKit app.”

And the next place to check out is the GitHub repos and Slack channel at

Combine CommunityCommunity projects & experimentations around Apple’s Combine framework

Note particularly awesome-combineCombineDataSources, and CombineCocoa.

And here’s a selection of the more interesting miscellaneous tips and tricks we’ve found:

Modern Networking in Swift 5 with URLSession, Combine and Codable

Hmmm, looks like CareKit uses Combine and CoreData as a local database…”

Error Handling in Swift Combine Framework

Error handling in Combine explained with code examples

Debugging with Swift Combine Framework

Combine debugging using operators in Swift

GRDBCombine: “A set of extensions for SQLite, GRDB.swift, and Combine”

Using Combine to Supplement Delegates With Publishers

CombineGRPC, a library that integrates Swift gRPC and Combine

Map vs FlatMap vs SwitchToLatest

Simple custom Combine operators + Building a custom `sample` operator

Creating a custom Combine Publisher to extend UIKit

Backpressure in Reactive Streams

Playing With Combine: Grid Layout in SwiftUI

Should be right up to speed making it through all that!

Black Friday Deals 2019

Seems like the Black Friday deals get a little earlier each year don’t they? In fact, we’re hurrying this post out because there’s eight hours fifty-three minutes left in a Black Friday deal that, in fact, ends Wednesday morning:

Black Friday 2019 — special offers on Pixelmator apps

Starting today, you can get the amazing Pixelmator Pro for 25% off. This discount will be available for a week, until December 3rd. In addition, Pixelmator Photo, our incredible photo editor for iPad, is completely free for 24 hours until 9am ET, November 27th. Spread the word!

So hurry on over to App Store on your iPad and grab that.then

… and speaking of free stuff, Packt has not only the usual discounts pretty much everybody that does e-learning has on but a completely free week as well, so if you haven’t got an account there now’s a particularly good week for it! 

… and speaking of e-learning, looks like the $99 a year subscription is going to be a regular thing over at 

raywenderlich.com Black Friday Sale: $99/year Subscriptions and More!

Of which there’s enough there this year on SwiftUI and Combine and all that new stuff we need to get up to speed on right quick that we finally figured it was likely worth shelling out for a subscription this year, recommend you seriously consider it too!

As usual, there’s a macOS / iOS developer focused deals repo up on Github

💰💸💰 Black Friday Deals 💰💸💰 

And Michael Tsai has deals on his own apps and a roundup here!

Black Friday 2019

This Xcode Goes To 11

Well, this has been a particularly exciting year on the Xcode front, hasn’t it?

  • Xcode 11 supports development with SwiftUI
  • SwiftUI live views and inline results in playgrounds are supported…
  • Xcode 11 adds support for Mac Catalyst to bring iPad apps to the Mac…
  • Xcode now supports creating and working with Swift packages, as well as adding, removing, and managing package dependencies…
  • An XCFramework makes it possible to bundle a binary framework or library for multiple platforms…
  • The new Metrics organizer shows battery life and performance analytics for your app to help you drive optimizations…
  • Xcode 11 supports the new Apple Development and Apple Distribution certificate types. These certificates support building, running, and distributing apps on any Apple platform…
  • Metal is available in iOS 13 and tvOS 13 simulators when running on macOS 10.15…
  • Introduces the ability to view inline code diffs for changes in the Source Editor…

Not sure “particularly exciting” covers it actually, this is the biggest Xcode update in the history of ever far as we can remember! Read the whole thing, and then the latest point release notes up to 11.3 Beta as we type this; and here’s a couple particularly good visual-enhanced tours of the new goodies:

Xcode: All the Way to 11

What’s new in Xcode 11? [Updated for 11.1 and 11.2]

Personally, this version of Xcode is a veritable benediction, given how many years we’ve been desperately looking forward to disposing of third party dependency managers…

Ready for Swift Package Manager?

Replacing CocoaPods with Swift Package Manager

Launching the SwiftPM Library + SwiftPM Catalog

…and once more being able to use workspaces as actual, y’know, workspaces. We’re not quite there with our latest project — the last serious roadblock is Firebase requiring binary framework support — but we are very close indeed! Mind you, we did have to do some considered refactoring to dispose of some pods that weren’t Pure Swift™, there’s a good if overly despondent summary of the various existing drawbacks here:

Dependency Heck

The state of iOS dependency management in 2019 is not great, and might get worse before it gets better…

Although we disagree with that completely, it’s orders of magnitude better than Xcode 10 even with the loose ends lying about still and getting better by the day, we say! In the meantime, aside from the third party dependency migration pains, even more important in the future is it’s much easier now to manage your internal dependancies and modularity with SPM:

Update your existing iOS Framework to Swift Package

Creating Swift Packages in Xcode + Editing A Swift Package

Managing dependencies using the Swift Package Manager

And that’s about enough for SPM for now. Next thing we’d like to highlight from that intro list is what drives that Metrics organizer, in case you’d overlooked it so far:

MetricKit

With MetricKit, you can receive on-device app power and performance metrics captured by the system. A registered app receives reports containing data about the previous 24 hours at most once per day…

Introduction at Improving Battery Life and Performance

NSHipster has a deeper dive in Metric​Kit

And for a really deep dive, check out MetricKit Internals!

SwiftUI and Catalyst are going to require some deep, deep diving of their own; for now, we’ll list miscellaneous other new and old Xcode tips we’ve collected since The Xth-Code Files: Xcode 10 Tips:

one small change for xcode, one giant leap for productivity

XCode allows you to take a snapshot of the state of the app you are developing and restore it later when you run the app or run the tests. Pretty cool!

Xcode 11 environmental overrides

Have you used the accessibility inspector to change the dynamic type size of your running app? Did you know you can do that directly from the debugger with Xcode 11? Even better, it allows you to override the interface style to quickly switch between light and dark modes…

Sherlock turbocharges your iOS simulator

There aren’t many times outside of WWDC where Apple developers see a new tool and immediately think “I need that in my life.” Sherlock by Inspired Code is one such tool: it injects itself into the iOS Simulator so that it can monitor views and adjust them in real time…

NSHipster’s simctl has Simulator tips you really want to know about

Better Storyboards with Xcode 11

Using Xcode Previews with existing views without using SwiftUI

Add a View <> ViewModel Jump To Counterpart

XCAssetsKit: “.xcassets parser written in Swift”

QuickLook plugin to visualize .car files (compiled Asset Catalogs)

Speeding up with Xcode Behaviors

Awesome-Xcode-Behaviors

The fastest way to Xcode: “Using the power of aliases in your Terminal”

Xcode: Basics of the four-block wonder aka “Navigate to Related Items”

37 Xcode Tips and Shortcuts to speed up your daily development

Unused images and resources clean up in Xcode

Unused localized strings clean up from a Strings file

Variable Width Strings

Where the &$!#% Is Localizable.Strings?!?

PoeditApp: “The fastest and most convenient way to translate apps & sites with gettext”

Periphery: “A tool to identify unused code in Swift projects.”

Streamlining your development workflow with Xcode Templates

ios-project-template: “iOS project template with fastlane lanes, Travis CI jobs and GitHub integrations of Codecov, HoundCI for SwiftLint and Danger”

Building Faster in iOS with Bazel

Project generation: Introduction to development of Tuist: “Bootstrap, maintain, and interact with Xcode projects at any scale”

And finally, to remind us that not quite everything is better these days:

Xcode​Kit and Xcode Source Editor Extensions

When we last wrote about extending Xcode in 2014, we were living in a golden age, and didn’t even know it…

Ah well. There’s still some good ones out there — our Most Useful™ Award goes to

SwiftMockGeneratorForXcode — An Xcode extension (plugin) to generate Swift test doubles automatically.

Check it out!

Savoring A Fifth Of Swift

So it’s been a year of veritably epistemic closure on the Swift front, hasn’t it? With ABI stability in Swift 5 Released! and module stability in Swift 5.1 Released! why, it’s a serious language finally! We kid, we kid. If anything, it’s become more whimsical, it seems, what with these modifiers and wrappers and the good lord only knows what springing up like weeds; our favorite so far on the whimsicality front is definitely this — 

@dynamicCallable Part 3: Mustacheable

After Shell commands as Swift functions and the Swift/ObjC Bridge, Part 3 in our quest to find a useful application for the Swift 5 Dynamic Callable feature: Mustache templates as a function (short: MaaF). This one may actually make some sense…

Although the competition is tough indeed. Let us take the ExpressibleByStringInterpolation feature, generally recognized as both beauty and super-powered as string interpolations go — but would it strike you that you can apply it to text stream decoding?

Regular Expression Decoder: A decoder that constructs objects from regular expression matches.

RegularExpressionDecoder provides a convenient solution to constructing Decodable objects from regular expression matches by automatically matching coding keys to capture group names. And it can do so safely, thanks to the new ExpressibleByStringInterpolation protocol in Swift 5…

And then of course there’s the new custom string delimiters

Say, for whatever reason, you were in desperate need of Bill the Cat ASCII art in your app. Maybe you were very drunk and had a bet. Maybe you were working with some kind of Unix awk client. I dunno. Let’s just start with the proposition that this was a real and meaningful challenge in your life.

… right, at that point we’re approaching the absurd, never mind the whimsical, and when you check out some of the new NSHipsters, well…

Identifiable: What constitutes the identity of an object?

Philosophers have contemplated such matters throughout the ages. Whether it’s to do with reconstructed seafaring vessels from antiquity or spacefaring vessels from science fiction, questions of Ontology reveal our perception and judgment to be much less certain than we’d like to believe…

… new we’re into the downright surreal. As well as circling back to our original assertion of epistemically closed Swiftness, to wrap that diversion up with a nice bow and call it a day.

Any-ways, as always if you want a quick reference of changes between any set of Swift versions check out

What’s new in Swift?

And for some more in-depth collections, check out

raywenderlich.com’s What’s New in Swift 5? and What’s New in Swift 5.1?

hackingwithswift.com’s What’s new in Swift 5.0 and What’s new in Swift 5.1

Swiftbysundell.com’s 5 small but significant improvements in Swift 5.1

The biggest explosion of creativity has definitely been around Property Wrappers: check out

Swift Property Wrappers “will have arguably the biggest impact on the «je ne sais quoi» of Swift in version 5.1 and beyond”

Property Wrappers in Swift 5.1 “or How Swift decided to become Java”

ValidatedPropertyKit: “Easily validate your Properties with Property Wrappers”

Burritos: “A collection of well tested Swift Property Wrappers.”

Property wrappers to remove boilerplate code in Swift

Better Codable Through Property Wrappers

Swift Dependency Injection via Property Wrapper

Stop force unwrapping IBOutlets with @Delayed

Atomic property wrapper in Swift

How can Property Wrappers and Function Builders be leveraged?

Speaking of those Function Builders, there’s some interesting projects out there looking at them for all DSLy things:

Create Your First Function Builder in 10 Minutes

NSAttributedStringBuilder: “Composing NSAttributedString with SwiftUI-style syntax”

Vaux: “A HTML DSL library for Swift”

marina: “Understanding SwiftUI by reimplementing it to render to HTML”

The Swift 5.1 features that power SwiftUI’s API

Here’a aome other articles with various tips, tricks, techniques, and reminders about applying various syntactic niceties that have accumulated over the last few Swifts:

Dynamic Member Lookup combined with key paths in Swift

Swift 5.1 introducing key paths suddenly makes dynamic member lookup support a lot more interesting. It allows us to easily access values from an instance while keeping our models structured and small…

The Law: Atomics are hard

Swift 5 turns on exclusivity checking by default. This has some interesting interactions with atomics, especially when running under the Thread Sanitizer (TSAN)…

Different flavors of type erasure in Swift

This week, let’s start by taking a look at what makes type erasure such an essential technique in Swift, and then move on to explore different “flavors” of implementing it — and how each flavor comes with its own set of pros and cons..

Phantom types in Swift

This week, let’s take a look at a technique that can let us leverage Swift’s type system to perform even more kinds of data validation at compile time — removing more potential sources of ambiguity, and helping us preserve type safety throughout our code base — by using phantom types…

Regular Expressions in Swift

You may be surprised to learn that you can — in fact — use regular expressions in a Swift one-liner: you just have to bypass NSRegularExpression entirely…

How to use Result in Swift

Result has four other methods that may prove useful: map(), flatMap(), mapError(), and flatMapError(). Each of these give you the ability to transform either the success or error somehow…

Let’s stop filtering for a second

We’ll cover for loops versus filtering, using removeAll(where:), contains(where:), allSatisfy(predicate:), reduce, first(where:), and Swift 5’s count(where:)…

Creating Thread-Safe Generic Values in Swift

Well, we’re still waiting for coroutines in Swift several years in. In the meantime, we have many concurrency mechanisms to choose from…

Ordered Collection Diffing + Swift 5.1 Collection Diffing

This change adds native support for diffing and patching functionality for various collection types. Many state management patterns can benefit from this improvement…

Making types expressible by string interpolation

We can now express our Path type using any kind of string literal — which makes it much more convenient to use, while still giving us all of the benefits of stronger typing.

Efficiently Mutating Nested Swift Data Structures

Yep, Array & Dictionary both support in-place mutations. For Dictionary, the recommended way is to use the defaulting subscript…

The power of subscripts in Swift

a new feature that’s being introduced as part of Swift 5.1 — static subscripts — which work much the same way as instance subscripts, only that they enable us to subscript directly against a type itself…

That’s about it for now — time to sit back and relax for a while is it?

On November 5, 2019 the swift-5.2-branch branch will be cut…

The innovation, it never stops!

UPDATES:

How Swift Achieved Dynamic Linking Where Rust Couldn’t

The Complete Guide to Property Wrappers in Swift 5

Offline Networking Management

So we have this new app that synchronizes all its operations with the website backend; and what, what, we ask rhetorically, do you figure the immediate cacophony of demand is?

Why, yes. Yes, it’s “Make checking in work offline!” Of course it is.

Now, 1.0 does cache all the last retrieved data so we’ve made a start on offline operation…

The Many Offline Options for iOS Apps

How to Design Offline-first Approach in a Mobile App

… so in this context, “work offline” is going to be defined as “queue database transactions to be applied to the server once connectivity is established,” as opposed to the current strategy of “call the API and do nothing if it fails”. We’re going to break that into a series of steps:

1) Currently our database transactions are UI state driven, with local changes applied only after online success, with a modal dialog forcing the user to wait. This is expedient, but annoying, and fallible.

So what we’ll do is encapsulate all our transactions into undoable objects, apply them to the local database immediately, and queue them for retry or cancel, ie. undo, if the online synchronization fails. Since having a functioning Undo implementation is a fine idea in any case, and helps us abstract out this rearchitecting nicely. If like us you haven’t implemented Undo recently (like in Swift at all) here’s some good tips on that:

Adding Undo and Redo support to iOS

UndoManager Tutorial: How to Implement With Swift Value Types

2) We’re going to need some awareness of when connectivity is established, to trigger applying these transactions to the server. Alamofire our networking layer has a simple one, implemented like thousands of others on top of ancient code. However, it has its issues … and there is a better option these days (iOS 12+): NWPathMonitor

Network Framework in iOS: How to Monitor Network Status Changes with sample code

Detecting Internet Access on iOS 12+ … now supported in Connectivity along with Solving the Captive Portal Problem. And backwards compatible Reachability support. So that looks like an excellent choice for network awareness needs!

And as an aside here, if you want to prompt people who turn off your app’s mobile data to turn it back on, check out

Handle disabled mobile data setting on iOS

However, for this particular application we can see that being a popular setting seeing as it’s all about foreign travel and all, so we’re not going to fuss about it as only working on wifi would be very likely indeed to be the users’ preferred mode of operation.

Speaking of operations, that brings us to:

3) A serializable and resumable and retryable queue for managing these operations

Right now we have a pretty simple asynchronous Operation wrapper for simple serial queuing of background data refresh operations, not completely unlike the network Operations described here,

Building a Networking Layer with Operations

Download files sequentially using URLSession inside OperationQueue

and as mentioned in the first point we’ll be making their local transactions undoable; but we’re going to need something a little more high powered than a stock memory OperationQueue to handle these, won’t we? Well, there are a number of possibilities mentioned that have various levels of support for persistence and awareness mentioned over in that promises roundup we did long before Combine was on the horizon, but here is one of particular interest:

OfflineRequestManager: Pod for Offline Network Request Management

OfflineRequestManager is a Swift framework for ensuring that network requests are sent even if the device is offline or the app is terminated.

OfflineRequestManager works by enqueuing OfflineRequest objects wrapping the network request being performed and observering the current network reachability using Alamofire. If the app is already online, then it will be performed immediately…

…! If a network-related error is passed into the completion block, then the OfflineRequestManager will retain the request and try again later. Other errors will by default remove the request from the queue, but there are optional delegate methods to allow for adjustment and resubmission if needed.

Realistically, there will likely be some data associated with the request. You also may want to be sure that the request is sent up even if the app is quit or (heaven forbid!) crashes…

Well, that would be … pretty much our exact feature requirements, actually! Hasn’t been updated in a year from Swift 4.0, so we’ll reimplement it in Swift 5.1 and add NWPathMonitor savviness and all, but a modernization is quite a less imposing task than designing from scratch, yes?

… and as a stretch goal, we’ll see about it taking advantage of background tasks too. You check out that new framework?

Managing background tasks with the new Task Scheduler in iOS 13

How to use BackgroundTasks framework to keep your iOS app content up to date?

So definitely, a superlatively up to date network request manager would also take advantage of that for recurring tasks!

Kowalski, Analytics!

So it’s been a little while since we last looked at analytics for your iOS app, and as it happens we have a new one just out that could use some sober second thought on its analysis strategy going forward; let’s take a look at that today, shall we?

Kowalski

 

First off, since you don’t have to do any work to get them it’s always a good idea to keep abreast of the latest developments in App Store Connect App Analytics – especially since there’s a bunch there that you can’t get with any other service! But, since you can’t report any custom events so they’re not very interesting development-wise, we’ll just remind you of the documentation and move right along, to consider in detail the current crop of services that are FREE! and UNLIMITED! that being the tier of service that us scrappy Indies are most interested in naturally!

So, last time we were checking out this analytics thing, the buzz was all about Fabric Answers

The best of Answers realtime analytics is now part of Firebase. New apps should use Google Analytics for Firebase…

Well then. How about that old standby for website centric organizations, Google Analytics? Oh, look they’re shutting that down too this Hallowe’en…

To use the latest generation of app reporting in Google Analytics, you’ll need to install the Firebase SDK. If you do not have a Firebase project, go to firebase.google.com to get started. Once you have completed the setup, return to Google Analytics…

Huh. OK, if you’re tied into the Google ecosystem, or anything that was good it acquired, it seems your choice is very clear. Singular, in fact!

Personally, we’d prefer not to be tied into the Google ecosystem, particularly if we’re not depending on it for anything besides analytics, so we’ll leave the Firebase option off the table as long as possible. Besides, it isn’t completely free, although the free usage limits are generous.

For completely free to the developer, Flurry appears to still be the leader in app support suites, with push and real time analytics and advertising and remote config and all sorts of other goodies these days; come a long way since Peter Farago stopped by to say thanks for our first note on it over ten years ago and now he’s “GM & VP Flurry” at Verizon with a job description of “Making Flurry awesome(r)” so that would seem to indicate that it’s weathered its various acquisitions nicely and continues to be a solid choice going forward.

While we were developing this last project, we tried out Visual Studio App Center and were reasonably pleased with it in general — we didn’t get around to creating any specific events, but even the default session monitoring of App Center Analytics is providing useful information — it’s still maturing, but if you’re tied in to Microsoft platforms or the slowly migrating HockeyApp, this is the support suite for you! Without that, it doesn’t have a compelling use case … aside from being Not-Google. Should you find that compelling.

Another option, if you have a Facebook app as pretty much everyone does these days, is Facebook Analytics where if you’ve linked in the Facebook SDK you can see session info in Facebook’s Event Manager things logged with App Events for iOS. Not actually real time though, and you don’t get the push notifications and crash reporting and so forth of the above suites, so picking one of them is probably what most of us will be interested in. 

Now, there are a veritable plethora of other analytics services out there that don’t meet the FREE! and UNLIMITED! test, any number of which may be suited enough to your particular needs to be worth their investment: here’s a few of the better recentish roundups we looked at putting together post, check them out if you have a budget:

The Apps Have Spoken: Top 13 iOS App Analytics Platforms [2019]

Top 11 Mobile App Analytics Platforms in 2019 (Pricing Included)

Top 20 Mobile App Analytics Tools: Which is the best one for you?

Top App Analytics Tools (2019)

And if you don’t want a service at all but want to host your own analytics, an excellent start on that is this:

Countly Community Edition
Your very own, self hosted and open source desktop, web, mobile analytics server and SDKs

At least it looks like it. We wouldn’t know. We’re not into self-hosting or rolling our own of anything we can possibly get away with not. But if you are, check it out and let us know how that goes for you!

And finally, whichever one of these alternatives you pick first, it’s a solid bet that you’ll be called on to change it at some point, because that’s just the way it always works, isn’t it? Here is a nicely elegant post about creating

A modular analytics layer in Swift

We are going to build a layer that avoids using a static API, puts any backend APIs behind a protocol, uses the power of Swift enums and pairs each event with the pieces of data it needs to contain.

More specifically it should:

  • Be easy to report new and existing events.
  • Allow the data be sent to whichever analytics backend we wish to use, even multiple.
  • Be testable and mockable, allowing it to be an injected dependency.
  • Allow events to be reported from anywhere in the app, but encourage best practices.
  • Have compile-time safety of events and their properties…

Sounds like just about the way we like to put service wrappers around our dependencies yep — so whatever analytics you choose, check that out!

UPDATES:

8 Critical KPIs for Your App and How to Track Them

Assertions in Production for tracking internal errors

SmartlookConsentSDK for getting user consent

Shipped! MTP: The Extreme Travel Club

Yippee! Been a while since the Trollwerks foundries stamped out a new piece of work, but we’ve got one for you today: The Official iOS App of MTP.travel, the Most Traveled People extreme travel club!

MTP: The Extreme Travel Club 

On the Road to Everywhere

MTPscreenshots

 

MTP is the first mobile app for members of Most Traveled People, the world’s largest competitive travel community. MTP ranks the world’s top travelers by gender, age group, and home location.

MTP members on the web have long enjoyed the ability to measure their lifetime travel accomplishments against their peers, and challenge themselves towards new travel accomplishments. The MTP mobile app imbues all of the features of MTP on the web with geo-awareness, enabling a whole new level of immersive interaction…

And it’s all Open Source to boot — check it out on Github if you’d like to check out how we did something, have a bug you’d like to fix, or would like to use the MTP API in your own apps!

So that’s what we’ve been pretty much heads down into in all our spare moments in the months since the last post here, haven’t spared much time to check the news and all; anything of any interest happen in the iOS development world since around April? Been pretty quiet, no doubt?

Oh. Oh, my.

Well, we do have some catching up to do then don’t we? Seems the effort we put here into checking out the odd corners of Storyboard handling we hadn’t had occasion to delve into previously has not aged well. Ah well, it’ll be shipping for iOS 11 for a while yet; time enough to shake the web and see what falls out with whatever this “SwiftUI” thing is everyone seems very excited about for our next project!

iOS UI/UX Design Workflows

It’s been pretty much a given for a while that Sketch is the go to UI design tool of choice for our pretty, pretty apps — but we’ve never examined alternatives suited to the indie developer, or indeed the full workflow; so let’s look at some options for that today!

As a starting point, here’s the Nodes Design Stack 2018 for their selections from end to end of the design process:

Sketch – Complete design tool for static mockups

The keystone of app design tools, when we asked one of our designers what projects they used Sketch for, the response was: “Pretty much all of them…”

Abstract – Version control and seamless collaboration on design files

…then Abstract came along, offering the type of collaborative platform that developers had found in tools like Github. Now, Sketch files can be added to a project, and team members can jump on board, editing and saving their progress into a master file.

InVision – Prototyping focused on flows

Another indispensable entry. InVision picks up where Sketch leaves off, with an emphasis on functionality. Once they’ve got their static designs done in Sketch, our designers move over to InVision and start making a dummy prototype with some of the transitions and animations that go beyond just visuals to define UX…

Zeplin – Design handoff for development

Once your prototype is up and running, and everyone’s happy with the result, it’s time to hand over the reins to your developers. That’s when we use Zeplin…

Principle – State based prototyping tool for complex interaction

Once you’ve designed your interface, Principle is there to build on animated and interactive elements. It’s particularly adept at refining micro interactions, which play a big part in the overall experience of using an app…

All well and good, probably most large shops would nod along with that as being a solid stack, but that’s a pretty large investment for a little indie shop that’s you and a designer … at most … right? So, what kind of alternatives might you consider? Well, there is one in particular that we’ve noted with interest:

Adobe XD

Adobe XD is made for designers like you, by designers like us. It’s the fastest way to design, prototype, and share any user experience, from websites and mobile apps to voice interactions, and more. And it’s free.

Adobe XD reimagines the way designers create experiences with fast, intuitive tools that get you into your designs and get out of your way. Power up prototypes with voice. Automatically resize elements for different screens. Create amazing animations between artboards without timelines. It’s everything you need for what’s next in UX — and it’s only in XD.

Switch from Design to Prototype mode in a click, then drag wires between artboards to turn your wireframes into interactive prototypes. Make changes on the fly and see them on your phone. Share auto-saved cloud documents securely with your team from anywhere—you can even edit them offline.

Well, that seems to cover the entire stack — and at a price of FREE?! Mind you, that is for only one actively shared project at a time … but you probably are working on only one at a time, and it’s probably a good bet that a designer you work with has an Adobe CC subscription, so that wouldn’t apply to them. And between integrating other Adobe tools plus your entire design workflow in one tool … seems pretty unbeatable to us, really. But let’s see what real designers think, shall we?

Will Adobe XD kill Sketch and InVision?

Prototyping, design, and animation all happen in one space when using Adobe XD, meaning testing and iterating on design happens easier and much faster. The design process is effortless, interactions and animations all happen in context of each other allowing these disciplines to become part of the design process, rather than independently of each other. This is very powerful and enables design to happen at the speed of thought.

The ability to move from wireframe to hi-fidelity prototyping, to developer handoffs in one piece of software shows how much Adobe focuses on workflows. By making workflows simple and easy, they are addressing some of designers biggest pain points — something only Adobe is truly equipped to do via its software ecosystem…

Read the whole thing if you have time, but TL;DR the claim is that things go exactly as we would expect! So at the very least, next time we have a greenfield project, we’re going to actively look for a designer to work with us on an XD workflow.

There’s many other tools out there — check out 18 Of The Best Tools For Mobile App Designers for instance — but we’re going to stick with Adobe XD being the next one we’re going to deep dive into, hey the price is certainly right!

 

So much for tools; now, let’s turn to the philosophy of UX design to give you some inspiration when you sit down with them! Here’s some excellent articles we’ve noted:

How to design an Apple Design Award-winning app

For a mobile designer, winning an ADA trophy with its crisp aluminium body and touch-activated glowing Apple logo represents the pinnacle of design achievement. In Apple’s own words, the ADA’s recognise the “creative artistry and technical achievements of developers who reflect the best in design, innovation and technology on Apple platforms.”

So what does it take to end up on the receiving end of one of these coveted accolades? As the creative director and co-founder of a successful app development agency, I was more than a little bit curious to find out…

How To Design Emotional Interfaces For Boring Apps

When your product deals with repetitive tasks, it’s hard to keep users excited about it. That’s where UI comes into play. Let’s talk about elements that make an interface more emotional…

How to simplify your design

Companies are in constant pursuit of building simple and usable products. More features, new technologies, and advanced capabilities but still in a lightweight and simple to use format. More often than not, making it simple is the hardest thing there can be…

10 cheat codes for designing User Interfaces

Design can’t be simply explained by colors, shapes, and text. It is a process that has a “Why” behind it, that whenever we create a text bigger, add a shadow, or change the color, there has to be a reason of why things have to be…

And finally, let’s turn to resources that give you some immediate practical help with your mock up designs and layouts, from ready to use UI kits down to individual assets, shall we?

Apple Design Resources

60+ great UI kits for iOS engineers

Sometimes we have to release products when we don’t have a nice design in place. We need to ship fast but keep good UX inside our iOS apps… Using prepared UI kits is done exactly for those moments!

UX Design Patterns for Mobile Apps: Which and Why

Mobile Patterns – UI UX Inspirational Gallery for iOS and Android

Mobile Design Patterns – Pttrns

Mobbin – Latest Mobile Design Patterns

User flow design inspiration

All in One Bookmark Links for Designer

UPDATES:

30 Things We Often Forget When Designing Mobile Apps

Dark Mode — Working with Color Systems

Health iOS app redesign sprint in 8 hours