Search results for

swiftui

16,581 results found

Post

Replies

Boosts

Views

Activity

Random SwiftUI crashes
Hi! I write a time table like app where entries on a day planner are created and modified. It works well but since the latest additions I get random crashes after clicking an UI control. Any clue how to debug such an issue? The crash log looks like this: Code Type: ARM-64 (Native) Parent Process: launchd [1] OS Version: macOS 13.3 (22E252) Report Version: 12 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x000000019472f6f4 Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5 Terminating Process: exc handler [2623] Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libswiftCore.dylib 0x19472f6f4 _assertionFailure(_:_:flags:) + 188 1 libswiftCore.dylib 0x19488f8d4 KEY_TYPE_OF_DICTIONARY_VIOLATES_HASHABLE_REQUIREMENTS(_:) + 208 2 libswiftCore.dylib 0x1947d8868 _NativeDictionary._unsafeInsertNew(key:value:) + 316 3 libswiftCore.dylib 0x194890b08 _NativeDictionary.extractDictionary(using:count:) + 740 4 libswif
5
0
1.5k
Mar ’23
touchesMoved in SwiftUI?
Hi,Is there an equivalent to UIKit's `touchesBegan`, `touchesMoved`, etc., in SwiftUI?If I want to create an advanced custom view, with the exact kind of interaction that I envision, in UIKit I'd implement `touchesMoved` and friends, keep some state machine in my view, and draw things in `drawRect`. I understand that in SwiftUI you can replace `drawRect` with `Shape`s. But what about the low level touch handling?
5
0
2.6k
Oct ’19
SwiftUI + Metal
is there a complete tutorial or example on how to integrate Metal with SwiftUI? There only seems to be some scattered questions and answers around the web about this subject.
4
0
5.4k
May ’20
ConnectSDK and SwiftUI
I'm trying to call Objective-C methods from SwiftUI. I have a bridging header with a number of imports from the SDK. Now, I'm trying get the ConenctSDK's devicePicker to display, but I'm stuck trying to get that to work. I'm coming back to Mac after a number of years and have just started using SwiftUI. With said, here is my code so far: import SwiftUI import ConnectSDK struct ContentView: View { class ConnectSDKHelper { func showDevicePicker () { let dm = DiscoveryManager.shared() dm?.startDiscovery() dm?.devicePicker() } } var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundColor(.accentColor) } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }' From googling, I determined that I need a 'help' class, ConnectSDKHelper. Not sure if it's correct, but if it is. I'm not sure how to apply it. All help appreciated.
0
0
591
May ’23
UIKit in SwiftUI
I am new to SwiftUI so wanted to ask, What's the difference when we use protocol UIViewRepresentable vs UIViewControllerRepresentable ? Can somebody explain with example Thanks in Advance
0
0
452
Oct ’20
SwiftUI Accessibility Inspector?
Please excuse me if this is obvious. I'm new to Apple development. Is there a SwiftUI Accessibility Inspector? I run the standard one, in Xcode 26b3, and it shows me warnings for things that I didn't create in SwiftUI. I presume that SwiftUI is primarily implemented using macros and that these things are either generated or boilerplate lower-level things. But if so, then why would they trip Accessibility Inspector warnings? Is there something I can do from SwiftUI to clear them? Or... is there a demangler somewhere that will translate from these names into something this human might recognize? I'm targeting macos, btw, if that makes any difference.
1
0
1.3k
Jul ’25
Speech in SwiftUI
Hello,I recently discovered SwiftUI and I would like to use it with Speech but I can not integrate it into my project.Someone would have a solution?Thank you in advance for your help.
0
0
616
Aug ’19
Airplay swiftUI
So we have a media player in our SwiftUI app, and all the buttons go to the media function to play, pause , rewind etc. One feature people are requesting is the ability to airplay to other devices. I know they can do this via the Lock Screen and the notification bar, but wondering what function do I need to add to the media-player function to allow me to add a button to my swiftUI. I am wondering what function code do I need to add to my core mediaplayer.swift file that I can link a button too.
1
0
1.4k
Aug ’22
How To Loop Video In SwiftUI
Anyone got sample code for using AVPlayerLooper in SwiftUI? Code i see are not for SwiftUI I only wish to have the option to turn on auto-repeat on and off. I could use AVQueuePlayer as replacement for AVPlayer but it does not have a way to loop. So these are what I am looking for Loop video in SwiftUI If Using AVPlayerLooper, it has a disableLooping() function (possibly to turn off looping). But how can it be turned back on? There is no enableLooping(). Or does it need a new instance? since i am new to iOS, the code there are all linked to no swift ui code so I have no clue (sorry) the equivalent of them in SwiftUI Thoughts?
2
0
4.3k
Nov ’22
Architecture in SwiftUI
Hello all, I’m wanting to get your take on how SwiftUI’s data flow can change how we architect our apps? It seems as if, with EnvironmentObjects, ObservableObjects and possibly more, they change where you get your data from, which could cause variations in, let’s say MVVM. What do you think is a good way to make use of these property wrappers and could it change how we architect things? I created a SwiftUI flow that i think could be beneficial for my team and it leverages wrappers. The thing is, it’s difficult convincing others (who aren't iOS Developers) that it could work, since this is how SwiftUI handles data flow. Possibly this discussion could help me win them over. I've created a chart that I think could benefit at least our team and it leverages the use of property wrappers for data flow, maybe I can get some feedback on it, thanks!
0
0
1.2k
Jun ’22
Disappointment with SwiftUI
I hope I'm not wasting space here, but I just want to express how SwiftUI is only a replacement if you do without many UIKit features. For example, I want to enable hidesBottomBarWhenPushed. This feature does not exist for SwiftUI tab view. The answer is to figure out some way to do this in a custom way. It's just that I have to hold back my progress when converting my UIKit app to SwiftUI. I hope this gets somewhat easier with experience. I mean we know that the navigation isn't connected the same way as UIKit, so some things we just have to let go perhaps. You get some big wins (a simpler way to layout) but then when you hit a stopping point with the UI - Another example, I couldn't figure out with MapView for something familiar and well documented in UIKit. So what did I do? Of course - wrap it in another UIViewControllerRepresentable.
1
0
552
Mar ’24