SwiftUI fullscreen on Apple Watch - swiftui

Is it possible to use full screen on Apple Watch (except the time display) using SwiftUI?
I have set .edgesIgnoringSafeArea(.all) on various view and the result is the same. Top left corner is not usable.

Related

Is there a way to detect if the resize gesture in the bottom right corner (on Apple Silicon, iPadOS 16) is active?

On iPadOS 16, running on Apple Silicon, windows can be resized by dragging at the bottom right corner. This interferes with any long press gesture you might have yourself on something in this area.
I am looking for a way to know if this gesture is active to avoid putting something into this area.

Declare bottom zone in a SwiftUI navigation sidebar below a list

In the below screenshots (taken from the Apple Developer app), we can see that the Account button sticks to the bottom of the sidebar.
When the window is tall enough (left), the list doesn’t scroll, Account button’s background color has no difference. When the window is not tall enough (right), causing the list to scroll, Account button changes its background color to reveal the relationship.
The list's scroll position can not be probed. How can I declare the Account button in SwiftUI?
That app is a UIKit catalyst app and the sidebar uses scrollViewDidScroll which uses the contentSize to set a bottomButtonState which is passed into a child UIHostingController (so the account button can be SwiftUI) which I would assume switches between a clear or solid background.
We cant get the scroll info in SwiftUI however a possible workaround would be to add dummy 1 pixel high cell to the bottom of the list and using its onAppear to set a binding that is used in a bottom view to enable/disable a background colour and should achieve the same effect.

Change Title Bar Colour SwiftUI (No NavigationView nor .ignoresSafeArea())

There are two solutions I have seen can be used to change the colour of the title bar in SwiftUI:
Making the use of NavigationView
Ignoring the sage area with .ignoresSafeArea()
I have no use for a NavigationView nor I want to use .ignoresSafeArea() since it helps on giving the TabView bottom tab space.
The only requirement to the solution I am looking for is that it cannot be for iOS 16 and above only, since it will not be viable to use in production for at least the next two years.
TL;DR:
I need to change the colour of the title bar (the upper-most part of the app) with features available in versions prior to iOS 16, and without the use of NavigationView and .ignoresSafeArea()
The white stuff in this image:

SwiftUI - TabView Light Mode UIColor Appears in Preview, not in Sim or Device

I am using Swift 5.3 on MacOS 11.01 and created a new "Multiplatform" app for iOS 14.2. I created custom color assets for light/dark modes but am having trouble getting the light mode background color to show on my TabView. The TabView dark mode background color appears just fine.
The light mode background color appears perfect in Xcode Preview, but when I run the app in the Sim or on my device, the Tab Bar background color is clear in light mode, but shows the correct color for dark mode.
I use the same color assets for coloring my NavigationView and both the light and dark mode colors appear correctly when the corresponding modes are selected.
Is there something obvious I am missing here with the latest SwiftUI 5.3 and color assets?
I am using the following code within .onAppear in the TabView
UITabBar.appearance().barTintColor = UIColor(named: "barBackground")
Note that "barBackground" is the custom color set I created to add a light/dark mode background colors to both the NavigationView and TabView.
Happy to furnish additional info if this isn't clear. Thanks!
It is a bit late to do it in .onAppear, appearance should be changed definitely before affected view is created, so do it in init
init() {
UITabBar.appearance().barTintColor = UIColor(named: "barBackground")
}

SwiftUI fullscreen horizontal swipe with dot indicator

Many apps have an intro view that has fullscreen pages with a dot indicator at the bottom. Sometimes it is used to gather same basic information, sometimes to introduce the app features.
How can I realize that?
I tried the ScrollView with a horizontal setting. The issue is to set up the content to fit the screen and have the edges snap on scroll. Second issue is the have a dotted indicator that highlights the current page.
you need to wrap UIPageControl with UIViewControllerRepresentable.