What I did last yesterday
- Did a ton of practice yesterday with SwiftUI. Worked up to day 82! I tackled accessibility which was much more of a pickle that I had originally thought. There are so many considerations as to how you let VoiceOver read the content you provide to the users, how some content is just decorative and you can mark it as such using
.accessibilityHidden
. Sometimes you have content that you want to be read by VoiceOver but you dont want the individual elements to be read so you can provide your own “script” to be used and that’s where.accessibilityElement(children: )
and.accessibilityLabel()
come in. I will say though, typing out the word “accessibility” is not something I’ve done this much and it get’s rather easy to misspell ha. - Learnt about presenting tab views to users and the arrangement of the components threw me off at the start but when that happens my remedy to that is to write it three times, the last one being from memory, be it muscle or just be remembering it. In the end it forces me to acknowledge the pattern. The more I use SwiftUI the more I get to appreciate what cross-platform frameworks like Flutter tried to solve subtly.
struct ContentView: View {
@State private var selectedTab = "One"
var body: some View {
TabView(selection: $selectedTab) { // Wrapper View
Button("Show Tab 2") { // Content View
selectedTab = "Two"
}
.tabItem { // Tab Modifier denoting the above view is tab content
Label("One", systemImage: "star")
}
.tag("One") // Tab tag (ID)
Text("Tab 2") // Content View
.tabItem { // Tab Modifier
Image(systemName: "circle")
Text("Two")
}
.tag("Two") // Tab tag
}
}
}
- First time interacting with iOS notifications and finding out there are different types of notifications on iOS. There’s Local Notifications and Remote Notifications (aka Push Notifications). Before that I had always assumed they were one thing. This uses the package
UserNotifications
. Getting permission for notifications in code looks like:UNUserNotificationCenter.current().requestAuthorization(...)
which in my opinion is actually super intuitive. Apple tends to have very long names for certain methods but I guess I can understand the reasoning behind that. Now beyond that, there’s types of UserNotifications that can be used and the one that I practiced with wasUNTimeIntervalNotificationTrigger
which lets you request a notification to be shows in a number of seconds, as the name suggests. Pretty cool! - Setup the SwiftUI project for Mande and set it up locally. Had a lot of questions which I did not hesitate to ask. The codebase was rather interesting since there was Kotlin in there and the only experience I’ve had with Kotlin is when I would use Flutter and have to interact with things like the gradle files to set up the project.
- Got a call from
De-Great Yartey
and we had a good chat about what the future of his projects would look like and I was trusted with the codebase for Adeton. That was really nice acknowledgement since I’ve always been a fan of how open he is as a person and as an avid learner, be it code or anything else. Even looking at his code from 4 years ago fills me with excitement because the separation is so clean you can cut it with a butter knife. Utterly beautiful work.
Today
Morning Walk and Reflection
- Alan Watts this morning and there was a lot of messages to dissect but the one that stuck with me was:
For as long as you can be talked out of yourself, you deserve to
That had to sit with me for a little while but after a bit I started to make sense of it in my own way. Thinking about the dedication I am giving to myself to become a founder and a great one as at that, self-confidence is key but being able to see the faults in your actions through self-awareness is also something I cherish. And in that sense, sticking with your intuition even when those around you do not see your vision is tough but it’s needed if you really want everyone to see what you alone can see for now.
Upcoming
- Continuing with Day 82 of 100 Days of SwiftUI. Trying my possible best to be able to finish up this week so I can start getting my hands dirty with SwiftUI projects and contribute to some as well.