SwiftUI NavigationBarItem Hover Effect on iPadOS - swiftui

When using UIKit, the UIBarButtonItems automatically get support for the highlight hover effect when using a pointer in iOS 13.4+.
After updating some views to use SwiftUI, the equivalent NavigationBarItem modifiers do not have a highlight hover effect. Is this a bug, not supported, or implemented in a different way?

Related

.tabViewStyle with animated swiping of tabs

Is it possible somehow to use the .tabViewStyle(.page) for animating swiping between tabs but with a look as the default style?
Basically I want the animated tab swiping but not the tiny centered tab icons that comes as a side effect of using .page instead of the default TabView.
The page feature seems more for swiping similar objects, not different tabs, but the swipe animation looks great, which is what I'm after.
Thanks!
Marcus

SwiftUI fullscreen on Apple Watch

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.

How to customize the gesture recognizer automatically added by SwiftUI .onDrag?

Is there any way to customize the gesture recognizer used by .onDrag() in a SwiftUI View? The developer documentation states "applying the onDrag(_:) modifier adds the appropriate gestures for drag and drop to this view" but is silent, so far as I can see, as to how to alter the behavior of those gestures. Those gestures wait for a longpress before initiating the drag. I would like to reduce that delay to zero.
Why Required
The app currently uses a custom DragGesture and .offset(value) to effect a drag. This strategy requires that the view in which the drag initiates have a greater .zIndex than any view over which an item might be dragged. Since drags can begin in different views, the .zIndex for each view is managed programmatically through ternary operators.
The .onDrag() functionality puts the dragged item on top of all views regardless of .zIndex. This behavior is now required due to implementation of a magnification gesture, which requires that the magnified view have a .zIndex below that of the other views or it will cover them as it expands. If the magnified view is then the source of a drag, the required .zIndex behaviors (high for drag, low for magnification) are incompatible.
I tried using .clipped() on the magnified view, but that prevents the dragged item from appearing outside of that view.
Apple developer support responds that there is no way to customize the gesture recognizer automatically added by SwiftUI to .onDrag()

SwiftUI TextField does not work after adding gesture

After adding a combined gesture to a view, a TextField inside the view would no longer respond when I would tap into it to change the text. I discovered this after adding a custom combined gesture - where I used a long press to start things before dragging. (Note: things still worked if just a drag gesture was added. Not sure what is particularly different between these two cases.)
The combined gesture:
let combined = longPressGesture.simultaneously(with: dragGesture)
The gesture was added to the view with:
.gesture(combined)
I got things to work by adding an onTapGesture{} to the TextField. Didn’t have to put anything into the action. Seems like a side effect whose behavior could change in the future. Appreciate any comments on if this makes sense or other ways to handle.
TextField(“Enter Text”, text: $myText)
.textFieldStyle(RoundedBorderTextFieldStyle())
.onTapGesture {}
In case one would have this issue with a drag gesture, you can set the minimumDistance. This would still register the tap on the textfield to edit it.
DragGesture(minimumDistance: 30, coordinateSpace: .global)
Adding a drag gesture in SwiftUI to a View inside a ScrollView blocks the scrolling

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.