Ā· blog Ā· 4 min read

Making the Best of Physical Distancing

With Canada practicing aggressive physical distancing due to the ongoing pandemic, Iā€™ve been finding myself with a lot of free time indoors lately which Iā€™ve been devoting towards a few different personal projects. Just yesterday, I finished updating my iOS app CU Libraries to be compliant with the latest version of iOS 13. After the latest iOS update, I had noticed that the app UI wouldnā€™t properly render on devices with a notch (like my iPhone XS Max). After doing some debugging, I discovered a fix which involved commenting out a single line of code:

.edgesIgnoringSafeArea(.top)

This code tells SwiftUI to ignore the safe area (the area around the notch of your device), which was a workaround I used to render the top indigo section of my CU Libraries UI here:

CU Libraries top design

However, in the latest version of iOS, It seems that area around the notch is now handled automatically by SwiftUI, and if your app code ignores the safe area it wonā€™t render properly, but only on notch devices (using the above code worked fine running on the iPhone 8 simulator). This was the first update Iā€™ve pushed to the first app Iā€™ve ever published on the App Store, and so I was pretty excited when I received an email from Apple earlier today approving the update!

Aside from the app update, Iā€™ve also been making extensive use of Swift Playgrounds. Playgrounds have been an awesome way to make quick conceptual sketches which I find great for iterative learning. For example, after learning about protocols in Swift, I was quickly able to create a Playground which let me test out how to use protocols effectively in a range of different scenarios that I could play around with in real time. The playgrounds also proved really useful in helping me model a deck of cards using a collection of enums and structs for the first time (next step is implementing blackjack functionality).

Now that I have the console based playgrounds under my belt, the next step is exploring how to combine SwiftUI with playgrounds over the weekend. With Playgrounds, Iā€™m excited to be able to rapidly prototype my code prior to building it out in a full XCode project.

In between coding sessions, Iā€™ve been practicing learning bass guitar, which has been going well since the note layout of the bass is the same as the Linnstrument which Iā€™ve gotten quite proficient at playing. Iā€™ve been wanting to pick up bass for a while now but just havenā€™t had the time to practice my technique. Between the Bass and Linnstrument, I have a few different ways to creatively express myself in between learning sessions. Interestingly, I find the music really helps my coding. The more I practice, the easier I find coding sessions become. It seems like when Iā€™m playing some improv jazz or playing in the groove it really helps to keep me sharp and able to focus on note taking and coding challenges.

Iā€™ve also been careful to limit my time reading the news and have almost entirely cut out social media. When Iā€™m home in my apartment, I find spending too much time on these types of sites can really eat into my productivity. However, being aware of something being an issue is half the battle, and so Iā€™ve done my best to avoid getting into a habit of checking these kinds of sites more than once a day.

I hope everyone is keeping safe, and if you find yourself getting bored during physical distancing, I highly encourage you to take some time to dedicate to activities that you might not normally have the time to explore!

Share:
Back to Blog