Under The Bridge Under The Bridge

Category: Programming
AR Reality Check: RealityKit

So it’s been a while since ARKit came out, and the App Store was briefly flooded with novelty apps, and we went off giving speeches on it and all, and that was all very exciting wasn’t it? Until the excitement of watching floating sharks and all died down, and interest is at a pretty low level these days. Incorrectly, we think, you should be keeping an eye on it, as Apple’s ongoing investment in is just too big to be purely a side hobby — as was perceptively noted here by Mr. Dent Reality:

Apple Restarted Their AR Platform Strategy, and Nobody Noticed

It’s a significant move for Apple to leave behind a two-year old platform, and replace it with something completely new. They’ve obviously made that decision with a long-term view — SceneKit had some downsides, and they thought a new framework would give them a better foundation for the future.

With that in mind, it’s interesting to think about what RealityKit brings — an AR-only framework, with high-performance, and a modern Swift-only API that regular developers can use. I don’t like to speculate too much, but I’d imagine that this is Apple’s path towards wearable AR. And features that we’re seeing emphasised today, such as anchored content, shared experiences and Quick Look — all now supported through RealityKit — could be a primary part of a future wearable product…

Well, he’s certainly doing his part … and much more than his part, check out

How to Build Really Compelling AR Experiences

Complete with open source MuseumAR – “A museum AR experience and simulator.”

(Museum apps are a commonly mooted use case — also check out Building a Museum App with ARKit 2!)

The most comprehensive overview of the new stuff we’ve seen is this series, annotating the RealityKit-CardFlip example game:

Also rather interesting is the effort Apple’s going to to make this technology user accessible. Remember last year,

How USDZ Enables New Experiences for ARKit

Creating an Animoji-Style 3D Character to Use With TrueDepth

All very interesting, but a lot of work … until now:

Introducing Reality Converter

The new Reality Converter app makes it easy to convert, view, and customize USDZ 3D objects on Mac. Simply drag-and-drop common 3D file formats, such as .obj, .gltf and .usd, to view the converted USDZ result, customize material properties with your own textures, and edit file metadata…

Which makes it even easier to create experiences like discussed here:

How to make an augmented reality decorating experience app with AR Quick Look

Here’s some more interesting articles on using CoreML and Vision to make your AR apps cleverer:

Enhancing ARKit Image Detection with CoreML

Face Detection and Recognition With CoreML and ARKit

How to Detect and Track the User’s Face Using ARKit

And although it could use some up to dating, check out Awesome-ARKit as well!

OSS Internships: Summer Of Code 2020

All you student developers enrolled at some kind of institution of higher education, it’s That Time Of Year Again to start planning for what you’re doing this summer — specifically, if you take our advice for how to start building a career, you’d be well advised indeed to apply next month for the opportunities here:

Google Summer of Code 2020 mentoring orgs announced!

We are delighted to announce the open source projects and organizations that have been accepted for Google Summer of Code (GSoC) 2020, the 16th year of the program!

After careful review, we have chosen 200 open source projects to be mentor organizations this year, 30 of which are new to the program. Please see the program website for a complete list of the accepted organizations.

Are you a student interested in participating in GSoC this year? We will begin accepting student applications on Monday, March 16, 2020 at 18:00 UTC…

The full list of organizations is here:

ORGANIZATIONS; Find an organization to submit a proposal to

Naturally, we recommend that your first stop should be of course swift.org:

Swift to participate in GSoC 2020!

The official application to GSoC starts on March 16. Before then, we encourage all prospective participates to socialize their ideas on the respective Development forum categories. Please tag all posts with the GSoC 2020 tag so that they are easily discoverable by others (e.g., students and mentors) interested in GSoC.

There are several open project ideas available on Swift.org — but potential projects do not need to be restricted to these ideas. Regardless if you are looking into working on a suggested project or one of your own creation, you are strongly encouraged to engage on the forums before applications are accepted to help shape your idea and ensure a good alignment with a mentor.

Prospective Mentors
Several individuals have already volunteered to be mentors, but more mentors are welcome! If you have never mentored a GSoC project but are curious, it is not too late to volunteer!

And if you want to program in Swift rather than on Swift, here’s three interesting ones to check out for a start:

Catrobat: “Pocket Code allows you to create your own games, animations, interactive music videos, and many kind of other apps, directly on your phone or tablet.”

Ideas Page for Google Summer of Code 2020

Amahi: “Making Home Networking and Storage Simple”

Google Summer of Code Ideas

AOSSIE is a collection of Australian projects with multiple iOS app ideas

… or if you’d rather work on Mac tools, there’s Homebrew and MacPorts and all sorts of apps with Mac versions on the list…

… or if you’d rather do something completely different, everything from astronomy software to a DJ mixing application — something for everyone to start their resume out with, so start your application planning NOW!

Mobile App Security: CryptoKit Your Critical Kit

Here’s a set of posts that you should make some time to read if you’re any kind of mobile developer, not because there’s anything strikingly new here — in fact, hopefully there isn’t! — but just to be sure that you have a good basic grounding in 2020’s app security requirements, both for iOS and that other platform:

Mobile App Security: Best Practices on Android & iOS

Android App Security: Best Practices

iOS App Security: Best Practices

Smartphone apps are the center of most peoples’ technology usage. They deal with a lot of private and sensitive user data like your personal health information or banking information. Protecting this data as well as possible is heavily important and the topic of this article.

In this article, we focus on iOS App Security. We’ll show you concrete techniques for making your iOS apps more secure. Our best practices cover means for securely storing data as well as sending & receiving data over the network. You’ll see why it is so hard to get security right and how you can improve your app security by using services from Apple and other providers…

Most of this hasn’t changed much since the last time we did any posts about security here 8-10 years ago, so it should pretty much be a refresher for you, with the possible exception of what you might have overlooked with all that actually exciting stuff out of last year’s WWDC:

Apple’s CryptoKit is a new API that was introduced in iOS 13 and provides lower-level APIs to perform cryptographic operations or implement security protocols.

CryptoKit is based on top of more lower-level APIs. They were available before but introduced additional risk factors since developers often used them in a wrong way.

CryptoKit also allows you to use the SecureEnclave to get cryptographically safe functions that are performant and optimized for the device’s hardware…

So that’s pretty much a solid win all around there, isn’t it? Next time you’re touching crypto stuff, do yourself and the rest of the ecosystem a favor and adopt it! Isn’t a great deal of resources out there, but here’s what we’ve noticed:

WWDC session 709: Cryptography and Your Apps and associated playground

Discover the New Apple CryptoKit Framework

Common Cryptographic Operations With Cryptokit

When CryptoKit is not Enough

CryptoKit and the Secure Enclave

Particularly that last one, if you want really really secure:

For us developers, how the Secure Enclave deals with biometrics is not the most exciting part about it, because we cannot query it directly. Even our biometric APIs are constrained and they are fully handled by the system, so we cannot really do much work on top of that. The real exciting thing is that we as developers can leverage the Secure Enclave to encrypt and decrypt information with keys that are specific to a specific setup in a specific device…

And that’s about it for state of the art security. For your non-up-to-date users, their recommendation is

If you want to support older iOS versions you can use those lower-level APIs or use well known open-source third-party libraries like CryptoSwift.

That one does look pretty much the most comprehensive to us at the moment as well, yep; but there’s a wide variety of libaries in this space with varying focuses, so we’ll just point you at the currently best maintained curated lists with applicable sections — those links should stay relevant for another decade we trust!

Awesome iOS: Security

Awesome Swift: Security

UPDATES:

Introducing Swift Crypto

Swift Crypto is a new Swift package that brings the fantastic APIs of Apple CryptoKit to the wider Swift community. This will allow Swift developers, regardless of the platform on which they deploy their applications, to access these APIs for a common set of cryptographic operations…

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…

UPDATES:

How to make your iOS app smarter with sentiment analysis

Build a Touchless Swipe iOS App Using ML Kit’s Face Detection API

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!

UPDATES:

Using Swift’s CombineLatest Effectively

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!

The Niantic Beyond Reality Developer Contest

Got a great AR game idea burning a hole in your head and all you need is the infrastructure behind Pokémon Go? Well, not only is that available…

Niantic’s Real World Platform combines a world-scale persistent state engine, multiplayer AR, high-speed networking, geolocation data, and much more to create unique experiences that promote a sense of imagination and adventure…

… there’s a competition on to get paid to do a prototype with it!

The Niantic Beyond Reality Developer Contest

We invite you to reach beyond reality and apply for the Niantic Beyond Reality Developer Contest. Explore and create an impactful geospatial AR play experience with the Niantic Real World Platform, and compete for your share of a prize pool of more than one million USD.

For more details on the contest, please check out our blog and please see the Niantic Beyond Reality Developer Contest Official Rules…

Let’s check those more details out, shall we?

Niantic’s Real World Platform combines a world-scale persistent state engine, multiplayer AR, high-speed networking, geolocation data, and much more to create unique experiences that promote a sense of imagination and adventure. We’re seeking applicants that are excited about creating projects that follow core tenets of Niantic: exploration, exercise and real-world social interaction. The required team composition is at least five developers with experience in Unity and Java Server development.

Our focus is on games, but our definition of games is pretty expansive. So if you have an idea that bridges gaming and other areas like physical activity, social, travel or shopping, please feel free to submit. We are looking for proposals that leverage the Niantic Real World Platform’s persistent, real world capability as well as advanced AR. We encourage you to think boldly!

Well, had we the time, we’d have you do AR puzzles Tomb Raider style … inside actual ancient ruins like Angkor Wat. Help yourself, you’re welcome!

A select group of ten teams will earn a stipend and access to the Niantic Real World Platform. Finalists will work for a three-month period, with the goal of showing off their incredible work at a Demo Day in San Francisco, hosted by Niantic. In addition to regular guidance and discussion from the Niantic Engineering team, finalists will be brought to San Francisco/Bay Area to meet with executives and lay the groundwork for the work to come.

We invite you to adventure along with us, and create something that the world has never seen before…

Got some time on your hands and an indie game itch? Looks like the opportunity of the year (at least) there!

3D Touch Is Dead – Long Live Haptic Touch

So no doubt you noticed all the angst this summer about Apple possibly removing 3D Touch from iPhones, as indeed it did with the iPhone XR, if not catch up with the discussion here:

Possible Removal of 3D Touch With 2018 iPhones

… and once it actually happened, the seven usual stages of grief pretty much got dropped by most people and they headed straight to acceptance:

The iPhone XR shows how unnecessary 3D Touch has always been

Why does Apple’s 3D Touch fail miserably?

Personally, we figure the only problem with 3D Touch was discoverability, and a pretty much perfect fix was laid out here:

How Apple can fix 3D Touch

… Now that we know what the problem is, here is my solution. Like we did with the link texts years ago on the web, we should visually distinguish 3D Touchable buttons. Look at this same screen and see if you can tell which toggles accept 3D Touch … My solution is adding a line on bottom-right of things that can be 3D Touched. Let’s call them Force Decorators (with reference to Force Touch). 3D Touch is missing the most obvious thing to be mainstream. Visual cues. I think this is the answer.

Simple, elegant, and almost certainly correct; if you do support 3D Touch, consider adopting that!

However, given the lack of wrath from the buying public over the XR missing it, and the continuing Haptic Touch additions, seems like a pretty safe bet that we can consider 3D Touch a dead technology going forward … or at the very least should have parallel implementations. Which brings us to a pair of recent articles to recommend:

How to apply iOS 3D Touch to any UIView as a UIGestureRecognizer

….recently I needed to have an UIGestureRecognizer to apply to any UIView that intercepts 3D Touch as you can do with tap, drag, etc, but nothing similar is available in system libraries.
As result of my study about this implementation, I’ve written a UIGestureRecognizer subclass that can fit my needs…

Improve iOS apps user experience using Haptic Feedbacks and Taptic Engine using UIFeedbackGenerator

In my last post I wrote about introducing 3D Touch as common UIGestureRecognizer in any UIView to improve the interaction with your app, now I want to explore the haptic feedback which is giving us a new physical way to give control to the user of what is happening on his iPhone.
Until haptic feedback through taptic engine, play sounds were the only way to provide users a feedback about an action in the app, but sounds are annoying and sometimes creepy.

UIKit is providing us a clean and elegant way for that: a standard and safe interface for haptic feedbacks plug and play implementation, UIFeedbackGenerator…

If you haven’t checked out UIFeedbackGenerator before, here’s a good quick intro:

Creating an Immersive User Experience with Haptic Feedback in iOS

So, before designing your power user gesture interfaces going forward, check out those technology comparisons … and especially the 3D touch design/usability postmortems. Nothing worse than wasting time writing features that nobody actually uses!

UPDATES:

Remember back when we first collected articles on 3D touch, and digital scale apps were a nifty thing? Guess that’s going to go by the wayside as 3D Touch falls off as well. If you do have one of those apps, maybe you want to migrate to Android — check out the state of their art in 5 Best Real Digital Scale Apps for Android!

Haptico – “easy to use haptic feedback generator with pattern-play support” 

Improve iOS apps user experience using Haptic Feedbacks and Taptic Engine using UIFeedbackGenerator

UPDATES:

Haptic feedback in iOS apps

Captain AHAP: Custom Haptics Designer

Adding haptic feedback to your app with CoreHaptics

Haptrix — Core Haptics Designer

Creating Haptic Feedback in iOS 13 With Core Haptics

A Swiftcycle Built Four Two

And now that we’ve got our apps all compatible with this year’s OS and devices — you have, haven’t you? — time to take a closer look at all the goodies in the latest Swift that people have been discovering since WWDC, now that it’s official and all:

Swift 4.2 Released!

Swift 4.2 is now officially released! Swift 4.2 builds on the strengths of Swift 4, delivering faster compile times, improving the debugging experience, updating the standard library, and converging on binary compatibility.

You can watch a quick overview of it by watching the WWDC 2018: What’s New in Swift presentation, and try out some of the new features in this playground put together by Ole Begemann…

… With the completion of conditional conformance support, Swift 4.2 makes significant progress in implementing the vision of generics in the language. Watch the Swift Generics WWDC 2018 presentation for more details.

Check out those shows for sure, and read the whole thing if you want the nitty-gritty of all the implemented swift-evolution proposals, or you could just skip straight to

Migrating to Swift 4.2

Alllegedly the Xcode migrator should take care of pretty much everything, but it choked a lot for us. YMMV. Either way, not a lot of breaking changes you’re likely to find; aside from some minor renaming, check out Upgrading To Swift 4.2 for discussion, most everything new is additive — 

— and, as always, check out What’s new in Swift? for a quick and easy reference between the versions of your choice — 

— personally, our ABOUT TIME! award goes to Swift Diagnostics: #warning and #error. Good riddance, parsing scripts!

Although it’s a very close runner up for Synthesized conditional conformances in Swift 4.2. It’s just automagic!

Overdue conveniences out of the way, likely the biggest immediate aid to our coding is CaseIterable, which contrary to what the name might lead you to expect isn’t just for enums but for any type with a finite number of values: check out Enumerating enum cases in Swift for details.

Now, the biggie in terms of power, and in generating powerful opinions shall we say? centerpiece feature:

Introduce User-defined “Dynamic Member Lookup” Types

!This proposal introduces a new @dynamicMemberLookup attribute. Types that use it provide “dot” syntax for arbitrary names which are resolved at runtime – in a completely type safe way… The driving motivation for this feature is to improve interoperability with inherently dynamic languages like Python, Javascript, Ruby and others. That said, this feature is designed such that it can be applied to other inherently dynamic domains in a modular way.

On the one hand, this is definitely an “enough rope to shoot yourself in the head” kind of feature, on the other hand, Swift’s chances of ever becoming more than an Apple ghetto are enhanced significantly with this, so we figure you should all be cheering for the future job prospects! For more on this, check out

Thoughts on @dynamicMemberLookup

Exploring @dynamicMemberLookup and commentary

And while we’re speaking dynamically and all, over at Chez Wenderlich there’s an excellent overview of Dynamic Features in Swift up to and including this latest.

That’s about it for majorly interesting new stuff, but there’s some more interesting details, check out:

Ole Begemann’s above-referenced Playground: What’s new in Swift 4.2

The completely different yet identically named playground to go with Hacking With Swift’s What’s new in Swift 4.2 too.

And for yet another — come on people, we can do a creative name — Ray Wenderlich has a What’s New in Swift 4.2 three.

Michael Tsai’s Swift 4.2 Released

Finally, if you really want to get ahead of the game … check out What’s new in Swift 5.0!

UPDATES:

Bloom Filters and Swift 4.2

How CaseIterable Works Internally in Swift

Swift Associated Types With Default Values