Search results for

swiftui

16,583 results found

Post

Replies

Boosts

Views

Activity

UIToolbar in SwiftUI?
I've been experimenting with SwiftUI and couldn't figure out how to get a simple UIToolbar to appear at the bottom of the screen.Basic view:struct MyView : View { var body: some View { NavigationView { List { NavigationButton(destination: Text(1)) { Text(Element 1) } // ... }.navigationBarTitle(Text(Elements)) } } }
4
0
8.5k
Jun ’19
SKStoreReviewController.requestReview(in:) and SwiftUI's Scene
In the latest iOS, the keyWindow automatic version of SKStoreReviewController.requestReview() got deprecated in favour of a new SKStoreReviewController.requestReview(in windowScene: UIWindowScene) version. Then, in the latest SwiftUI, the UIWindowScene got removed in favour of a new SwiftUI some Scene family. How do I efficiently tie the two together in a View without resorting to the key UIWindow?
2
0
3.7k
Jun ’20
SwiftUI. Is there a standard?
In iOS when a button can be actioned it is coloured accordingly so the user knows to tap. This is a standard across the platform. Is there a standard for long press gestures? In the case of swiftUI the 3D Touch/ long press can show a contextMenu. How best to indicate to a user to long press? Is there a standard colour for example to show when an element is to be long pressed?
2
0
833
Feb ’20
QLPreviewController with SwiftUI
I'm having a problem where any buttons won't be shown when displaying a QLPreviewController with swift. With .quickLookPreview() these buttons are shown, including share, done, annotation etcetera. The buttons are not shown when using QLPreviewController with SwiftUI, however if used with other UIKit they are shown. How to fix this? I'm not really looking forward in implementing all of the annotation functions and other QuickLook capabilities again. The ultimate goal of mine is to allow annotation and other pdf editing with the ability to save the file via the Done button, but on .quickLookPreview() the Done button displays Save to files and Discard and on QLPreviewController the button is not shown. The issue has been addressed on several forums, yet a solution has not been found. Reproducement in nutshell: new QLPreviewController conforming to UIViewControllerRepresentable display the QLPreviewController in SwiftUI view Thanks.
3
0
1.5k
Jul ’24
Port UIKit App to SwiftUI
I have an app made in UIKit with a deployment target of 9.0 which I would like to apply SwiftUI to. I would like my app to use SwiftUI while still being compatible with iOS 9.0 and later. Does anyone know how to achieve this, because SwiftUI is only in iOS 13.0 or later
2
0
876
Aug ’20
Unembed in SwiftUI
Friends, With ⌘+⇧+A we have access to Embed a SwiftUI view into an HStack, VStack, ZStack, List, or Embed/Wrap it into any other Container. The question is: How to unembed it? How to productively remove/unwrap a view from those containers without having to manually remove the brackets. Someone used to Flutter will understand what I mean.
0
0
500
Jun ’22
Swiftui Charts
I have a SwiftUI LineMark chart that inverts the y axis when the data the chart is plotting is all zeros. I'm expecting the y axis 0 to be at the bottom but when the data is all zeros it's at the top. Below is an example demonstrating the problem: import SwiftUI import Charts struct ChartView: View { let data: [Double] = [0,0,0,0,0] var body: some View { Chart { ForEach(data.indices, id: .self) { index in LineMark( x: .value(Index, index), y: .value(Value, data[index]) ) } } .chartYAxis { AxisMarks(values: [0, 10, 20, 30, 40, 50]) { value in AxisValueLabel() AxisTick() AxisGridLine() } } .padding() } } I can't use .chartYScale(domain: ) because it overrides the chartYAxis where the real code creates custom a leading and trailing y axis. Does anyone have any suggestions how I may fix this?
5
0
534
Feb ’25
Help with SwiftUI and UIKit Interjection
Hi, need some help with an iOS application we are trying to make future safe. Basically, we know that our app would require SwiftUI so the app is made in that framework, however we require some important elements that are available only in UIKit, so we've made a bridge that allows us to pass UIKit views to SwiftUI to display them. So most of the app actually has UI made in UIKit, however, we now need to use the Charts framework present in SwiftUI, we've used SwiftUI buttons in our UIKit before by passing them through a HostingController (Passing SwiftUI buttons to UIKit to use). And we are currently considering to the same for SwiftUI Charts. Just to recap, it's a SwiftUI iOS app, that is mostly made in UIKit (through a bridge) but also has other SwiftUI elements injected into it. What we want to know that, is this the best way to do this? Or is there a better way to have UIKit and SwiftUI work more comfortably with eachother. Th
1
0
362
Dec ’24