Reading time: 3 min
Here's a quick tip for resolving a common and annoying error that you'll occasionally see. The error message is
Function declares an opaque return type, but the return statements in its body do not have matching underlying types
and you can see it if you declare a function or a property that returns some View
and the body has multiple returns.
Star rating view in SwiftUI
Reading time: 1 min
This recipe shows how to implement a star rating view in SwiftUI.
Flow Layout / Tag Cloud in SwiftUI
Reading time: 2 min
A Flow Layout is a container that orders its views sequentially, breaking into a new "line" according to the available width of the screen. You can compare it to a left-aligned block of text, where every word is a View
. A common use for this layout is to create a tag cloud.
Reading time: 1 min
Here's a quick recipe for getting the key window, top or root View Controller, in a scene-based SwiftUI app.
Top Tabs in SwiftUI
Reading time: 1 min
This tutorial shows how to add Android-like top tabs in SwiftUI.