Posts

Post not yet marked as solved
0 Replies
95 Views
As I currently live in ReactNative Hell, I like to flesh out all my native iOS demos and samples to the max. Including things like accessibility. Recently, I wrote a very simple demo containing a map, and I stumbled upon some issues I was unable to resolve. I think they present very general usecases, and so I would be happy if anyone of you had any idea. The condensed source code for the issues can be found on GitHub Issue 1: The Phantom Overlay To reproduce Run the app on a device, and be sure that VoiceOver is on. Swipe right to get to the Annotations. Expected Result The title of the annotation is read. Actual Result The title of the annotation is read twice. What I know For every annotation on the map view, there is also an overlay, an MKCircle, generated by an MKCircleRenderer. When this overlay is not present, the title is — correctly — only read once. What I have tried In ViewController.swift, lines 54 and 92, I have set both the overlay's and the renderer's isAccessibilityElement property to false. This does not fix the issue (probably because neither of them are the actual views). The overlay should never be an accessible element. Any information should be encoded in the annotation (e.g. "There is a 10m region around this marker") Issue 2: The Unknown Trait While it is correct that the title of the annotation should be read, there is no indication that the annotation can be clicked or interacted with. I have set annotationView.accessibilityTraits = [.button], but this does not change anything. My expectation would be "Cologne Cathedral, Button" or a similar hint that the item is clickable. Issue 3: The Unreachable Callout With VoiceOver active, click on an annotation. I have taken some hints from Stackoverflow, and tried to disable the accessibility on the annotation, and enable it on the callout. This leads to the callout being reachable somehow, but it is absolutely not obvious if you can not see the screen. How can I indicate to the VoiceOver user that now a callout is being shown? A Working Extra: The Annotation Rotor The app also contains a custom rotor, to go through the annotations one by one, without also reading the default Points-Of-Interest on the map. Interestingly (or maybe rather as expected), the title of the annotation is correctly only read once. I whould be extremely happy to get some feedback on these issues, it sounds like most of them could be rather common. Thanks! Alex
Posted
by below.
Last updated
.
Post not yet marked as solved
1 Replies
181 Views
Sorry, I did not have a better title for this, I hope it gets clearer with code. The idea is to build a simple facade for Persistent Storage of some objects: class PersistantStorage<T, Codable, Identifiable> {     func store(_ object: T) throws { }          func objectFor(_ key: T.ID) -> T? {         return nil     } } As apparent, there is the generic type T, which is constrained to Codable and Identifiable. Now I want to use the later constraint to define my objectFor method, but the compiler complains: 'ID' is not a member type of type 'T' How would I do this? Or is this completely the wrong approach? Thanks Alex
Posted
by below.
Last updated
.
Post marked as solved
2 Replies
1.5k Views
I would like to declare an @EnvironmentObject as a protocol, namely as protocol AccessTokenProvider: Authenticator {     func accessToken() - AccessTokenPublisher } where Authenticator is public class Authenticator: NSObject, ObservableObject However, when I add this to the environment as var authenticator: AccessTokenProvider = MyAuthenticator() […] ContentView().environmentObject(authenticator) the compiler throws an error at: struct ContentView: View { // error: property type 'AccessTokenProvider' does not match that of the 'wrappedValue' property of its wrapper type 'EnvironmentObject'     @EnvironmentObject var authenticator: AccessTokenProvider                            ^ Is this even a good idea? If so, what am I doing wrong?                            ^
Posted
by below.
Last updated
.
Post not yet marked as solved
1 Replies
164 Views
Today I was reminded that apps on the Mac do not have to be Mach-O Executables: They can be scripts! For example, a python script. But what I found out that if the app is started directly from the terminal, the app starts as ARM64. But if starting from the Finder (i.e. launchd), it is launched as Intel. Is there an Info.plist key that fixes this?
Posted
by below.
Last updated
.
Post not yet marked as solved
1 Replies
605 Views
Hello, on Mac OS, is it possible to see a virtual Camera, such as OBS (https://obsproject.com) as a CaptureDevice? I see that, for example, Google Chrome can use this camera, but using AVCaptureDevice.DiscoverySession I am unable to see it. Am I doing wrong?     var deviceTypes: [AVCaptureDevice.DeviceType] = [.builtInMicrophone, .builtInWideAngleCamera]     #if os(OSX)     deviceTypes.append(.externalUnknown)     #else     deviceTypes.append(contentsOf: [.builtInDualCamera, .builtInDualWideCamera, .builtInTelephotoCamera, .builtInTripleCamera, .builtInTrueDepthCamera, .builtInUltraWideCamera])     #endif     let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: deviceTypes,         mediaType: nil, position: .unspecified)     result = discoverySession.devices.map { device in         device.localizedName     }
Posted
by below.
Last updated
.
Post marked as solved
2 Replies
252 Views
We have our own backend, running on our own server. When iCloud Private Relay is enabled, the requests to the server time out. How can we find out what precisely is failing? TLS 1.3 is enabled on the backend finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x281b0a3d0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <CBAE9DA5-9988-4E55-A732-B759842E411F>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(     "LocalDataTask <CBAE9DA5-9988-4E55-A732-B759842E411F>.<1>" ), NSLocalizedDescription=The request timed out.,
Posted
by below.
Last updated
.
Post marked as solved
1 Replies
1.2k Views
Building my app with Xcode 13, a dependency threw an error related to the changes in CoreBluetooth: Some properties are now returned as optionals in iOS 15. Wanting to fix that, I would like to make sure that the library will run on both iOS 15 and SDKs prior to that, but the current availability markers will not help me:     func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) {         let peripheral: CBPeripheral         // So what I would like is something like this         // But this does not work :(         if  #available(iOS 15, *) {             guard let nonOptional = service.peripheral else {                 return             }             peripheral = nonOptional         } else {             peripheral = service.peripheral         }         let result: CBPeripheral = peripheral         print ("\(result)")     }``` This code will cause the compiler to throw an error both on Xcode 13 and Xcode 12. Is there any good way to solve this?
Posted
by below.
Last updated
.
Post not yet marked as solved
0 Replies
446 Views
Context: Authorized Network requests. I have a process (a publisher, to be precise), which will give me a fresh access token for a request. To do that, I may need user interaction, i.e. show a View, Alert, or something like that. How can I do that in SwiftUI? Can I just (modally) display something, without explicitly being in a View body? Should I have to pass in a "superview" to do this, or do you have other ideas? Thanks Alex
Posted
by below.
Last updated
.
Post marked as solved
3 Replies
4.2k Views
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 &lt;Framework/Umbrella.h&gt; 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 😉
Posted
by below.
Last updated
.
Post not yet marked as solved
0 Replies
258 Views
Hello, in my app, I am using NSUserActivity in order to donate SiriShortcuts. The one that I am donating through the INUIAddVoiceShortcutViewController shows up in the Shortcuts Application, the one that I am donating via becomeCurrent does not. The later does appear in the Siri Suggestion pull-down. For both I am using the same identifier, one comes without additional userData, one does. Might that be the issue?
Posted
by below.
Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
Hello, I am trying to compile arm64 assembly, but the linker tells me that libSystem.dylib can not be found. Is this due to system libraries no longer present on the system (I don't have a 11.0 x86_64 system to compare), or am I doing it wrong? My call is ld -o HelloWorld HelloWorld.o -macosx_version_min 11.0 -lSystem
Posted
by below.
Last updated
.
Post not yet marked as solved
0 Replies
502 Views
Hello,I have a mobile provisioning profile and a developer certificate for a certain team (let’s call it Team ABC), but I am not a member of that team (i.e., in Xcode accounts, I am not logged in as a member of that team).When I want to add a container in the App Groups capability, Xcode tells me I don’t have an account to do that.Is it correct that I must have an active developer account for Team ABC in order to add a container in App Groups?ThanksAlex
Posted
by below.
Last updated
.
Post not yet marked as solved
1 Replies
971 Views
Hello,I am attempting to build the 10.13.3 Kernel, using a script that I modified from existing ones on the net: https://gist.github.com/below/8482f56dd98e1c3802dd436a1e865090However, this fails due to some warnings which are treated as errors (well, after the hack that provides the missing file).Am I doing it wrong? Do I just need to disable -Werror?ThanksAlex
Posted
by below.
Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
Hello,am I supposed to be building network_cmds as a mere mortal, or is this "you can look, but you can't touch" code?Building fails because it can't find the macosx.internal sysroot, and compiling it against the public macos sdk fails because of missing definitions.At least some of these defitions are in the xnu kernel sources, so is it worth the effort trying to compile this project?ThanksAlex
Posted
by below.
Last updated
.