Being practical is a one way ticket.

I always preferred using terminal over GUI apps to control my projects or to navigate through folders on my disk. I admit this is not really the most intuitive and friendly approach but one thing is for sure: once you get used to this you’ll want to use terminal for pretty much anything possible.

Image for post
Image for post
Photo by Markus Spiske on Unsplash

The touch command creates new, empty files. It is also used to change the timestamps (i.e., dates and times of the most recent access and modification) on existing files and directories.

touch empty_file.txt

The mkdir command allows the user to create directories (also referred to as…


Save money and external dependencies.

In order to gain users, localizing our apps is essential since not everyone speaks the same language. Even if our app uses english strings, only a relatively thin slice of the entire global population understands it. We don’t want to lose the larger slice of the users, do we?

Image for post
Image for post
Photo by Vladislav Klapin on Unsplash

There are quite easy and quick ways to localize ours apps using external dependencies such as Applanga or Lokalise. I used both of them in the past, and I can vouch for them if you’re working on a enterprise level. They’re great but they’re a business and as any other: they…


Also known as visual regression testing.

It’s been a while we know it's possible to do snapshot testing on iOS. Recently, my friend Dariusz Rybicki introduced me to SnapshotTesting (from Stephen Celis and Brandon Williams ) and that’s what we’ll talk about today.

Image for post
Image for post
Photo by NordWood Themes on Unsplash

Let’s start by adding the following swift package:

https://github.com/pointfreeco/swift-snapshot-testing

Then, let’s create a simple screen and set view.backgroundColorto red:

In our unit test target, let’s create a test class, import SnapshotTesting and create a test case for this screen:

Right now, if we run the tests we’ll see an error saying that no reference was found on disk. This happens because…


Because Rx frameworks sometimes can be a pain.

Back in 2017, I watched Eric Cerney at the RWDevCon talking about MVVM and data bindings. What’s cool about it, is that it does the same thing that an observable would do in Rx with much less code.

Image for post
Image for post
Photo by Fabian Irsara on Unsplash

Boxing

By overriding setters we can simulate observables. Skipping the MVVM refactoring, the most interesting thing here is Boxing. A technique where we wrap an object with generic type T and everytime its value gets updated a closure returns it.

This is great because it leaves our view controller completely isolated from our logic. It does exactly what a view controller should…


Using CAShapeLayer and UIBezierPath to mask UIView holes.

Image for post
Image for post
Photo by Majid Gheidarlou on Unsplash

In the last couple of days I’ve been working on a QR code scanner feature (as you can probably tell by the topic of my last article) and I’ve stumbled upon a situation where I needed a semi-transparent overlay view which is completely transparent in the middle. In other words: a squared hole into an opaque view (or in this case semi-opaque).


Keeping your code safe from COVID.

In this pandemic you have probably seen many restaurants using QR codes for their menu in order to avoid using carton-made menu that could possibly be contaminated by other customers. Today I’ll quickly go through how to use QR (quick-response) codes and even regular barcodes in Swift.

Image for post
Image for post
Photo by david pl on Unsplash

How do we create QR codes or barcodes?

To generate QR codes or barcodes we need CoreImage framework which is used to generate images and apply filters but we will be fine by just importing UIKit instead.

A weird thing about using CoreImage filters is that they are initialized with a string from the generator protocol you want to use. …


Feel the relief of one less third-party library — tested.

Today we’ll go over how to use dependency injection with Swift 5.1 property wrappers. This approach is particularly interesting because its clean and very lightweight since it doesn’t require any third-party library.

Image for post
Image for post
Photo by Wind Ira on Unsplash

When using property wrappers, we need to declare the wrappedValue. In the initializer we are resolving the dependency which will bring us the instance that was stored in the container for that type.

The container holds a private static variable which will be used on static functions such as resolve and register and it also holds a private dictionary for the dependencies. …


Don’t stick to just modal and push.

Image for post
Image for post

Today we’ll implement a custom transition, scaling an UIView from half-screen up to fullscreen using UIViewControllerAnimatedTransitioning . What will happen inside this custom transition is just some simple constraint animation but we could do pretty much anything.


Easy, quick and robust.

In this article, we will cover the basics of Dependency Injection and how to apply it to an iOS project using an open-source framework called Swinject.

Image for post
Image for post
It won’t hurt — thanks to Swinject.

Dependency Injection (DI) is a technique in which you set the dependencies of an entity from outside of its own scope, turning your system into loosely coupled modules. Imagine a class holding references to every other component of the app saving you from communication patterns between UIViewControllers for example.


Harnessing mobile machine learning and augmented reality to browse the Internet with hand gestures

Image for post
Image for post
Hi Mia! Guessing your paw gesture is for a treat, not for augmented reality. Maybe some day!

In 2002, a sci-fi movie named Minority Report showed us a range of futuristic tech concepts, and for many geeks and enthusiasts (like me), it created an excitement to reach the point where these big tech ideas could become reality.

This movie takes place in the year 2054. One of the most iconic scenes for me is when Jon [Tom Cruise] controls holograms according to his gestures and the movement of his fingers.

The GIF was removed 😢

Before we start trying to reproduce this scene, here’s a bit of bad news:

  • Holograms are not too popular [yet], so we’ll…

Bruno Muniz

iOS Engineer @elixxir_io

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