Algorithms: Matching Parenthesis Problem in Swift

Hey folks, Leo here. This is a classic algorithm problem and the solution is very straightforward. The problem: Given a string of parenthesis ‘(‘ and ‘)’, write a function that returns true if there are matching pairs and false if there are not. A matching pair means, there should be a closing parenthesis for an […]

How to make great Modals in iOS?

Hey guys, Leo here. Today we’ll talk about modality, just some insights for your apps. You must have this feature in your app’s flow when you need to change the user focus to a single actionable sub-task of your current flow, examples could be an alert or a create an email. First of all, there […]

How to do Gradient background colors in Swift?

Hello folks, Leo here. A quick tip from what I learned today. The code below makes the background from white to yellowish. Obs: self here is the element that you want to have a gradient background.     That’s all my people, I hope you liked reading this article as much as I enjoyed writing […]

Inventory Update Problem in Swift

Hey guys, Leo here. Today we’ll continue the series Algorithms, the Final Frontier. Always remember folks, this is ONE of many possible solutions for the problem. The challenge is here: The Challenge Let’s go! The problem: Compare and update the inventory stored in a 2D array against a second 2D array of a fresh delivery. […]

Algorithms: Find the Symmetric Difference in Swift

Hey guys Leo here, Today we will start a series in this blog called: Algorithms, the Final Frontier. We’ll follow the interview prep series from the free code camp. The first challenge: Challenge Here The problem: Given two sets (for example set A = {1, 2, 3} and set B = {2, 3, 4}), the mathematical […]

How to initialize a 2D array full of zeros in swift?

Just use the array initializer (repeating: , count: ) as follows: var rows = 3 var column = 5 var arrayOfArrayInitialization = [[Int]](repeating: [Int](repeating: 0, count: column), count: rows) That’s all my people, I hope you liked reading this article as much as I enjoyed writing it. If you want to support this blog you can […]

How to write minimum on URL declarations in Swift? Hint: ExpressibleByStringLiteral

Hey guys, Leo here. Today I learned with this tweet: twitter.com/aslanyanhaik/status/12529058314.. This is a great way to abstract not only the unwrapping from your code, but it’s way more pleasant to read. And If you are curious, there are ExpressibleByStringInterpolation too if you need that type of control. That’s all my people, I hope you […]

How many points height my buttons (controls) should have?

Hi guys, Here in my blog, I’ll try to be as straightforward as possible. So… The answer is 44×44 AT MINIMUM. You can check for yourself in Apple’s human interface guidelines Extra UI tip: avoid putting controls in your app’s screen corners, because it can be difficult areas for people to reach comfortably. That’s all my […]

My favorite Xcode Shortcuts

Hey guys, what’s up? I’m here to bring all the shortcuts that I use to develop on Xcode. I’ll abbreviate the keys for the sake of simplicity: ⌘ – command⌥ – option^ – control 1 – Enter the definition of function/type/method/etc. Did you already need to answer the question “how this is defined? I want […]

Join our Newsletter!

From beginner-friendly tutorials to advanced coding techniques, the newsletter is designed to help you level up your skills and stay up-to-date with the latest trends in app development.