Post

Replies

Boosts

Views

Activity

What's the best way to know when a user is editing a SecureField in SwiftUI?
What's the best way to know when a user is editing a SecureField in SwiftUI? Our normal way of detecting this is via an .onTapGesture modifier attached to the SecureField. However if the user is using a hardware keyboard, they don't have to tap into the field. Instead they can use arrow keys or tab to select a particular SecureField and begin editing it, in which case our .onTapGesture event does not happen. I've been looking for an event like .onBeginEditing, or .willBeginEditing, however I don't see that there's any modifiers like this available for SecureField. Our designers want us to change the border thickness of the field that's currently being edited so it's obvious, and of course we want to scroll that field into view if it's off-screen. How can we do stuff like this in SwiftUI with SecureField? Thanks.
4
0
1.9k
Sep ’20
Downsides of using VMWare ESXi instances as Jenkins/Fastlane/Xcode build nodes?
Hi, Our CI pipeline has 2013 Mac Pros running two Catalina VMs each using VMWare ESXi. Each VM is currently configured with macOS Catalina 10.15.5, Xcode 11.5, Jenkins, and Fastlane. Each VM is allotted exactly half the CPU cores and RAM of the host machine. We've been experiencing intermittent build failures where some tests take too long to run and timeout, and sometimes network requests to fetch provisioning profiles also fail. I'm wondering if perhaps we should reduce the CPU & RAM allotment to each VM in order to increase the resources available to the underlying host? Or does anyone know of any fundamental flaws with this kind of setup that might contribute to instability? If so is there any other supported way to handle multiple simultaneous builds per machine? We're just trying to take maximal advantage of the hardware available on our pipeline. Thanks in advance for any tips/advice! (Please see this post - https://developer.apple.com/forums/thread/657532 for details on the kinds of build issues we've been seeing.)
0
0
571
Aug ’20
What are the proper macOS Security & Privacy that should be granted for Xcode to work properly on CI with Jenkins and Fastlane?
What are the proper macOS Security & Privacy that should be granted for Xcode to work properly on CI with Jenkins and Fastlane? We have intermittent build failures causing about half of our CI builds to randomly fail in unpredictable ways. (See below for examples of the kinds of failures we get on about half our builds.) So my question is: other than installing Xcode, is there anything else we need to do in order to make sure that the system can be used to build software via Jenkins and Fastlane? Like do we need to add Xcode to "Developer Tools" in System Preferences > Security & Privacy > Privacy tab? What else do we need to add to that tab for Jenkins and Fastlane not to have all these problems? All our build nodes are Mac Pros with 32 GB RAM so I know that hardware and resources aren't the problem. We couldn't get 11.3 to work on Catalina at all, and at WWDC Apple told us that it was because the new Xprotect was attacking the simulators and it was fixed in Xcode 11.4 and later. However many of the log messages we're seeing for the failures with 11.5 are the same exact log messages we were seeing when 11.3 would fail on Catalina. It reminds me of an immune disease where antibodies attack healthy tissue. As well, our unit tests often run extremely slow causing test failures due to timeouts. There is no apparent reason for this either. I don't know why these issues are intermittent. I don't know why they are happening. Please help. Examples of the build failures: One log message I see a lot is, os_unix.c:43353: (2) open(/var/db/DetachedSignatures) - No such file or directory builtin-RegisterExecutionPolicyException /Users/jenkins/jenkins_workspace/build/ios/fastlane/output/derivedData/Build/Intermediates.noindex/ArchiveIntermediates/Redacted/InstallationBuildProductsLocation/Applications/Redacted.app note: Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (in target 'Redacted' from project 'Redacted') Or we'll have SimulatorTrampoline get a SIGKILL in the middle of test runs, and the error will say operation never finished bootstrapping, no restart will be attempted. Underlying error: test runner exited before starting test execution. Or it'll be: Redacted.app (26246) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: Crash: Redacted (26246): +[XCTWaiter handleStalledWaiter:])) Sometimes it results in a dialog box showing up on the associated build node that says "Simulator quit unexpectedly. Click Reopen to open the application again." Clicking "show details" on that box led to a NSInternalInconsistency exception. Or we'll get: Aug 16 14:50:03 Mac-102 CoreSimulatorService[494] <Error>: Error Domain=com.apple.CoreSimulator.SimError Code=165 "Unable to lookup in current state: Shutting Down" UserInfo={NSLocalizedDescription=Unable to lookup in current state: Shutting Down} Or we'll get: Aug 16 14:49:57 Mac-102 com.apple.CoreSimulator.SimDevice.FE9C2901-932B-416E-8931-41C1A5FE09FC[42746] (com.apple.xpc.launchd.domain.pid.testmanagerd.42775): Failed to bootstrap path: path = /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim, error = 2: No such file or directory Aug 16 14:49:57 Mac-102 com.apple.CoreSimulator.SimDevice.FE9C2901-932B-416E-8931-41C1A5FE09FC[42746] (com.apple.xpc.launchd.domain.pid.LogArchiveCollector.43535): Failed to bootstrap path: path = /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 13.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim, error = 2: No such file or directory Or we'll get: codesign cannot open file at line errors. Or we'll get: [2020-08-16T21:54:41.468Z] Error Domain=IDEProvisioningErrorDomain Code=9 ""Redacted.app" requires a provisioning profile with the Associated Domains, iCloud, and Push Notifications features." UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription="Redacted.app" requires a provisioning profile with the Associated Domains, iCloud, and Push Notifications features., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}
1
0
1.2k
Aug ’20
Bug? Updating accessibility priority does not change UI focus in subview of SwiftUI in hybrid UIKit/SwiftUI view
We use a SwiftUI ForEach (using an "id" property on some elements of an array) to render a form with various text fields. Initially the accessibility sort priority of all these text fields starts as the default 0.00. However when the user submits the form, if there are any validation errors on their entries, we increase the sort priority to 1.00 for the fields with errors, with the goal that the VoiceOver focus would jump to the highest-priority element after the view refreshes. However, it flat out doesn't work: after changing the accessibility sort priority, nothing actually changes for the user of the app—accessibility still goes in the exact same order as if the sort priority did not exist, and there seems to be no way in SwiftUI to programmatically force the accessibility focus to jump to a particular field that needs attention, or cause a particular field to become the first responder, etc. A major goal of our project is to see how much we can do in SwiftUI without resorting to using any UIKit APIs (other than UIHostingController), so please bear that in mind when suggesting a solution, thanks!
2
0
1.1k
Aug ’20
How can we override the resetting of cursor position in UITextField?
We have adopted a redux pattern. That means we return false in UITextField's "shouldReplaceCharacters inRange" function. From there we dispatch an UpdateStateAction to our ReSwift store. Then once the reducers have updated the state, we set a new state on our UI. As part of setting the new state, we'll call "textField.text = newValue" on whatever text field was being edited. Sadly, when you wholesale replace the text on the text field in this way, it resets the insertion point to the end of the text field. Is there any way to override this annoying behavior? It seems to occur due to the following private method being called under the hood by the private class, UIFieldEditor: _setAttributedTextInRange:replacementText:andSetCaretSelectionAfterText How can we avoid this ever being called? I have found the only valid workaround to be, saving the selected text range's start position as a UITextPosition of the field before the change, and making sure to offset it by however many characters are being added, then to update the selectedTextRange after calling "text = newValue". However this is kludgy and we don't like it. It's very annoying for UITextField to have such a bizarre, mysterious hidden behavior and seemingly no way to override it. Surely I'm overlooking some thing? Thanks PS—The only workaround I found was this answer from five years go on an unrelated StackOverflow question from six and a half years ago: https://stackoverflow.com/a/29195723/12587089
0
0
2.4k
Jul ’20
Using Swift 5.0.1 Toolchain in XCode 11
If I use the Swift 5.0.1. toolchain from swift.org within XCode 11, will this make binaries that can be uploaded to App Store and be compatible with frameworks compiled using XCode 10.3 with its default toolchain?If not, why not?Does that answer depend on whether I have the debug symbols installed?If so, why?ThanksO_G
1
0
665
Jan ’20