Post

Replies

Boosts

Views

Activity

Reply to App Submission Issue: Demo Account
What's the user journey for creating an account and logging in? If someone comes along and wants to create an account, you must be asking for username/email and a password first, and then you ask if they want to setup biometric auth, right? If so, providing the App Review Team a new user account that hasn't yet bio-authed would be fine, because they would attempt to login and would be asked to setup bio auth. However, if you're bypassing account details altogether and just going with bio auth, then can't the App Review Team just launch the app and create an account themselves? You might have to revisit your user journey for logging in, and change it.
Feb ’24
Reply to Guideline 1.5 - Safety - Developer Information The support URL specified in your app’s metadata, https://www.doclinkapp.net/privacypolicy, does not properly navigate to the intended destination.
The App Review team are right. The page that gets displayed is a "Confidentiality Agreement", not a Privacy Policy. It ends with "I have read, understood and agreed to the terms and conditions set out above", suggesting that someone has to agree to this. I think you're re-using this document for the wrong purpose. You need to explain your company's privacy policy, and how it affects the app you're trying to release.
Topic: Design SubTopic: General Tags:
Feb ’24
Reply to Button animation bug: repeated movement behaviour
What's happening is you've set your initial position and size at the top, with: @State var xPos: CGFloat = 300 @State var yPos: CGFloat = 400 @State var size: CGFloat = 120 and so SwiftUI draws your Button at a font size of 120, and at (300, 400). When you tap the button you change the size to 60, and the position to (170, 310). Then, one second later, you change the x position to 700, so the button moves to (700, 310) and remains at size 60. Your variables are now: xPos = 700, yPos = 310, size = 60. When you press it again, all the code is doing is changing the size to 60 (it's already 60), and the position to (170, 310), then it moves the x position to 700 after one second. This will keep happening every time you press the button, because it's stuck with those values. What position do you want the button to go back to, and at what size? Those are the values you need to plug into the DispatchQueue... block. So... Back to the starting position: DispatchQueue.main.asyncAfter(deadline: .now() + 1) { xPos = 300 yPos = 400 size = 120 } To x position 700, then back to the start, all within one second? Try this: DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { xPos = 700 } DispatchQueue.main.asyncAfter(deadline: .now() + 1) { xPos = 300 yPos = 400 size = 120 } Also, to get rid of the deprecation warning, use something like: .animation(.spring(duration: 1), value: [xPos, yPos, size])
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24
Reply to Multiple buttons - repetitive code
And here's what I would do: struct ContentView: View { @State private var score = 0 let buttons = [ButtonData(name: "Add 1", background: .red, delta: 1), ButtonData(name: "Add 2", background: .green, delta: 2), ButtonData(name: "Add 3", background: .yellow, delta: 3), ButtonData(name: "Minus 1", background: .cyan, delta: -1), ButtonData(name: "Reset", background: .mint, delta: 0) ] var body: some View { ZStack { Color.pink.opacity(0.2).ignoresSafeArea() VStack { Spacer() Text("Keep Score") .foregroundStyle(.black) .font(.system(size: 50, weight: .semibold, design: .rounded)) Spacer() Text("The score is: \(score)") .foregroundStyle(.secondary) .font(.system(size: 30, weight: .semibold, design: .rounded)) Spacer() ForEach(buttons.indices, id: \.self) { b in ButtonView(button: buttons[b], score: $score) } } Spacer() } } } struct ButtonData { let name: String let background: Color let delta: Int } struct ButtonView: View { var button: ButtonData @Binding var score: Int var body: some View { Button { score = (button.delta == 0 ? 0 : score + button.delta) } label: { ZStack { RoundedRectangle(cornerRadius: 5) .stroke(lineWidth: 4) .foregroundColor(.black) RoundedRectangle(cornerRadius: 5) .foregroundColor(button.background) Text(button.name) .foregroundStyle(.black).bold().font(.subheadline) } } .padding(5) .frame(width: 75, height: 50) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24
Reply to HELP!
A few things I've noticed here. I might have misunderstood what you're trying to do, but: mutating func majorDamage() { currentHP = -25 } Assuming you're going to trigger this majorDamage() function to remove 25 HP (health points?), what this currently does is change it to -25, not reduce it by 25. For that, use currentHP -= 25, and you should then check whether the player has died if their currentHP <= 0. mutating func healthPack() { currentHP = +15 let currentHP = 138 if self.currentHP == maximumHP{ self.currentHP = 145 } } currentHP = +15 is a bit weird. You don't need to put the plus sign for positive integers. Adding 15 to currentHP is achieved by writing currentHP += 15. If this function is called when you find a health pack, then what you're doing is setting currentHP to 15, then making a let with the same variable name, and setting it to 138. Then you're checking whether this new currentHP equals their maximum, and setting it to 145, but that's not going to happen unless their maximum is 138. It's the wrong way to do it. You need to check if their currentHP is now over their maximum, and reset it. I have no idea why you're using a second variable here? mutating func healthRestore() { currentHP == maximumHP let currentHP = currentHP if currentHP < 0{ print("Player died")} } This currentHP == maximumHP checks whether the two values match, but does nothing with the result. Did you mean to set currentHP to maximumHP instead? If so, remove one of the equals signs. When will the currentHP ever be below zero when you're running a healthRestore() function? You've just restored their health to the maximum, so how have they died?! Also, the player would surely die if they have zero HP, not only less than zero? Your check should be if currentHP <= 0 (but not in this function; put it in those functions where the HP is reduced).
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’24
Reply to Lightweight migration in Swift/UI with CoreData
Right, I've figured it out (after a good night's sleep). Somehow, version 11 had one attribute as Optional, and so something in my app code had set it to nil. In the new version the fields are required so the mapping failed to map a nil into a String. The fix was to add a migration policy class, like this: import CoreData import Foundation class Migrate11_12 : NSEntityMigrationPolicy { override func createDestinationInstances(forSource sInstance: NSManagedObject, in mapping: NSEntityMapping, manager: NSMigrationManager) throws { if(sInstance.entity.name == kCoreDataEvent) { sInstance.setValue("", forKey: kUnit) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24
Reply to Update from MacOS 14.3 to 14.4 does not start after update loaded on iMac 2019 Intel
Sorry, but this has nothing to do with the Developer Forums. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. These forums are NOT where Apple's actual developers chat about stuff. Your question is more of a support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’24
Reply to How to resize a UIImage and get rid of the white line?
How would I give you an MRE? It's part of my massive app. All I'd be doing is creating a new project and using the code I've already provided, and you've already done that, no? So, in your code, that function works perfectly fine? You're able to resize one of the images included in the iPhone Simulator, and not get the white line?
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’24