In Swift, I use the
Result type extensively. Mostly for async callbacks, but it’s generally a nice, tidy and consistent way to provide a value that can either be a success or failure as a result of calling a function.
I have never been happy with Kotlin’s built-in version of the
Result type, anyway. Having to check if
isFailure, null-check if the success or failure value exists or use the
fold function seems archaic and not really necessary in neither Kotlin or Swift thanks to their generics. …
Over the past few months I’ve been working on porting one of my native iOS apps to Android, and I’ve been learning a lot about how Android works as a platform.
I’m now far along enough into development that I’m starting to work on refining the UI, and one of my challenges has been to create a bottom sheet where some UI appears to “stick” to the bottom.
After a bit of research I couldn’t find a simple solution so ended up coming up with my own. …
Let me start off by saying I absolutely love Swift Package Manager and I think it’s the future of dependency management on iOS, so-much-so I’ve written posts on what we can do with it.
But I also want to use this opportunity to highlight a potential risk with using it that I became aware of today. I initially thought there was no issue tracker for Swift Package Manager since there isn’t one in the GitHub repo, but I’ve since reported this issue on the Swift bug tracking Jira instance (SR-13346).
I’ve found a way to run any code I want when you use one of my Swift packages (providing you don’t check the Package.swift file before hand), and it’s a lot simpler than you might think. …