Post

Replies

Boosts

Views

Activity

Reply to How do I use "views" and structures / what's wrong with my code?
what's wrong with my code? Sorry to say, nearly everything. There are so many errors everywhere. You should start studying Swift first. As DarkPaw said, AI (ChatGPT or other) does not replace plain intelligence. It seems you don't even understand your own code, isn't it ? There are even many typos in code: extra } Balls[].xPosition is wrong syntax. What do you mean here ? The problem for the error message (there are likely many other) is you call for item in Balls You have to use ForEach in a view. In addition, Balls is not an array, even less an instance of array. And View struct should be outside of the class. Otherwise, how do you plan to access it ? Here is a start to correct those many errors: class Balls: Identifiable { //var color: String var xPosition: Int var yPosition: Int var xVelocity: Int var yVelocity: Int var radius: Int var gravity: CGFloat var restitution: Int var other: Balls? init(xPosition: Int, yPosition: Int, xVelocity: Int, yVelocity: Int, radius: Int, gravity: CGFloat, restitution: Int) //ADD COLOR { //self.color = color self.xPosition = xPosition self.yPosition = yPosition self.xVelocity = xVelocity self.yVelocity = yVelocity self.radius = radius self.gravity = gravity self.restitution = restitution } } struct UserView: View { let ball1: Balls = Balls (xPosition: 100, yPosition: 100, xVelocity: 3, yVelocity: 0, radius: 3, gravity: 0.3, restitution: 1) let ball2: Balls = Balls (xPosition: 200, yPosition: 50, xVelocity: -2, yVelocity: 2, radius: 3, gravity: 0.3, restitution: 1) let ball3: Balls = Balls (xPosition: 300, yPosition: 150, xVelocity: 4, yVelocity: -3, radius: 3, gravity: 0.3, restitution: 1) var timer = Timer.publish(every: 0.01, on: .main, in: .common).autoconnect() @State var balls: [Balls] init() { balls = [ball1, ball2, ball3] } var body: some View { VStack { //Background color Color.gray.edgesIgnoringSafeArea(.all) //var balls [Int] = [ball1; ball2; ball3] // for item in Balls { ForEach($balls) { $ball in // You change ball later, so a binding here Circle() .fill(Color.black) .frame(width: 50, height: 50) .position(x: CGFloat($ball.xPosition.wrappedValue), y: CGFloat($ball.yPosition.wrappedValue)) // Wrappedvalue because ball is a binding .onReceive(timer) { _ in // Need on argument in the closure // self.yVelocity += self.gravity // self refers to View, not to a ball ball.yVelocity = ball.yVelocity + Int(ball.gravity) // One is Int, the other Float. Why ? That forbids += // ball.xPosition = CGPoint(ball.xPosition + ball.xVelocity) // That's not a CGPoint, needs 2 arguments ball.xPosition = ball.xPosition + ball.xVelocity ball .yPosition = ball.yPosition + ball.yVelocity if ball.yPosition >= 500 - 25 { ball.yPosition = 500 - 25 ball.yVelocity = -ball.yVelocity * ball.restitution } if ball.xPosition <= 25 { ball.xPosition = 25 ball.xVelocity = -ball.xVelocity } if ball.xPosition >= 375 { ball.xPosition = 375 ball.xVelocity = -ball.xVelocity // I suppose that's what you mean insted of ball.velocityX } /* errrors below you'll have to correct yourself let dx: int = other.xPosition - self.xPosition let dy: int = other.yPosition - self.yPosition let distance: int = sqrt (dx * dx + dy * dy) if distance < self.radius + other.radius { self.xVelocity = -self.xVelocity * self.restitution self.yVelocity = -self.yVelocity * self.restitution other.xVelocity = -other.xVelocity * self.restitution other.yVelocity = -other.yVelocity * self.restitution } */ } } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Apr ’25
Reply to 4.3a then 3.2f
What a long post just to explain your app was rejected. BTW, what is section 3.2f you refer in your title ? I do not see it in the guidelines. PS: you have posted several times for the same issue and show that you have received a confirmation by reviewer of clause 4.3. And I don't think your financial "proposal" will help in anyway, will probably have inverse effect. So it is not really useful to repeat the same message again.
Apr ’25
Reply to App stops responding to touch; works normally otherwise
Looks like the issue is not specific to your app. https://www.reddit.com/r/iphone/comments/1gnssap/iphone_apps_occasionally_stop_responding_to_touch/?rdt=53523 Did you file a bug report ? PS: if you google search for "iphone apps not responding to touch", you'll get a lot of similar reports as well as some videos explaining how to solve. Don't know how useful they are though.
Apr ’25
Reply to Alert structure and playing sound
There is effectively a problem, no sound. I tested with to different calls: func playInputClick() { var filePath: String? filePath = Bundle.main.path(forResource: "ButtonTap", ofType: "wav") let fileURL = URL(fileURLWithPath: filePath!) var soundID:SystemSoundID = 0 AudioServicesCreateSystemSoundID(fileURL as CFURL, &soundID) AudioServicesPlaySystemSound(soundID) } func playSound() { let alertSoundPath = URL(fileURLWithPath: Bundle.main.path(forResource: "ButtonTap", ofType: "wav")!) // Bundle.main.url(forResource: "classicAlarm", withExtension: "mp3")! do { let audioPlayer = try AVAudioPlayer(contentsOf: alertSoundPath) audioPlayer.play() } catch { // appData.logger.debug("Error playing sound: \(alertSoundPath)") } }: playSound does not work, while playInputClick() does. So, I would change your playSound as follows: func playSound() { let alertSoundPath = Bundle.main.path(forResource: "classicAlarm", ofType: "mp3")! let alertSoundURL = URL(fileURLWithPath: alertSoundPath) var soundID:SystemSoundID = 0 AudioServicesCreateSystemSoundID(alertSoundURL as CFURL, &soundID) AudioServicesPlaySystemSound(soundID) } In my tests, func are outside ContentView. I moved playSound inside ContentView and got the runtime error (but some sound): Modifying state during view update, this will cause undefined behavior. So, please, show complete code so that we can reproduce (as well as the resources).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Reply to In Review for 35 days!
I noticed that cancelling a submission is rarely a good idea. Just as if the app falls at the end of the list of apps to review. I just prefer to let submission complete and resubmit immediately if a new build is needed. This being said, 35 days is abnormal. Did you try to contact support and ask for a phone contact ?
Apr ’25
Reply to App Stuck in "Waiting For Review," for 2 weeks+ unhelpful support.
I had to cancel and resubmit my app a few times That's effectively a bad idea. I've noticed that it may create issues, with endless waiting for review (I don't know the reason why, but it seems so). Waiting for 1 day for review is not abnormal (even though it is often much faster). What category of app is it ? Did you try to ask support contact by phone ? It is usually very efficient.
Apr ’25
Reply to UIButton
Could you show a screenshot of the button ? And show the code as well ?
Replies
Boosts
Views
Activity
Apr ’25
Reply to How to screenshot?
have a look here if that can help: https://superuser.com/questions/1383379/is-there-a-way-on-macos-to-take-a-screenshot-of-a-region-and-paste-it-in-a-singl
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to How do I use "views" and structures / what's wrong with my code?
what's wrong with my code? Sorry to say, nearly everything. There are so many errors everywhere. You should start studying Swift first. As DarkPaw said, AI (ChatGPT or other) does not replace plain intelligence. It seems you don't even understand your own code, isn't it ? There are even many typos in code: extra } Balls[].xPosition is wrong syntax. What do you mean here ? The problem for the error message (there are likely many other) is you call for item in Balls You have to use ForEach in a view. In addition, Balls is not an array, even less an instance of array. And View struct should be outside of the class. Otherwise, how do you plan to access it ? Here is a start to correct those many errors: class Balls: Identifiable { //var color: String var xPosition: Int var yPosition: Int var xVelocity: Int var yVelocity: Int var radius: Int var gravity: CGFloat var restitution: Int var other: Balls? init(xPosition: Int, yPosition: Int, xVelocity: Int, yVelocity: Int, radius: Int, gravity: CGFloat, restitution: Int) //ADD COLOR { //self.color = color self.xPosition = xPosition self.yPosition = yPosition self.xVelocity = xVelocity self.yVelocity = yVelocity self.radius = radius self.gravity = gravity self.restitution = restitution } } struct UserView: View { let ball1: Balls = Balls (xPosition: 100, yPosition: 100, xVelocity: 3, yVelocity: 0, radius: 3, gravity: 0.3, restitution: 1) let ball2: Balls = Balls (xPosition: 200, yPosition: 50, xVelocity: -2, yVelocity: 2, radius: 3, gravity: 0.3, restitution: 1) let ball3: Balls = Balls (xPosition: 300, yPosition: 150, xVelocity: 4, yVelocity: -3, radius: 3, gravity: 0.3, restitution: 1) var timer = Timer.publish(every: 0.01, on: .main, in: .common).autoconnect() @State var balls: [Balls] init() { balls = [ball1, ball2, ball3] } var body: some View { VStack { //Background color Color.gray.edgesIgnoringSafeArea(.all) //var balls [Int] = [ball1; ball2; ball3] // for item in Balls { ForEach($balls) { $ball in // You change ball later, so a binding here Circle() .fill(Color.black) .frame(width: 50, height: 50) .position(x: CGFloat($ball.xPosition.wrappedValue), y: CGFloat($ball.yPosition.wrappedValue)) // Wrappedvalue because ball is a binding .onReceive(timer) { _ in // Need on argument in the closure // self.yVelocity += self.gravity // self refers to View, not to a ball ball.yVelocity = ball.yVelocity + Int(ball.gravity) // One is Int, the other Float. Why ? That forbids += // ball.xPosition = CGPoint(ball.xPosition + ball.xVelocity) // That's not a CGPoint, needs 2 arguments ball.xPosition = ball.xPosition + ball.xVelocity ball .yPosition = ball.yPosition + ball.yVelocity if ball.yPosition >= 500 - 25 { ball.yPosition = 500 - 25 ball.yVelocity = -ball.yVelocity * ball.restitution } if ball.xPosition <= 25 { ball.xPosition = 25 ball.xVelocity = -ball.xVelocity } if ball.xPosition >= 375 { ball.xPosition = 375 ball.xVelocity = -ball.xVelocity // I suppose that's what you mean insted of ball.velocityX } /* errrors below you'll have to correct yourself let dx: int = other.xPosition - self.xPosition let dy: int = other.yPosition - self.yPosition let distance: int = sqrt (dx * dx + dy * dy) if distance < self.radius + other.radius { self.xVelocity = -self.xVelocity * self.restitution self.yVelocity = -self.yVelocity * self.restitution other.xVelocity = -other.xVelocity * self.restitution other.yVelocity = -other.yVelocity * self.restitution } */ } } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Apr ’25
Reply to Legal Entity is different from domain name
Your email could be @gmail.com, which is obviously not your company name. So, AFAIK, there is no issue there.
Replies
Boosts
Views
Activity
Apr ’25
Reply to 4.3a then 3.2f
What a long post just to explain your app was rejected. BTW, what is section 3.2f you refer in your title ? I do not see it in the guidelines. PS: you have posted several times for the same issue and show that you have received a confirmation by reviewer of clause 4.3. And I don't think your financial "proposal" will help in anyway, will probably have inverse effect. So it is not really useful to repeat the same message again.
Replies
Boosts
Views
Activity
Apr ’25
Reply to App stops responding to touch, is working normally otherwise
That's a duplicate. See answer in the other thread.
Replies
Boosts
Views
Activity
Apr ’25
Reply to App stops responding to touch; works normally otherwise
Looks like the issue is not specific to your app. https://www.reddit.com/r/iphone/comments/1gnssap/iphone_apps_occasionally_stop_responding_to_touch/?rdt=53523 Did you file a bug report ? PS: if you google search for "iphone apps not responding to touch", you'll get a lot of similar reports as well as some videos explaining how to solve. Don't know how useful they are though.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Alert structure and playing sound
There is effectively a problem, no sound. I tested with to different calls: func playInputClick() { var filePath: String? filePath = Bundle.main.path(forResource: "ButtonTap", ofType: "wav") let fileURL = URL(fileURLWithPath: filePath!) var soundID:SystemSoundID = 0 AudioServicesCreateSystemSoundID(fileURL as CFURL, &soundID) AudioServicesPlaySystemSound(soundID) } func playSound() { let alertSoundPath = URL(fileURLWithPath: Bundle.main.path(forResource: "ButtonTap", ofType: "wav")!) // Bundle.main.url(forResource: "classicAlarm", withExtension: "mp3")! do { let audioPlayer = try AVAudioPlayer(contentsOf: alertSoundPath) audioPlayer.play() } catch { // appData.logger.debug("Error playing sound: \(alertSoundPath)") } }: playSound does not work, while playInputClick() does. So, I would change your playSound as follows: func playSound() { let alertSoundPath = Bundle.main.path(forResource: "classicAlarm", ofType: "mp3")! let alertSoundURL = URL(fileURLWithPath: alertSoundPath) var soundID:SystemSoundID = 0 AudioServicesCreateSystemSoundID(alertSoundURL as CFURL, &soundID) AudioServicesPlaySystemSound(soundID) } In my tests, func are outside ContentView. I moved playSound inside ContentView and got the runtime error (but some sound): Modifying state during view update, this will cause undefined behavior. So, please, show complete code so that we can reproduce (as well as the resources).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Help - Action needed: Provide banking details in App Store Connect
Welcome to the forum. It depends what bank account information you have provided. Some info is probably missing, but impossible to tell from your post.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Unable to continue issue in apple developer application
Welcome to the forum. But, as you don't even explain what the issue is, it means you don't expect any answer from the forum. So that's pretty useless post, just creating noise in the forum. You'd better contact Apple Support and explain what is the issue.
Replies
Boosts
Views
Activity
Apr ’25
Reply to unable to optimize App for iPad
Could you show some code, specially the main file.
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to In Review for 35 days!
I noticed that cancelling a submission is rarely a good idea. Just as if the app falls at the end of the list of apps to review. I just prefer to let submission complete and resubmit immediately if a new build is needed. This being said, 35 days is abnormal. Did you try to contact support and ask for a phone contact ?
Replies
Boosts
Views
Activity
Apr ’25
Reply to App Stuck in "Waiting For Review," for 2 weeks+ unhelpful support.
I had to cancel and resubmit my app a few times That's effectively a bad idea. I've noticed that it may create issues, with endless waiting for review (I don't know the reason why, but it seems so). Waiting for 1 day for review is not abnormal (even though it is often much faster). What category of app is it ? Did you try to ask support contact by phone ? It is usually very efficient.
Replies
Boosts
Views
Activity
Apr ’25
Reply to App Stuck in "Waiting for Review" for Over 2 Weeks
Just submitted 2 apps (updates). The first went into review after about 12 hours, the second in less than 1 hour. So no issue here. From what you explain, it seems so, but are you sure you "fully" submitted ? There are 2 steps: send for submission submit to review team (the submission button title changes after first step).
Replies
Boosts
Views
Activity
Apr ’25
Reply to Contact owner of app?
Surprisingly, as app appears available in Europe, the submitter has (legally) to publish a contact mail and phone. There is apparently none of those on the AppStore. You could try to contact Apple Support to get some advice on how to proceed.
Replies
Boosts
Views
Activity
Apr ’25