swiftui Questions

2

When I am using rotation3DEffect some times the vale became 90 or -90 degree which what I planed for that, as soon as my degree hit the 90 or -90, I see a massage in console like this: ignoring sin...
Extempore asked 3/2, 2021 at 16:13

4

Solved

I'm trying to have a vertically growing TextField in `SwiftUI but also have the software keyboard have a custom submission method. This uses the new functionality of iOS 16's TextFields being able ...
Lytton asked 3/2, 2023 at 2:47

2

Solved

SwiftUI List will automatically highlight the tapped row, iff there is a NavigationLink inside. Since I use SwiftUI embedded in UIKit via UIHostingController, I handle my navigation with a UINaviga...
Gambia asked 5/9, 2022 at 7:21

3

Solved

I like to recreate a toolbar similar to Apples Notes App using SwiftUI in a macOS app (I am using Xcode 12.3 and macOS 11.1): My attempt was to use a Navigation View to get the Master/Detail setup...
Litalitany asked 26/12, 2020 at 9:4

4

Solved

By default, on a macOS app using SwiftUI the window size is not restored after the window is closed. Is there a way to keep whatever size & position the user gave before closing the app. Essent...
Hale asked 17/3, 2022 at 2:30

1

Solved

Starting from this example: Two views in a VStack, coming and going with a different transition: struct ContentView: View { @State var value = false var body: some View { VStack { ZStack { v...
Diba asked 29/8 at 9:45

5

Solved

Right now, I am in the process of converting from UIKit to SwiftUI. In UIKit, there is a native Close, X-Styled Button - UIButton.ButtonType.close, like shown below: I wanted to find the equivalen...
Xanthene asked 10/8, 2022 at 8:4

1

I've historically used the WKInterfaceController's property called "crownSequencer" to listen to rotations in the crown (see code below). I can grab the "rotationalValue" of the...
Catnip asked 12/10, 2022 at 12:31

2

Solved

If I create a Menu in SwiftUI (iOS), I cannot set the color of the Buttons inside, e.g.: Menu("Actions") { Button(action: { }) { Label("Whatever", systemImage: "pencil&qu...
Dibbuk asked 18/2, 2021 at 11:56

2

Solved

Text jumping (I don't know how else to name that weird behavior) to the top(?) every time user enters a new character. I can reproduce the issue only on iPad OS 16. It affects the user who attempts...
Highhanded asked 3/2, 2023 at 11:22

2

Solved

I'm trying to implement a custom context menu that will appear after a long press at the location the user touched. I have been unable to find a way to capture the XY location of a touch down event...
Mischance asked 10/7, 2020 at 15:40

2

Solved

I'm trying to use SwiftUI's viewAligned scrollTargetBehavior for a ScrollView where scrollTargetLayout subviews are irregular in size. Here's an example, which I've simplified for the purpose of il...

3

How do I create a local variable with specifically the dark mode color in SwiftUI. I am trying to avoid specifying the color scheme of each view to be dark to get the dark mode color. For example i...
Welcy asked 14/7, 2021 at 0:42

6

Solved

I'm interested in 2-finger swipe ( scroll ) gesture. Not two-finger drag, but 2-finger swipe (without press). Like used in Safari to scroll up and down. As I see noone of basic gestures will work f...
Karafuto asked 10/2, 2021 at 13:16

3

I'm desperately trying to change the aspect ratio of an image to 16:9 without stretching it. .aspectRatio(16/9, contentMode: .fill or .fit) isn't usable because it's pure garbage (no one on Earth w...
Ambsace asked 20/4, 2023 at 16:25

5

Solved

In SwiftUI, if I have a weblink in between a string, how can I create a hyperlink and have it underlined in my view. Note, the "messageContent" string won't always be the same. For exampl...
Sheldon asked 19/3, 2022 at 19:34

5

Solved

Aim: I have a swiftUI app that uses Window scene When the user closes the red window, I would like call f1() My attempt: onDisappear doesn't seem to be called when user closes the macOS app windo...
Stayathome asked 22/2, 2023 at 12:15

3

Solved

I have a SwiftUI List with a background. In iOS 13 I was successful in making the List transparent, so that the background will show through, by setting UITableView attributes in an init(). With iO...
Deplume asked 17/9, 2020 at 22:38

2

Solved

I have NavigationStack with its own navigation links, for iOS16 development. How to change the default slide transition to appear or a custom transition? Also do you apply the transition on the Nav...

2

I trying to make keyboard extension on SwiftUI. My keyboard uses gestures a lot. But gestures up from keys located near the screen bottom are to be recognized as a system gesture. As it was said he...
Enhanced asked 15/4, 2020 at 11:51

2

Solved

Prior to iOS 17, I was used to creating SwiftUI views with a generic approach where a view is constrainted to one view model, and that ViewModel can be a protocol. This was very nice for testing an...
Attlee asked 10/1 at 16:32

4

I am trying to display a two column NavigationView in my app exactly like the settings on the iPad. With no way to collapse the sidebar on an iPad. I would have thought using a NavigationView with ...
Pakistan asked 30/1, 2023 at 11:3

2

I spent a few hours trying to get rid if this error message on my app: List with selection: SelectionManagerBox<String> tried to update multiple times per frame. It is a macOS 14 app. As I w...
Barnet asked 3/10, 2023 at 19:59

2

I am using SwiftUI. I want to open a specific screen other than Root View by clicking the push notification. There are several ways to open it using StoryBoard, but not without StoryBoard. How ca...

3

Solved

I am trying to access variables that are marked as @State in a view from the view that calls that view. These variables in the child view are hooked up to a text box. If I type in that text box and...
Dulcet asked 1/8, 2020 at 20:26

© 2022 - 2024 — McMap. All rights reserved.