Making Firebase Realtime Database behave in real-time using the notification/observer pattern

Adding and deleting values from Firebase updates the UI immediately

Are you working with Firebase Realtime Database and wish your UI would just update when the backend does? This can be really helpful when changes can come from anywhere — i.e. in a multi-user app where one user performing an action may change another user’s data. …

If you aren’t careful, you can mutate constants!

If all you’re doing is using structs over classes, your code isn’t necessarily safe

If you’ve been doing Swift Development for any length of time, I’m sure you’ve heard that it’s good practice to use a struct over a class by default. While this is true in many cases, and for good reason, it’s very easy for a struct to be just as unsafe…

Decoupling code with protocols and delegation

A bunch of suitcases on display
Um, you’re only leaving for a few days, do you really need all that? (photo credit: arthur-edelmans,

Imagine you’re going on vacation. You know exactly where you’re going, how long you’re staying, and the weather pattern is very reliable. You’re super prepared for what’s to come, and you know exactly what you’ll need when you get there. It wouldn’t make sense to pack everything you own and…

No architecture needs to have a massive view controller

Small, blurry background text with the words “very tiny” magnified
Tiny ViewControllers? Very tiny

So you’re sick of massive view controllers? Me too. Many architectures attempt to overcome this problem in a way that I view as extremely complex for the problem they’re trying to solve.

I favor simple architectures and simple solutions because they’re easy to understand, develop, and maintain. For this reason…

The single responsibility principle in action

Your ViewControllers don’t have to be so massive

In this tutorial, we’ll implement MVC in a way that you may not be familiar with. We’ll create a reusable UICollectionView that’s implemented by its parent UIView and delegates item selection events to a UIViewController. This makes for a very small view controller when compared to the default way we…

Take your development to the next level, eliminate your assumptions with Unit Tests

Don’t you wish you had an automated way to test your code every time you make a change? Good news! You do!

If you’re anything like me, you make a lot of assumptions when you develop software. Also, if you’re anything like me, you probably didn’t realize it until recently, or maybe you still don’t realize it. …

Increase performance by avoiding retain-cycles

vertically scrolling numbers, dripping/leaking down the page
Ew, leaky code

In Swift, memory is handled for us pretty efficiently via ARC. Basically, reference objects (such as classes) hold a count for how many times they’re being referenced. When the count reaches 0, the item is marked for deallocation and removed from memory when the system needs the space.

If we…

A good API doesn’t break easily

A little blue character with a repair kit looking at a hole in a website or app
Keep those holes closed, so your users don’t experience interruptions!

Often when developing codebases, you probably want to model a situation with one of 2 possible outcomes. In Swift, this often means using optionals as the return type for a method. The idea is one of them will be nil, and the other will be non-nil.

What you may have…

Kenny Dubroff

I’m a Full Stack iOS Developer with a passion for writing clean, reusable code.

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