Hi! Another short how-to on SwiftUI.

If you ever faced the question: “How to make SwiftUI view wrap its content?”. The answer is simple:

Text("Hello World!")
.padding(16)
.frame(
minWidth: 0,
maxWidth: .infinity,
minHeight: 0,
maxHeight: .infinity,
alignment: .topLeading
)

Such a modifier for Text view will make it wrap its content inside your view, no matter where you place it.

That’s it. Happy coding!

--

--

Hi, this is another short How-To article explaining how to fix empty initial screen opened on iPad.

I have faced the issue when developed an WidgetLingo app (https://apps.apple.com/us/app/widgetlingo/id1560884784) when app started on empty screen with back button in top left corner.

This issue usually reproduces when you use NavigationView as a root View. By default, navigation views appear with multiple columns in wider environments, like iPad in landscape orientation. So if you intend to have single column view you need to apply the following modifier to the NavigationView:

struct ExampleView: View {
var body: some View {
NavigationView {
EmptyView()
}
.navigationViewStyle(StackNavigationViewStyle())
}
}

That’s it. Happy coding!

--

--

Artem Mihelson

Artem Mihelson

Founder of Pills.Kit, Proximodoro and WidgetLingo apps