Tag: SwiftUI

Grid layout in SwiftUI

This article is about one of welcome additions to SwiftUI in 2020: LazyVGrid and LazyHGrid. As the name suggest, you can compose vertical and horizontal grid layout in a lazy way with those views. If you’re interested in lazy layout, check out my previous article on the topic. The sample project In this article I’ll

Continue Reading →

Infinite scrolling in SwiftUI

Using lists is very common in an iOS app. UITableViews are great and have been there from the very beginning, so you can find tons of articles about infinite scrolling. But what about SwiftUI?You don’t have UITableView, but you can use List. Although you can achieve a similar result you don’t have the concept of

Continue Reading →

Navigation in SwiftUI

Back in July I wrote a post about Navigation in SwiftUI trying to explain the difference between NavigationLink and DynamicNavigationDestinationLink. The latter has been deprecated, so the article is now useless, you can still find it here http://www.gfrigerio.com/navigation-in-swiftui-deprecated/I updated the repository on GitHub to remove the deprecated code and provide a few examples of various

Continue Reading →

CoreData in SwiftUI

One of the topics I wanted to explore about SwiftUI was how to integrate CoreData in it, and I want to describe two approaches you can follow: a direct one using property wrappers and another one by having a class hide the existence of Core Data to the user.I usually prefer the latter, as it

Continue Reading →

Progress bar in SwiftUI

Progress bars and activity indicators is something we tend to use a lot in iOS applications and it is nice to customise them instead of using all the time the standard UIActivityIndicatorView.I think SwiftUI makes it really easy to build this kind of views and I implemented 4 of them in my sample GitHub project

Continue Reading →

Navigation in SwiftUI deprecated

UPDATE: DynamicNavigationDestinationLink has been deprecated so most of this article is useless. I wrote a new one and updated the GitHub repository In this post I want to explain the difference between NavigationLink and DynamicNavigationDestinationLink in SwiftUI with a quick example and point out the differences between them.You can find the sample code on GitHub

Continue Reading →

SwiftUI on Apple Watch

SwiftUI was one of my favourite announcements during WWDC 2019 alongside Combine. At the time I’m writing this post, mid July, beta 4 has just been released and although it isn’t yet stable I think SwiftUI is starting to get interesting. I think it will be hard to drop iOS 12 support soon, but SwiftUI

Continue Reading →