Search results for

swiftui

16,583 results found

Post

Replies

Boosts

Views

Activity

SwiftUI with debugQuickLookObject?
A great while ago I learned about the debugQuickLookObject function and my imagination went wild with convenient uses for it while debugging. Recently I remembered it vaguely and tried to find documentation for it and found it quite difficult to locate. I did find this old documentation: https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/CustomClassDisplay_in_QuickLook/CH01-quick_look_for_custom_objects/CH01-quick_look_for_custom_objects.html and this: https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/CustomClassDisplay_in_QuickLook/CH02-std_objects_support/CH02-std_objects_support.html#//apple_ref/doc/uid/TP40014001-CH3-SW1 but nothing showing usages of it in Swift. The most recent example I could find was a hackingwithswift post with a single usage of it to display a string. I was really hoping that I could get a SwiftUI view to show up using it since it is supposed to be able to display UIViews but I couldn't even get a UIView to show up. Long story s
0
0
861
Jun ’20
tvOS SwiftUI and focus
Hi all, I can't find anything similar to UIFocusGuide in SwiftUI documentation. Without something similar to UIfocusGuide I don't see how to manage focus on tvOS with complex app ... Is there something that I missed or SwiftUI currently not useful for tvOS production applications?
0
0
584
Sep ’20
SwiftUI and vars outside the SwiftUI world
We inherited some code that has a variable that begins in the SwiftUI world, so to speak, and is copied over to a global variable in the Swift world for use in non-SwiftUI classes (POSOs? Plain Ol' Swift Objects?). Here's a contrived example showing the basic gist of it. Note how there's an AppViewModel that maintains the state, and an .onChange that copies the value to a global var, which is used in the plain class DoNetworkStuff. I would like to weed out the redundant global var, but I kind of see why it was done this way--how DO you bridge between the 2 worlds? I don't think you can add a ref to AppViewModel inside DoNetworkStuff. I was thinking you could add a function to the AppViewModel that returns devid, and stash a ref to the function in a var for use whenever devid is needed., so at least you're eliminating the var value being stored in 2 places, but that might be confusing a year from now. I'm trying to think of a way to rewrite this without ripping out too much code (it could be
5
0
2.7k
Dec ’23
How to Remove OpaqueTypeErasure from SwiftUI
I am using swiftui lately in my iOS mobile app, The Mobile app already has a pipeline that detect any experimental features and throw an error I am using swift 5 and as you all know SwiftUI is using some of OpaqueTypeErasure utility types like some I heard that in swift 6 the OpaqueTypeErasure is not experimental anymore But upgrading the app swift version will be a very long process Also changing the pipeline will be a very long and tiring process So i want to know if there is a way to remove OpaqueTypeErasure from SwiftUI and what is the alternatives for bypassing the error that being thrown from the pipeline
3
0
716
Nov ’24
SwiftUI view and BodyTrackedEntity
In my project I have a SwiftUI that embeds the UIViewController for the body tracking example. This all compiles and runs fine on my iPad.However in my project I have other SwiftUI views. When I am trying to view them in the SwiftUI preview window (I am also on Catalina 10.15 beta 3) it is not able to display this view, even though it has absolutely nothing to do with the BodyTracking example it still complains about this file and displays the message Use of undeclared type 'BodyTrackedEntity' .I have even commented out the PreviewProvider for the BodyTracking view and it still has this error.My guess is that there is an issue with XCode 11 Beta 3 when trying to preview views it looks through every view and compiles all of them to see if they are correct, but it shoud only care about the one I have selected. Also it should know that the BodyTracking code won't work and simply ignore is warnings.Anyone else having these kind of issues when trying to make a SwiftUI based proj
2
0
1.8k
Jul ’19
Is SwiftUI usable?
Having spent 3 months writing a complex macOS UI to monitor and control a remote server in near real time, I think not. There are hundreds of memory leaks rendering the application unusable after only a few minutes of use. I won't be alone in saying SwiftUi is not fit for purpose.
3
0
1.2k
Aug ’21
MapKit SwiftUI
Hi I'm trying to use MapKit with SwiftUI and it seems like I can't display one Map Marker in detailView as Map takes an array of annotations but I just want to show one is it possible ? I am attaching the mapView as a card in a detail view to show the location of one specific property
1
0
542
Apr ’21
Alternative to segue in SwiftUI
So I'm transfering from using the interface builder to using SwiftUI and had a major question: How do we do the same thing we did with segues with SwiftUI? For example just two different views with a button that will send you from one ContentView to another? Sorry this is probably a very basic question but I haven't been able to find any simple solutions to this. Thanks!
1
0
7.1k
Sep ’19
TabView in SwiftUI
I'm using SwiftUI. I want a child view that comes from a tab page to use all the screen, that is to say, to temperarily cover the entire tab bar. How should I do this? What code do I need?By the way, when I use a List, how to delete the line that seperate cells?thank you!
0
0
528
Oct ’19
Storing SwiftUI Views to operate on it
I am creating a UIKit application but that contains SwiftUI Views embedded using the hostingcontroller. I have a particular approach for it..but it requires instantiating a swiftUI view, creating a hostingcontroller object from it and storing a reference to it. So that later If I wanted to update the view, I can simply get the reference back and update the swiftUI view using it. I wanted to understand what does apple recommends on this. Can we store a swiftUI instance? Does it cause any issue or it is okay to do so?
0
0
433
Nov ’24