Post

Replies

Boosts

Views

Activity

Accessibility Localization Questions
For practice, I have implemented accessibility labels and announcement in a very simple test app (All SwiftUI, all iOS 18). The app is not localized, default language is English. When running this on a German phone, odd things happen in the localization. My accessibility labels are read with an accent, but when they contain a url, the "dots" are read as the German "Punkt" (with an English Accent). When I am providing the same text as accessibility announcement, the same text (which is in English), is read with a German voice. I am also providing a Button with an "arrow.clockwise" image, and VoiceOver reads this, in an English Voice with "Refresh, Button". This is great and was to be expected. However, when the button is disabled, VoiceOver reads "Refresh, grau dargestellt, Button", all in an English Voice. Is this an error? Am I doing it wrong? The video at the link should show the issue https://share.icloud.com/photos/0757FJW2Q3fsA_cdhMX6ls46Q
2
0
1.2k
Dec ’24
Swift framework for Objective-C
Hello,hopefully, this is a real beginer question, so hopefully it is easy to answer …I want to create a new framework for an existing Objective-C app. And because Swift is all shiny, and we already are using Swift in other parts of the app, I am writing the framework in Swift.However, when I #include "${MODULENAME}-Swift.h" in my umbrella header, Xcode tells me on a clean compile: ‘'${MODULENAME}-Swift.h' file not found'If I comment that line, build, then uncomment it and build again, Xcode will find it. This, however, is unacceptable for, say, build servers.Questions:1) It appears, that when I am importing the Framework as a module (i.e. @import ${MODULENAME} ), I don't need to #include "${MODULENAME}-Swift.h" in my umbrella header.Is this true? Is it not necessary to explicitly expose the -Swift.h headers when importing the Framework as a module?2) This leads me to the next question:Do Swift Frameworks have to be imported as modules? The app is an old codebase and currently sets CLANG_ENABLE_MODULES to NO. Is it necessary to set this to YES when using a Swift Framework?3) Am I doing something wrong with the #import? If I can use the Framework not as a module, but #import <Framework/Umbrella.h> is good, what do I have to do to have{MODULENAME}-Swift.h available even on a clean compile?Again, hopefully these are simple questions, and someone can easily answer them 😉
3
0
7.1k
Dec ’20
Reading (NS)Bundle in iOS after relaunch
Sorry, I did not have a catchier title: Prelude Avid followers of my Twitter account know: I was looking for an easy, preferably human editable container for documents, and — being the old Mac developer I am — I went with bundles, stored in the Documents folder. The Problem At some point in my app, the user can choose which file to use. And then, of course, on next launch, that file should be used. Selecting the file works all nice and well, including reading from the created Bundle. The problem occurs when the App is relaunched, and reads the absoluteString of the file from the UserDefaults. This works, and I can create a URL from it. But creating a bundle fails, and I don't get any error. This happens on iOS 15 and 16, on device and in the simulator. Is this some permissions things? Is the url not formatted correctly? What is going on? To Reproduce I have created a sample App here: https://github.com/below/BundleSample Launch the App, in the Simulator or on device Select "Copy Bundle" (You can "Test Resource Bundle", but it does not matter) Finally, select "Test Documents Bundle". You should see a picture Close the app, either by stopping it in Xcode or force quit Restart the App Expected Result You see the picture Acutal Result You see the "Gear" placeholder
3
0
1.3k
Sep ’22
Weird DateFormatter behavior
I am seeing a weird behavior of the date formatter (Full code is below). When run, this will give the following output: 57: 1 month, 3 weeks, 5 days 58: 1 month, 3 weeks, 6 days 59: 2 months 60: 2 months, 1 day 61: 2 months 62: 2 months, 1 day 63: 2 months, 2 days So both 59 days and 61 days are 2 months, and both 60 and 62 days are 2 months and 1 day. This of course is especially weird because this means, 2 months also comes after 2 months and a day. Can someone explain to me what is going on here? import Foundation let formatter = DateComponentsFormatter() formatter.unitsStyle = .full let calendar = Calendar(identifier: .gregorian) let today = calendar.date(from: DateComponents(year: 2025, month: 7, day: 26))! for day in 57...63 { let startDate = calendar.date(byAdding: .day, value: -day, to: today)! let components = calendar.dateComponents([.day, .weekOfMonth, .month,. year], from: startDate, to: today) let result = formatter.string(from: components)! print ("\(String(format: "%3d", day)): \(result)") }
4
0
288
Jul ’25