Post

Replies

Boosts

Views

Activity

Reply to SwiftUI @State var not sync in .popover
Really strange. Not sure of the explanation, but looks like the VStack is not reevaluated when popover is called. But, if added a Text in the VStack, and it works OK. VStack is reevaluated. var body: some View { VStack { Button("xxxx") { print("Button") visableHiddenMenu = true print("visableHiddenMenu \(visableHiddenMenu)") visable.toggle() } .popover(isPresented: $visable) { VStack { let _ = print("visableHiddenMenu2 \(visableHiddenMenu)") Text("Popover presented \(visableHiddenMenu)") } .onAppear { print("appear \(visableHiddenMenu)") visableHiddenMenu = visableHiddenMenu } } Text("Popover visible \(visableHiddenMenu)") } .padding() } In log: Button visableHiddenMenu true visableHiddenMenu2 true appear true visableHiddenMenu2 true Note that visableHiddenMenu2 true appears twice, showing Stack is reevaluated. PS: what is the purpose of line 19 ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to accedentlyy deleted info.plist
Hope you have a recent backup somewhere. You should. To create an info.plist: In Xcode, File > File > File from template (or cmd N) select Property List in Resource section name it info (Info.plist) Then populate it as needed. Typical content, in source code format: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> <string>YourAppName</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>1.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>$(MARKETING_VERSION)</string> <key>CFBundleVersion</key> <string>$(CURRENT_PROJECT_VERSION)</string> <key>ITSAppUsesNonExemptEncryption</key> <false/> <key>LSRequiresIPhoneOS</key> <true/> <key>NSCameraUsageDescription</key> <string>Text to authorise camera access.</string> <key>NSPhotoLibraryUsageDescription</key> <string>Text to authorise album access.</string> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> <key>UISceneStoryboardFile</key> <string>Main</string> </dict> </array> </dict> </dict> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <key>UIMainStoryboardFile</key> <string>Main</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist>
Jun ’25
Reply to Software Updates
Do you want to upgrade or downgrade (from which version ?) If your device supports iOS 15, settings > General > Software update will give you access to upgrade. So, what is precisely the problem ?
Topic: Community SubTopic: Apple Developers Tags:
Jun ’25
Reply to App Rejected (4.3.0 Design Spam) (I'm a iOs developer since 2009 and this is the first time)
There are several reasons for 4.3 rejection, some are not spam by itself but overcrowded category. b) Also avoid piling on to a category that is already saturated;… We will reject these apps unless they provide a unique, high-quality experience. Searching on the AppStore, one can see there are a lot of puzzle games. So may be that's just the reason. If so, have you arguments to convince reviewer that your app creates a unique, high-quality experience ?
Jun ’25
Reply to Question about `UITextField`'s `markedTextRange` when handling Korean input
You should probably count for unicodeScalars.count, as described in Xcode doc about Character. Because each character in a string can be made up of one or more Unicode scalar values, the number of characters in a string may not match the length of the Unicode scalar value representation or the length of the string in a particular binary representation. print("Unicode scalar value count: \(greeting.unicodeScalars.count)") // Prints "Unicode scalar value count: 8" print("UTF-8 representation count: \(greeting.utf8.count)") // Prints "UTF-8 representation count: 11" So change to func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { guard let text = textField.text else { return true } return text.unicodeScalars.count <= 5 }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’25