Changing Order For First Responders in SwiftUI TextFields - swiftui

I am working on a crossword app.
I have a SquareView that contains a Text and TextField, to show the number and letter for a particular square.
A 2D array of those SquareViews forms the grid of the puzzle.
I can navigate back and forth horizontally through the TextFields using the tab key, and all the highlighting works (current square yellow, adjacent answer squares blue, all others white or black).
My problem arises when I want to toggle navigation, to move vertically. I thought that the order in which TextFields were navigated depended on the order in which they were added, so I toggled between a VStack of HStacks (across clues, running horizontally) and HStack of VStacks (for down clues, running vertically). Nope. SwiftUI always moves from left-to-right, top-to-bottom. How can I change this? I learned from this forum about Introspect, so I can access each TextField's underlying UITextField and change ... it's color 😀, but that's not what I need. I need to be able to change order in which first responders are chosen.
Any assistance would be most welcome!

Related

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.

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.

How to add a scroll bar at the move list view? And user can only scroll specific area vertically

I am using MVC for my project. And I have few views in View. However, I want to know how to add a scrollbar to one view and only make that part can be scrolled vertically.
I have tried using CreateWindowW() for adding WM_VSCROLL parameter, but it does not work.
This is a TUI application, so I think the professor try to make us using a cell as bar, so you can scroll the cell up and down
In PreCreateWindow(CREATESTRUCT& cs), set cs.style |= WS_VSCROLL;.
You may have to respond to WM_VSCROLL to process scroll messages.
Sorry for the confusing. I am resisted to use TUI only. And I misunderstood what the professor needed. So he wanted us to move a color cell so you can scroll up and down for checking player's moves. I am making a Gomoku Game by using C++. So I figure it out, right now my move list view can move up and down for viewing full moves. Thanks for all the answers
enter image description here

Is it possible reverse the scroll position in a scrollview so it scrolls from the bottom up?

Is it possible reverse the scroll position in a scrollview so it scrolls from the bottom up?
It would be helpful to do this because it would allow me to lay the scrollview flat and stand the surfaces up and still have the first surfaces at the front.It's a bit hard to explain so I have this image Basically I am trying to scroll through these surfaces like a filing system. Is there perhaps a better way to simulate this?

Roku-Create Selectable List

I am in the process of making a Roku channel. The idea is to have a full screen player going, if the user presses a particular button on remote, a small pop up menu will display in a corner of the screen with a list of available channels. I have all working with the following exception: I can't figure out how to populate the area where the menu displays. Currently I have a transparent roImageCanvas on layer 1, the menu box is drawn on layer 2. The problem is that roImageCanvas allows for a text element but only one Item. So if I have a list of 10 channels, I would have to create 10 items on the canvas. The roImageCanvas does not accept arrays. So there is no way to create the pop menu on the fly if the number of channels changes. The number of items on the canvas has to be hard coded as far as I can tell. Ideally the roListScreen is what I would like to pop up but from what I understand all screens are full screen all the time. Does anybody know of a way to populate the targetbox on the canvas or create a screen that is resizable? Thanks for any suggestions
A roImageCanvas layer is an array. There is no technical limitation to you adding >1 elements to a layer and so you can add as many separate text items as you want (not hard-coded!). It seems to me best to have 1 text element per 1 menu item, so you can use their bounding rectangles (or text color) to highlight the choice