CODEX

Photo by J. Kelly Brito on Unsplash

2021 has already started, but many of us are still locked at home, having minimum contact with other human beings and maximum free time. For some people it’s a synonym of boredom, for others— an opportunity to learn something new. And as 2020 showed us the importance of the IT industry, which continues to grow more and more, learning a new programming language can be a good idea. But which one? Which programming language has the potential to boost your career, increase your salary, make your dreams come true or let you enter IT world?

JavaScript and TypeScript

JavaScript is one of the…


CODEX

QR codes are an easy way to exchange small amounts of data between smartphones (data reader) and any media (data provider). They are easy to generate and to scan, you can customize them, add logos, change colors, and make them “yours”.

Photo by Albert Hu on Unsplash

Two smartphones with Flutter apps can easily generate and scan QR codes, but generating QR codes for export is a little bit trickier.

Scanning QR codes with Flutter

Let’s start with scanning. Any iOS or Android device with a camera can scan and decode QR codes. As an example, we’ll use the flutter_qr_bar_scanner.

It provides a widget showing the camera feed — QRBarScannerCamera. You…


Add some additional style to your app with blurs and shadows

Shadows on a wall
Shadows on a wall
Photo by Agata Create on Unsplash.

For most of my projects, I get the app designs from my clients. And if I need to say what the most used design elements have been in 2020, I’d say that they’ve been flat elements, blurs, and shadows. There’s no problem with flat elements, as the native iOS design is pretty flat. So let’s see how to add blurry backgrounds and shadows to your iOS apps.


Once I got a rather simple-looking task from a regular client of mine: he needed to make a screen for an iOS app with several switches. The switch was long and thin. It was different from both the UISwitch, which has size 51x31 points, and the Material switch, which is more flexible in size, but the thumb is bigger than the track.

Switches from client’s design

I found many solutions on GitHub, but they were either modifications of existing UISwitch, or variations of Material switch. Other options didn’t look like switches at all.

I’ll give some references, in case you’re looking for something different:


Photo by Markus Spiske on Unsplash

Back in 1936 the computer scientist Alan Turing invented a model of a computational device later known as The Turing Machine. This machine did simple operations and had a state. This state was actually a piece of data, and the machine was “running” algorithms to perform operations over that data.

“Algorithms + Data Structures = Programs”

— Niklaus Wirth, 1976

All that a computer program does is actually just data receiving, sending and processing. Data is that unit with which our code works. …


Photo by Warren Wong on Unsplash

During my career as an iOS developer I wrote around 50 apps. Some of them were small and stayed in the stores just for several months, others stayed alive and got regular updates for years. I’m not a designer myself, I get designs from my clients or a third-party designer. And almost all designs I saw included custom back button on most screens.

Using iOS storyboards to develop UIs, I tried to find an easy way for the user to return to a previous screen, some kind of backward segue. …


Syntactic sugar to make alerts, text fields, and more easier to work with

Photo by Samson Vowles on Unsplash

Showing even simple pop-up dialogs requires several lines of code in Swift. When you have data validation or proper error handling, you have tens or even hundreds of places where you can show a pop-up. Let’s write several UIViewController extensions that’ll do the work for us.

self.show(message: "Let's start!")

Showing Errors and Warnings

The first two extensions will show simple pop-ups with only one button. The difference will be only in the title. You can add some styling, but Apple doesn’t usually motivate developers to customise pop-up windows, so I’ll use the basic UIAlertController here:

As you can see, the title is predefined…


Photo by Anton Darius on Unsplash

When you write mobile apps in Swift, you usually have a lot of background work. I’ve been working as a mobile developer for almost 10 years and I can hardly remember a single project without Internet requests. Each Internet request requires time to be processed. Usually an unknown amount of time, possibly, endless.

If you do such work in the main or UI (which is the same) thread, your UI will get stuck. That’s why asynchronous tasks in Swift are designed the way they will never do so. The most common way is to avoid it is to use a…


Emoji aren’t just simple strings

Photo by Gaby Prestes Nekrasova on Instagram.

Emoji have become a big part of our life. iPhones and iPads have a special emoji keyboard (unless it’s turned off). We see them on websites, in mobile and desktop apps, and we enter them when writing texts and filling in forms.

How do we control them? How do we prevent users from entering emoji in UITextField? How do we parse emoji in the JSON response from a server? Let’s discuss it all.

A Little Bit of Theory

Emoji are a part of modern Unicode. Computers work with bits and bytes — not with smiles and other small pictures. Letters, numbers, and special characters in…


Useful pods to start your project off with

Photo by Xiong Yan on Unsplash

If you start developing a new iOS app, you probably need to use several external libraries. Even if it’s going to be a very simple one, you probably want to gather some statistics, make requests or show a loading indicator. All of this can be done without external libraries. After all, external libraries are also code, and you can write the code yourself. But why would you do something from scratch if someone else has spent months or years doing so and they are ready to give it to you for free?

The most popular dependency manager for iOS is…

Alex Nekrasov

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.

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