Post

Replies

Boosts

Views

Activity

Reply to Binding of an array element property inside a struct not working anymore
You don't show enough code (eg, ContentView) to find out what is the problem. Card is not ObservableObject. That may be the cause of the problem. Try to make it a class and ObservableObject. 2 more comments: why don't you use environmentObject for deck, instead of all the bindings ? in Xcode16, observable is much easier to use than ObservableObject. If needed, get details here: https://medium.com/@vladislavshkodich/remove-observableobject-from-your-swiftui-model-cb455e9572ef
Topic: UI Frameworks SubTopic: SwiftUI
Nov ’24
Reply to Can someone help me fix my xcode.
I was looking for User definition. It is a Firebase class, should be this one: https://firebase.google.com/docs/reference/swift/firebaseauth/api/reference/Protocols/UserInfo.html I suppose error is here: let updatedUser = User( coder: <#NSCoder#>, id: userId, name: name, email: email, phoneNumber: phoneNumber, profilePictureURL: nil, bio: bio ) why do you include coder here ? And what does <#NSCoder#> mean ? Where did you get it ? I understand you have several init for User: either with coder public required convenience init?(coder: NSCoder) or direct declaration with all the properties. So, you'd better study carefully FireBaseAuth documentation.
Nov ’24
Reply to How to break `while` loop and `deliver partial result to `View`?
You don't show how the view uses the result. That should help. I would do it with recursively calling iteration steps. In the View, as an action for a button, call simulation() This function is defined as func simulation() { let numberOfStep = 100000 // any very large number runSimulation(in: stopped.atStep..<numberOfStep) } The trick is that in runSimulation(), you call calls it recursively func runSimulation<T: Sequence>(in sequence: T) where T.Element == Int { // execute one step of the loop runSimulation(in: sequence.dropFirst()) // call recursively } stopped is a state var @State var stopped : (on: Bool, atStep: Int) = (on: false, atStep: 0) atStep is the value (loop index) at which you may have stopped with another button action in the view, which let's you resume where you stopped if you want with a resume button. Note that in your case, you could do it by chunks of 100 steps instead of individual steps, so the number of steps would be 1000 instead of 100000 for instance. Much more detailed explanation here: https://stackoverflow.com/questions/64202210/dispatchqueue-main-asyncafter-not-delaying Hope that helps.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’24
Reply to Looking for suggestions on writing a spreadsheet type app
The UI part is essential. I remember in the old ages the Jazz spreadsheet on Mac was a complete mess, because it did not exploit the Mac UI capabilities. Where Excel did it excellently. I understand it is for your personal use ? A full fledge spreadsheet is a huge endeavour. Beyond an individual capability (specially if you're a beginner on Mac development), unless you limit yourself very strictly (aka VisiCalc if you remember, plus some specific capabilities to handle functions you think of). As for the language, I would suggest Swift.
Nov ’24
Reply to Binding of an array element property inside a struct not working anymore
You don't show enough code (eg, ContentView) to find out what is the problem. Card is not ObservableObject. That may be the cause of the problem. Try to make it a class and ObservableObject. 2 more comments: why don't you use environmentObject for deck, instead of all the bindings ? in Xcode16, observable is much easier to use than ObservableObject. If needed, get details here: https://medium.com/@vladislavshkodich/remove-observableobject-from-your-swiftui-model-cb455e9572ef
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Nov ’24
Reply to Can someone help me fix my xcode.
I was looking for User definition. It is a Firebase class, should be this one: https://firebase.google.com/docs/reference/swift/firebaseauth/api/reference/Protocols/UserInfo.html I suppose error is here: let updatedUser = User( coder: <#NSCoder#>, id: userId, name: name, email: email, phoneNumber: phoneNumber, profilePictureURL: nil, bio: bio ) why do you include coder here ? And what does <#NSCoder#> mean ? Where did you get it ? I understand you have several init for User: either with coder public required convenience init?(coder: NSCoder) or direct declaration with all the properties. So, you'd better study carefully FireBaseAuth documentation.
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to break `while` loop and `deliver partial result to `View`?
It is difficult to guess the overall structure of your code. Is DotGenerator calling ContentView ? Did you look at the solution I proposed ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Trailing closure passed to parameter of type 'String' that does not accept a closure
That's not a good way to ask a question, just formulating the error in the title. Where do you get the error precisely in your code ? We cannot guess.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Can someone help me fix my xcode.
Welcome to the forum. Please show the complete code. How is User defined ? It seems you forgot a closing parenthesis, isn't it ?
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to break `while` loop and `deliver partial result to `View`?
You don't show how the view uses the result. That should help. I would do it with recursively calling iteration steps. In the View, as an action for a button, call simulation() This function is defined as func simulation() { let numberOfStep = 100000 // any very large number runSimulation(in: stopped.atStep..<numberOfStep) } The trick is that in runSimulation(), you call calls it recursively func runSimulation<T: Sequence>(in sequence: T) where T.Element == Int { // execute one step of the loop runSimulation(in: sequence.dropFirst()) // call recursively } stopped is a state var @State var stopped : (on: Bool, atStep: Int) = (on: false, atStep: 0) atStep is the value (loop index) at which you may have stopped with another button action in the view, which let's you resume where you stopped if you want with a resume button. Note that in your case, you could do it by chunks of 100 steps instead of individual steps, so the number of steps would be 1000 instead of 100000 for instance. Much more detailed explanation here: https://stackoverflow.com/questions/64202210/dispatchqueue-main-asyncafter-not-delaying Hope that helps.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to I want to report a Apple bug in call recording feature during facetime audio call
To report a bug, use the Feedback assistant.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Request to Fix Game Mode and Crash Issues in Call of Duty Mobile on iPad Pro 2022
That's not a question for developers forum, as it is not a question about your own development. You'd better ask either on: the game developer or its forums Apple Support Community: https://discussions.apple.com/welcome
Replies
Boosts
Views
Activity
Nov ’24
Reply to Looking for suggestions on writing a spreadsheet type app
The UI part is essential. I remember in the old ages the Jazz spreadsheet on Mac was a complete mess, because it did not exploit the Mac UI capabilities. Where Excel did it excellently. I understand it is for your personal use ? A full fledge spreadsheet is a huge endeavour. Beyond an individual capability (specially if you're a beginner on Mac development), unless you limit yourself very strictly (aka VisiCalc if you remember, plus some specific capabilities to handle functions you think of). As for the language, I would suggest Swift.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Fix the problem
In addition, this is not a question for the developers forum. It would be much more appropriate to post on Apple support community.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to My app's direct distribution is stuck at "In progress"
Welcome to the forum. You must have seen intermediary status during archiving. What were they ? At which step exactly are you blocked ? Did you get network connection issue ? You can always delete the archive and create a new one.
Replies
Boosts
Views
Activity
Nov ’24
Reply to SwiftUI View cannot conform custom Equatable protocol in Swift 6.
I tested your code in Xcode 16.1ß3 (Swift 6.0.2). It apparently works. I even tested with return lhs.count == rhs.count && lhs.title == rhs.title Could you show complete code to reproduce ? Where exactly do you declare MyView ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to App behavior changed under Sequoia 15.1.
Unfortunately, I can't tell if anything changed. But if you ask each subview to be visible, do you get them ? Or try (I did not test) to makeKeyAndOrderFront, with something like: theWindow.subview1.makeKeyAndOrderFront(theWindow.subview1)
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to No ObservableObject of Type "" found.
The problem is that you use @environmentObject inside a class and not a View. It is not allowed to do so. A solution here: https://stackoverflow.com/questions/65370698/how-to-access-a-global-environment-object-in-a-class
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Deleted Playground on Accident
What is exactly the name of the app you deleted ?
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Nov ’24