Post

Replies

Boosts

Views

Activity

Is a spam an appreciated participation in the forums ?
There are at the moment a lot of spams for a bank phone number. https://developer.apple.com/forums/thread/769506 What is really surprising is to read App Store Connect Engineer answer, each time the same: We appreciate your interest in participating in the forums! These forums are for questions about developing software and accessories for Apple platforms. Your question seems related to a consumer feature and is better suited for the Apple Support Communities Is it an automatic answer (I cannot believe anyone who read the post did not notice it was a spam) ? If so, couldn't it simply detect it is a spam (Apple Intelligence could come to help) and delete the message (or the account) ? PS: it would also be a spam in Apple Support Communities PS2: I note the message has been deleted very rapidly.
13
1
969
Apr ’25
Could someone test if Settings in iOS 18.2 are broken ?
Apparently, settings do not show anymore the apps settings in iOS 18.2. I tested on simulators (Xcode 16.2) both on iOS 18.1 and iOS 18.2 and got very different results: In iOS 18.1 simulator, I see the settings of a lot of apps. In iOS 18.2 simulator, not a single app setting. That is a really serious issue in simulator for development (I filed a bug report FB16175635), but would be really critical on device as it would make it impossible to adjust setting of many apps. Unless I missed something (meta setting ?) in iOS 18.2 ? I have not upgraded to 18.2 notably for this reason. So I would appreciate if someone who has upgraded could make the test and report ? select Settings on Home page scroll to Apps category tap here to access the list Does the list show anything ? Thanks for your help.
1
1
1.1k
Jan ’25
Are WatchOS storyboards forbidden now ?
I read in Xcode 14 release notes: Fixed: WatchKit storyboards are deprecated in watchOS 7.0 and later. Please migrate to SwiftUI and the SwiftUI Lifecycle. (94058186) And effectively, when adding a WatchOS target to an iOS app as a companion, it is now created as SwiftUI. In Xcode 13 we could still create as WatchKit (storyboard). That raises a few questions: what will happen to existing apps with companions ? Shall we have soon to redesign Watch part completely from storyboards to SwiftUI ? What is the reason for such a deprecation ? That leads to have code with a part in storyboard the other in SwiftUI. Not ideal situation. Is WatchKit deprecated completely ? Personal opinion: with some present limitations of SwiftUI (such as in Lists), it will make it pretty hard to get the same flexibility in the designs that we had with WatchKit. I find it a regression not to leave both options possible.
12
2
5.3k
Feb ’23
NSKeyedUnarchiver validateAllowedClass error
I get this error in Xcode 14 / iOS 16 on device that I had not with previous versions. [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x205da88f8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(     "'NSDictionary' (0x205da1178) [/System/Library/Frameworks/CoreFoundation.framework]",     "'NSString' (0x205da8948) [/System/Library/Frameworks/Foundation.framework]" )}'. This will be disallowed in the future. The only places where I reference NSDictionary.self or NSString.self or NSNumber.self for allowed classes are: @objc class MyClass : NSObject, NSSecureCoding {       required init(coder decoder: NSCoder) {        let myObject = decoder.decodeObject(of: [MyClass.self, NSNumber.self, NSArray.self, NSDictionary.self, NSString.self], forKey: myKey) as? [SomeClass] ?? []     } and in another class class Util { // in a class func:     let data = try Data(contentsOf: fileURL)     guard let unarchived = try NSKeyedUnarchiver.unarchivedObject(ofClass: NSDictionary.self, from: data) else { return nil } I do not understand what NS.objects refers to. I tried to add NSObject.self in        let myObject = decoder.decodeObject(of: [MyClass.self, NSNumber.self, NSArray.self, NSDictionary.self, NSString.self, NSObject.self], forKey: myKey) as? [SomeClass] ?? [] but that gave even more warnings: [Foundation] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:]: NSSecureCoding allowed classes list contains [NSObject class], which bypasses security by allowing any Objective-C class to be implicitly decoded. Consider reducing the scope of allowed classes during decoding by listing only the classes you expect to decode, or a more specific base class than NSObject. This will become an error in the future. Allowed class list: {(     "'NSNumber' (0x205da88f8) [/System/Library/Frameworks/Foundation.framework]",     "'NSArray' (0x205da1240) [/System/Library/Frameworks/CoreFoundation.framework]",     "'NSObject' (0x205d8cb98) [/usr/lib]",     "'NSDictionary' (0x205da1178) [/System/Library/Frameworks/CoreFoundation.framework]",     "'MyClass.self' (0x1002f11a0) [/private/var/containers/Bundle/Application/5517240E-FB23-468D-80FA-B7E37D30936A/MyApp.app]",     "'NSString' (0x205da8948) [/System/Library/Frameworks/Foundation.framework]" Another warning refers to NS.keys: 2022-09-16 16:19:10.911977+0200 MyApp[4439:1970094] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x205da8948) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.keys', even though it was not explicitly included in the client allowed classes set: '{(     "'NSDictionary' (0x205da1178) [/System/Library/Frameworks/CoreFoundation.framework]" )}'. This will be disallowed in the future. I do not understand what NS.keys refers to. What additional class types should I add ?
4
2
4.7k
Sep ’22
iTunes Store is stuttering, repeating the same (erroneous) message every 5 minutes…
Since 2 hours (1:20 GMT July 18), I keep receiving the exact same message from iTunesStore every 5 minutes (30 received so far, with metronome regularity): Your banking information was accepted Thank you for providing the requested details for xxxxxx associated with your banking update in App Store Connect. Any payments may take up to 2 payment cycles to send. If you have any questions, contact us at http://developer.apple.com/contact/. I did not update any information since at least 6 weeks. I contacted support, it seems to be widespread problem. I filed a bug report: Jul 18, 2024 at 5:51 PM – FB14377820
5
3
1.1k
Jul ’24
No new Xcode beta Since 16.2 Release on Dec 11
Not a question, but a surprise. Did I miss something, but apparently there has been no new beta release (16.3) since Release of 16.2 on Dec 11. 2 months without betas is really unusual (in fact, it never happened and usually, next beta n+1 is even released before the final release of version n). So does that mean 16.3 will be a major update ? Wait and see.
4
4
653
Feb ’25
Passing data from an App VC to its widget
Learning Widgets, I try a simple pattern: get a textField in the app; have the Widget updated when textField is changed. App is UIKit. Widget has No "included Configuration Intent". It compiles and works. Widget is updated every 5 minutes as asked line 23 (final snippet). But the message is never updated (line 48 of final snippet) with globalToPass (as expected from line 24): it always shows "Hello". What I tried: Create a singleton to hold the data to pass: class Util { &#9;&#9; &#9;&#9;class var shared : Util { &#9;&#9;&#9;&#9;struct Singleton { &#9;&#9;&#9;&#9;&#9;&#9;static let instance = Util() &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;return Singleton.instance; &#9;&#9;} &#9;&#9; &#9;&#9;var globalToPass = "Hello" } shared the file between the 2 targets App and WidgetExtension In VC, update the singleton when textField is changed and ask for widget to reload timeline &#9;&#9;@IBAction func updateMessage(_ sender: UITextField) { &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;Util.shared.globalToPass = valueToPassLabel.text ?? "--" &#9;&#9;&#9;&#9;WidgetCenter.shared.reloadTimelines(ofKind: "WidgetForTest") &#9;&#9;&#9;&#9;WidgetCenter.shared.reloadAllTimelines() &#9;&#9;} Problem : Widget never updated its message field Probably I need to have the message in @State var, but I could not get it work. Here is the full widget code at this time: import WidgetKit import SwiftUI struct LoadStatusProvider: TimelineProvider { &#9;&#9; &#9;&#9;func placeholder(in context: Context) -> SimpleEntry { &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;SimpleEntry(date: Date(), loadEntry: 0, message: Util.shared.globalToPass) &#9;&#9;} &#9;&#9;func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;let entry = SimpleEntry(date: Date(), loadEntry: 0, message: Util.shared.globalToPass) &#9;&#9;&#9;&#9;completion(entry) &#9;&#9;} &#9;&#9;func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) { &#9;&#9;&#9;&#9;var entries: [SimpleEntry] = [] &#9;&#9;&#9;&#9;// Generate a timeline consisting of five entries an hour apart, starting from the current date. &#9;&#9;&#9;&#9;let currentDate = Date() &#9;&#9;&#9;&#9;for minuteOffset in 0 ..< 2 { &#9;&#9;&#9;&#9;&#9;&#9;let entryDate = Calendar.current.date(byAdding: .minute, value: 5*minuteOffset, to: currentDate)! &#9;&#9;&#9;&#9;&#9;&#9;let entry = SimpleEntry(date: entryDate, loadEntry: minuteOffset, message: Util.shared.globalToPass) &#9;&#9;&#9;&#9;&#9;&#9;entries.append(entry) &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;let timeline = Timeline(entries: entries, policy: .atEnd) &#9;&#9;&#9;&#9;completion(timeline) &#9;&#9;} } struct SimpleEntry: TimelineEntry { &#9;&#9;let date: Date &#9;&#9;let loadEntry: Int &#9;&#9;let message: String } struct WidgetForTestNoIntentEntryView : View { &#9;&#9;var entry: LoadStatusProvider.Entry &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;let formatter = DateFormatter() &#9;&#9;&#9;&#9;formatter.timeStyle = .medium &#9;&#9;&#9;&#9;let dateString = formatter.string(from: entry.date) &#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;&#9;&#9;VStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text(String(entry.message)) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;HStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text("Started") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text(entry.date, style: .time) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;HStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text("Now") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text(dateString) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;HStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text("Loaded") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text(String(entry.loadEntry)) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;} } @main struct WidgetForTestNoIntent: Widget { &#9;&#9;let kind: String = "WidgetForTestNoIntent" &#9;&#9;var body: some WidgetConfiguration { &#9;&#9;&#9;&#9;StaticConfiguration(kind: kind, provider: LoadStatusProvider()) { entry in &#9;&#9;&#9;&#9;&#9;&#9;WidgetForTestNoIntentEntryView(entry: entry) &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;.configurationDisplayName("My Widget") &#9;&#9;&#9;&#9;.description("This is an example widget.") &#9;&#9;} } struct WidgetForTestNoIntent_Previews: PreviewProvider { &#9;&#9;static var previews: some View { &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;WidgetForTestNoIntentEntryView(entry: SimpleEntry(date: Date(), loadEntry: 0, message: "-")) &#9;&#9;&#9;&#9;&#9;&#9;.previewContext(WidgetPreviewContext(family: .systemSmall)) &#9;&#9;} } I have not defined extension for IntentHandler
2
0
2.3k
Mar ’21
Positioning views: is it me or SwiftUI ?
After more than 2 years of intense use of SwiftUI I appreciate many of its features, particularly the speed at which I can get some code running. But, there are some major buts … Screen Position, I keep struggling with try, test, error and retry to position views relative to each others, withy many iterations to tune the x and y parameters. And preview does not help when view is too complex: I find it more reliable to test in simulator. At the end, my code is messed with .position, .offset, … that I manually adjusted but may break if I change something elsewhere in the body. The fact that position is relative to center of view (different from UIKit) makes it even more mind boggling. For sure, UIKit constraints were not so easy, but you got a very stable code. That's not the case with SwiftUI z position In some cases, I want the View to appear on front of all others. It may be a very simple Rectangle() with overlay, e.g., to mimic an alert. And I struggle with the Rectangle drawn behind another view, even trying to adjust the zIndex to no avail… Should I create an explicit View instead of creating the Rectangle directly in the body ? So am I misusing SwiftUI, or are they points that SwiftUI should improve in the future ?
1
1
901
Sep ’23
SwiftUI TUICursorUIViewService error
I get this error in console in a SwiftUI MacApp on Xcode 15.0.1 and MacOS 14.1.2 FAULT: <NSRemoteView: 0x11f03bc00 com.apple.TextInputUI.xpc.CursorUIViewService TUICursorUIViewService> determined it was necessary to configure <TUINSWindow: 0x11f1b2390> to support remote view vibrancy I found similar errors that seem to be harmless messages popping up: https://developer.apple.com/forums/thread/72133 No idea what can cause such message, even less how to correct it.
3
5
3.3k
Dec ’23
Most wanted Xcode features…
I propose that we collectively build a list of most wanted XCode features. Those pain points that do make our life more difficult with XCode or less fun.The goal would not be to have a scientifically correct ranking of all those, but simply:- make visible many ideas that have probably been reported in improvement requests- expose in short why that would be a great evolution, what pain point it would solve (functional improvements, not bugs correction)- if possible, discuss the feasibility of each idea.I would agree to update this original post to include new inputs.To avoid a thread where new posts get smaller and smaller in width, would be great to post each new idea as an answer to this original post. Of course discuss an idea as a reply to this idea post itself.Rule of the game would be tolerance, not trying to argue indefinitely on one idea. And be concise in wanted feature descriptionThe ultimate goal would be to influence positively XCode development team to consider the most wanted proposals.At least, have them explain us that one wanted feature in on the way (let's dream), why such idea is not so great, or why it would be too complex to implement…_________________________________Here is a first wanted feature, inspired from a thread in IB forum: https://forums.developer.apple.com/thread/72495Wanted Feature : Storyboard zoom when editing macOS appPain point: makes navigating in MacOS storyboard extremely painful if more than a few windows. Does limit the use of storyboards for MacOS App. The IB post was seen more than 7500 times, so that seems a largely shared concern.Feasibility: done for iOS, so should be possible for MacOS._________________________________Wanted Feature : Automatic/1-button icon, logo, screenshot, launch image generation for all project related devices/screens as mandated by ASC. Current with each new release.Pain point: The number of individually required image-based assets involved for meta data submittals became a burden long ago and continues to require significant labor to suss and satisfy.Feasibility: Xcode already does some of this w/launchStoryboards for new Swift projects, it just needs to be ubiquitous for all similar assets. It's just scripting/image resizing, which should not be a problem on macOS. Yes, I know there are 3rd party tools that help, but they seem to not keep up w/new devices/screen sizes - if they can do it, so can Xcode._________________________________Wanted Feature : More explicit help message when an action cannot be completed in IBPain point: When XCode cannot complete an action (e.g., create an IBOutlet for an IB object), option-cleaning the build folder solves the problem. Numerous issues reported on the forum were solved with this simple action. However, messages from IDE never mention this solution.Feasibility: Just adding (when appropriate) a suggestion in the message._________________________________Wanted Feature : When build fails, propose automatic correction action whenever possiblePain point: As an example, if some asset contains Finder information, a build error occurs, with message "resource fork, Finder information, or similar detritus not allowed Command /usr/bin/codesign failed with exit code 1". One has to go to Terminal, use xattr command and clean laboriously the offending files.Feasibility: As XCode has detected the files, it could propose to do the cleaning itself…- if it can be done with terminal command, so can Xcode._________________________________Wanted Feature : When an API is deprecated, get information on how to replace.Pain point: Most often, when an API is deprecated and we get a warning from compiler, we get no hint on how to replace. Thus, requiring to post on forum (a lot of posts relate to this search for information), search on web to find some hints… At the end losing time and not being sure to make the best decision.Feasibility: Those who deprecated API for sure know how to handle this. Should be (relatively) easy to provide information in doc, and in the deprecation message._________________________________Wanted Feature : When a string is missing for an infoPlist key, give a warning.Pain point: If the required key is missing, app will crash (or be rejected at Appstore verification stage which is a minor harm). I had the case where I called imagePicker, but intended to use only photo, not video. But if user taps on video, that caused a crash.Feasibility: When UIImagePickerControllerDelegate is used, compiler could check that infoPlist is defined for the required keys.._________________________________All comments welcomed.
14
1
3.2k
Feb ’23
Height of safe area margin in iPhone 12 Pro Max
I have an image to fill the entire screen, even behind the notch. So I set the Top margin to safe area to -44. That works OH on all iPhones… except on iPhone 12 ProMax simulator. Here I get a few pixels uncovered at top. I had to change value to -48 to get everything OK. So question is: has "notch area" which defines safe area increased 4 pixels on iPhone 12 Pro max ? If so, is it a hardware change ?
1
0
4k
Jun ’21
VNRecognizeTextRequest from a text drawn in UIImageView returns empty results
Here is the setup. I have an UIImageView in which I write some text, using UIGraphicsBeginImageContext. I pass this image to the OCR func: func ocrText(onImage: UIImage?) { let request = VNRecognizeTextRequest { request, error in guard let observations = request.results as? [VNRecognizedTextObservation] else { fatalError("Received invalid observations") } print("observations", observations.count) for observation in observations { if observation.topCandidates(1).isEmpty { continue } } } // end of request handler request.recognitionLanguages = ["fr"] let requests = [request] DispatchQueue.global(qos: .userInitiated).async { let ocrGroup = DispatchGroup() guard let img = onImage?.cgImage else { return } // Conversion to cgImage works OK                 print("img", img, img.width)                 let (_, _) = onImage!.logImageSizeInKB(scale: 1) ocrGroup.enter() let handler = VNImageRequestHandler(cgImage: img, options: [:]) try? handler.perform(requests) ocrGroup.leave() ocrGroup.wait() } } Problem is that observations is an empty array. I get the following logs: img <CGImage 0x7fa53b350b60> (DP) <<CGColorSpace 0x6000032f1e00> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1)> width = 398, height = 164, bpc = 8, bpp = 32, row bytes = 1600 kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little | kCGImagePixelFormatPacked is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes 398 ImageSize(KB): 5 ko 2022-06-02 17:21:03.734258+0200 App[6949:2718734] Metal API Validation Enabled observations 0 Which shows image is loaded and converted correctly to cgImage. But no observations. Now, if I use the same func on a snapshot image of the text drawn on screen, it works correctly. Is there a difference between the image created by camera and image drawn in CGContext ? Here is how mainImageView!.image (used in ocr) is created in a subclass of UIImageView: override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { // Merge tempImageView into mainImageView UIGraphicsBeginImageContext(mainImageView!.frame.size) mainImageView!.image?.draw(in: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height), blendMode: .normal, alpha: 1.0) tempImageView!.image?.draw(in: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height), blendMode: .normal, alpha: opacity) mainImageView!.image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() tempImageView?.image = nil } I also draw the created image in a test UIImageView and get the correct image. Here are the logs for the drawn texte and from the capture: Drawing doesn't work img <CGImage 0x7fb96b81a030> (DP) <<CGColorSpace 0x600003322160> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1)> width = 398, height = 164, bpc = 8, bpp = 32, row bytes = 1600 kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little | kCGImagePixelFormatPacked is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes 398 ImageSize(KB): 5 ko 2022-06-02 15:38:51.115476+0200 Numerare[5313:2653328] Metal API Validation Enabled observations 0 Screen shot : Works img <CGImage 0x7f97641720f0> (IP) <<CGColorSpace 0x60000394c960> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; iMac)> width = 570, height = 276, bpc = 8, bpp = 32, row bytes = 2280 kCGImageAlphaNoneSkipLast | 0 (default byte order) | kCGImagePixelFormatPacked is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes 570 ImageSize(KB): 5 ko 2022-06-02 15:43:32.158701+0200 Numerare[5402:2657059] Metal API Validation Enabled 2022-06-02 15:43:33.122941+0200 Numerare[5402:2657057] [WARNING] Resource not found for 'fr_FR'. Character language model will be disabled during language correction. observations 1 Is there an issue with kCGColorSpaceModelRGB ?
9
0
3.4k
Jun ’23