Category: Software
-
Surprised by Git LFS
When I started a new job recently, I had some trouble building their iOS app. The error messages seemed to indicate that some files were missing from the repository. It took me days to realize that there was this thing called “Git LFS”. Initially, I downloaded the zip file of the repository, unzipped it, and…
-
How to convert a hex color to a UIColor
This snippet of code takes a hex color string as input and creates a UIColor object as a result. It expects the hex color string format of #RRGGBB. To use the above extension code
-
Extract a Substring Behind a Colon in Swift
I came up with Option 1 at first. Option 2 is an equivalent version of Option 1. I don’t really like the idea of slicing a sub-string containing the colon then drop it. I think Option 3 is better. Option 4 is a concise version of Option 3.
-
Sorting an Array by Two Fields in Swift
Assume we have the following Person model struct. How could we sort an array of person [Person] in ascending order first by the firstName then by the lastName?
-
Most Used Git Commands
Create a new branch called <branchName>, then check out to that branch Show file changes for commits Tag related commands
-
Coding Mindset
Don’t be afraid of messing up the code. That is why Git is invented.