Introducing simple data modelling approach to improve the way we deal with Accessibility Identifier's in SwiftUI

Introduction

Long story short: I really don't like to see loose strings flying around, so when I saw the way we normally set accessibility identity it really bugged me.

Looking at the Swift API, there is another case that bugged me in the past but now has a solution: Notifications

Implementing Use Cases in Swift

What is a Use Case?

Source: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html

By Uncle Bob's definition, a Use Case is basically an Interactor, which is responsible for encapsulating our Business Logic, and should have a well defined intention. But in the real world, it's very common to end up with bloated Interactors, in architectures like VIP/Clean and…

Creating buttons is something we have to do very often…
What if you could simplify their configuration with a simple extension?

The Apple Way

To configure a button action we normally set it’s action from a selector and that’s it…

The Extension

A button have an action, which is defined as a selector.
A selector

Eduardo Sanches Bocato

iOS Engineer, AI enthusiast, Crossfit/Gymnastics. Currently working as iOS Lead @adidas

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