Blog

nil-null-mess in Objective-C and Swift

Published on

All programmers are familiar with the concept of nullability. Whether something exists or not. Whether something is there or not.

Objective-C is very dynamic when it comes to dealing with nullability. All Objective-C programmers are familiar with this phrase:

messages can be sent to nil.

Which means that nil itself can call methods, safely enough, without crashing.

In Swift, we have a bit more safety. We can send “messages” to nil, but only if they are the result of a chained optional. nil can only be a thing when we are working with optionals.


Understanding Basic Data Structures in Swift: Dictionaries in Depth

Published on

Whether you are a seasoned developer with a lot of code out in the wild world, or you started learning programming this week, chances are you hace used (and seen) dictionaries being used in many places. Also known as hashmaps or hash tables, dictionaries allow us to store key-value mappings, from one object to another.

In this article we will study this structure which is known by everyone, and we will also learn about its quirks and unknown features.


Understanding Basic Data Structures in Swift: Sets

Published on

I’m introducing a short small series in which we will talk about basic data structures in Swift. My goal is not to show how they are implemented internally, but rather to show when they can be useful.

In truth, unless you have studied Computer Science to some capacity, chances are you are missing on a lot of powerful existing data structures that can help you write better code. I have been studying iOS development for a long time with many resources, and none of the resources ever dive into useful data structures, such as sets. These sources tend to focus on arrays and dictionaries only (as the focus is iOS development, and not necessarily computer science), not teaching other structures that are actually really useful in the iOS Development world. I have never seen an iOS dev resource that covered these structures as deeply as my computer systems engineering courses did.


Being an iOS Developer in Bolivia (and South America)

Published on

Happy New Years everyone! To kick off this year, I wanted to write a non-technical article. This time I want to focus on a topic that you won’t find in many other places, and that is what it is like to hunt for iOS jobs in Bolivia, and what my experience has been like being one here. By the end of this article, you will hopefully understand a very different market compared to countries such as the USA, and you will be able to make a decision on whether this is a field you want to pursue or not. What I’m going to be writing about applies to Bolivia, but keep in mind that South America in general has very similar conditions and markets.


Happy 2021! And Short Break Notice

Published on

This has been quite a year! Not only did we have the bad stuff happen (COVID-19), it has also been a crazy year for my personal development and for the growth of my blog.

Thanks to the events that happened mid-year, the reach of my blog has reached wide, and I have connected to a bunch of people thanks to all that.

I want to take one minute to thank you all who have reached to me with questions about my articles, ideas, and even suggestions to improve my writing. When you guys point out typos and ask questions, it measn you guys are reading my content. It means that I am not writing in vain, and that makes me genuinely happy. When I revived my blog in 2019, I said I wanted to become an active Swift community member. I’m very happy to say this purpose has been fulfilled.


The "ExpressibleBy-" Protocols in Swift

Published on

Swift gives us many interesting features to write cleaner and more obvious code. This code is more readable, and it helps both SDK consumers and code maintainers.

One such feature Swift has is the ExpressibleBy- family of protocols. This is a set of protocols that allow you to instantiate objects by providing some native Swift object. For example, we can instantiate an object providing a Boolean, or a String.

This family of protocols consist of the following protocols (this is not a complete list):


Getting Started with the App Store Connect API

Published on

In 2018, Apple introduced the App Store Connect API. We as iOS developers interact with App Store Connect almost daily. We like to see our sales reports, analytics, check how our apps are doing. Occasionally, we may need to register a new device or manage our users.

Many of these tasks are so common that it was necessary to get an App Store Connect API at some point. Having an API allows us to automatize some aspects of our day to day tasks on App Store Connect, and to make some tasks easier and faster. In this article, we will explore a few features of the App Store Connect API.


Understanding the Limited Photo Library in iOS 14

Published on

This year, Apple introduced a new feature that gives users even more control over what photos may third party apps see when they see a Photo Picker. The system will first present an alert asking users if they want to give access to their photos at all, and they have the option to give access to all their photos, or only to the photos they choose.

This is great, but it has been a very confusing experience for both users and developers alike. In this article we will explore this new privacy-focused photo picker and how to make good use of it without compromising too much of either usability and privacy.


Lazy Sequences in Swift

Published on

Lazy Sequences in Swift

If you have been writing Swift for a while, you have undoubtedly used high order functions such as .map and filter. These higher order function work on any collection, and they are very useful when we want to quickly transform objects into something else, or when you want to do other operations in sequences that would otherwise take more than one line of code if you were to make them with loops.


Quick Tip: Custom Debug Printing with CustomDebugStringConvertible in Swift

Published on

Printing stuff to the console is a simple but powerful step we can take when debugging our apps. But there are times when we want to print an object and we actually get something entirely different, often also useless.

For example, this commonly happens when working with classes and printing instances of them.

class User {
  let id: Int
  let name: String
  
  init(id: Int, name: String) {
    self.id = id
    self.name = name
  }
}

let andy = User(id: 1, name: "Andy")

print(andy)

In a playground, this will print: