I write about software engineering and technology in general.

Swift Essentials - Remove Duplicates

Swift Array contains a lot of quality of life functions that help the developer code operations on Array elements. One thing that the Swift Standard Library falls short is in it’s ability to remove duplicates from an Array.

By leveraging Swift Extensions we can create a function that enhances the Swift Array built-in functionality to remove duplicates, provided their element conforms to the Equatable protocol.

Swift Essentials - UIColor from Hex

While working on a past project, a requirement was to set the background colour of a button with a specified colour retrieved from a REST API endpoint. This colour was a HEX string value in the format #FF0000.

Unfortunately, UIKit has no UIColor constructor that receives a colour in the Hex format, so I needed to implement a way to achieve this.

Leaving Facebook, at long last

It’s long overdue. The reason I have lasted so long in Facebook is the fact that a lot of my contacts I find only there. But since all of them have mobile phones and email I realized that’s just convenience, and so, it ends.

Writing C#’s Rfc2898DeriveBytes in PHP

Recently I came across a third party backend writen in C# that encrypted small pieces of sensible data for storing in the database with AES-256-CBC. The piece of code responsible for the encryption and decryption can be found at the bitlush blog (kudos to the authors). This backend would send this encrypted information to our backend system writen in PHP, and it was our responsability to decrypt those pieces of data on our end, and so we had to effectively at least write the decrypt function exactly the same way as the C#’s counterpart. We went on to write a PHP class that is a 1:1 port.

How VIPER changed iOS development

(At least for me…) I have been developing iOS apps for the past 5 years, much has happened then in the world of iOS development. Objective-C is starting to (slowly) be replaced with Swift and if you don’t master Auto Layout yet, you should definitely consider it heavily. However as much as something changes I always have this gut feeling, that programming for iOS could be done better, cleaner, and that it has nothing to do with the OS itself, or even how Apple develops their APIs, but instead how you think your code, and ultimately how you structure it.

Why care about your online privacy?

Ever wonder how Google can give the world amazing and above all free software? How can one, who apparently gives everything for free make, last year alone, a 16 Billion dollar net income? Well, Google sells advertisement, and they are damn good at it. Why? Because they know more about you than you probably know about yourself.