I dont want to do differently. > Then you cannot achieve what you want.
Post
Replies
Boosts
Views
Activity
OK. Tell us if it is too difficult for you to find a way doing things without passing a View.
Thanks. Seems you are passing an instance of OnboardingView to a method !!! As you know, in SwiftUI, View is a struct -- value type, and passing or assigning a view would cause any unexpected behavior and that is one thing you should never do. You may need to find a way to achieve what you want without passing a View.
Thanks for showing the stack trace. (If it was formatted properly, it would be better.) It shows that it is not a simple recursion thing and is very likely related to SwiftUI things. You may have broken some restrictions of SwiftUI (unfortunately, many of them are not documented clearly) or it may be a bug of SwiftUI. Which is the view causing this crash?
What sort of apps are you developing? The dev forums is a site for developers to talk about developing apps.
When you show your code, please show it as text using Code Block.
Better start a new thread with clarifying what you want to achieve.
Visit Mac App Store with your Mac.
You said toHex() was the method you wanted and I have shown one solution. That is the end of the topic of the thread. If you want to ask another question, you should start a new thread for that topic. Please include YOUR code when you start a new thread.
That is not you should look for. What you should look for is the difference of binary data treatment between Swift and PHP.
You may need to decide which data type you should return: a binary data (Data is preferred in Swift) or a string? you need to define how you embed binary data into String.
I think you do not know how to manage concatenating Strings and binary data. No directly exchangeable functionality can be created in Swift as Swift does not have a concept of binary string!!! Do you understand?????
Then you need to define how you embed binary data into String.
Do I need to repeat? There is NO binary string in Swift.
OK. toHex() is this method. The code does not have enough doc nor type hints. But according to the doc of pack(), It is expected to return a binary string. The concept of binary string does not exist in the Swift language. You may need to decide which data type you should return: a binary data (Data is preferred in Swift) or a string?