Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Switching apps in 15.2 causes strange error
My app is the client in a client-server document management system. It supports scanning, indexing, and creation of various types documents including PDF, TIFF, various image types, and text. Upon installation of macOS 15.2, I am getting a strange NSInternalInconsistencyException error so long as the following are true: I have created or opened a PDF (or other type) document I click on the desktop/Finder or other app Normally, I would expect this action to put my App in the background, but before that happens, the error is thrown. I am not connected any server at the time. My app is built catch unhandled exceptions and this is what is displayed: At the time the error is thrown, [NSApp mainWindow] appears to be set to nil, but I have no idea if this occurred as result of becoming the background app or because of something I am doing wrong. I never set mainWindow anywhere in my app. I've tried to set a Waitchpoint or various waist try and catch when mainWindow changes, but have come up empty. Note the error is thrown if I hit a breakpoint when debugging in Xcode (because it switches to Xcode). This errors never occurred with previous releases and does not occur when the app is run under 15.1. The app is written in ObjectiveC. I've looked at various app-level flags and info.plist properties and nothing I've seen jumps out at me. I strongly suspect this error is a result of some system-level app attempting to create a UserActivity file (perhaps encrypted) that it can store in the cloud (a feature we would rather not use yet). It could also be trying to do an autosave on my open document-based windows - our NIB files that apply to our documents are marked as Restorable and they worked in prior system releases. Turning the Restorable flag off has no effect on the error. Any clue what I might be missing here? I've spent an embarrassing number of days trying to understand why this is happening.
Topic: UI Frameworks SubTopic: General
1
0
281
Jan ’25
Typographic question for space character
In this UIKit app, I have to display numbers (from 1 to 100), in a label., on several lines, with 8 numbers on each line. Order is computed by the app for a specific purpose. The numbers are separated by space. Label font is Helvetica Neue 15.0. I want to get them aligned vertically. So, I have a padding so that they are all the same length of 4. Problem: the space have smaller width (half in fact) than digits, so alignment is disrupted: Of course, I can use fixed width fonts (like Menlo), but I've not found one that fits (the zero is barred, which is not looking great in the app). I have tried using class func monospacedDigitSystemFont( ofSize fontSize: CGFloat, weight: UIFont.Weight ) -> UIFont and apply to label.text. To no avail as it modifies only digits, not space char. I have found a workaround, padding with 2 spaces instead of one, but is there another solution ? So I am looking for a space character that would have the same width as a digit. There existe thin space (https://en.wikipedia.org/wiki/Whitespace_character) but not larger space. Does it exist ?
5
0
675
Jan ’25
Unable to display SwiftUI View Previews in a Static Framework target
Hello, I am currently encountering an issue where SwiftUI View Previews cannot be displayed when the View is defined in a Static Framework target. This issue only occurs under specific conditions. Environment Xcode: 16.2 Scheme Structure: MainApp Test Target: TestHogeFeature Test Setting: Gather coverage (Code coverage collection) enabled(all) Target Structure: MainApp (Application target) Dependencies: [HogeFeature, Core] HogeFeature (Static Framework target) Dependencies: [Core] Core (Framework target) Dependencies: None TestHogeFeature (Unit test target) Dependencies: [HogeFeature] Summary I am currently working on a SwiftUI-based project and have encountered an issue where Previews fail to display under specific conditions. Below are the details: Issue In the MainApp scheme, when the code coverage collection setting (Gather coverage for) is enabled, Previews for SwiftUI Views within the HogeFeature (Static Framework) target fail to display correctly. However, the issue is resolved by taking one of the following actions: Change HogeFeature from a Static Framework to a Dynamic Framework. Remove the build setting MACH_O_TYPE: staticlib Disable the Gather coverage setting in the MainApp scheme. I have attached the actual error log from the failed Preview. preview error log Questions Why does this issue occur only when using a Static Framework with code coverage enabled? Is there any way to resolve this issue while maintaining the current configuration (Static Framework with code coverage enabled)? I would appreciate any advice or insights regarding the cause and potential solutions.
0
0
504
Jan ’25
How to use .symbolVariant(.contains: )
I'm getting a weird response from Xcode in trying to use symbolVariant(.contains). I also don't understand why it demands the type cast. What am I doing wrong? Here's the code as text: import SwiftUI let Variants: [SymbolVariants] = [ .circle, .square, .fill, .rectangle, .slash, .none ] func varAvail(_ image: Image) -> [SymbolVariants] { var res: [SymbolVariants] = [] for variant in Variants { if image.symbolVariant(.contains(variant)) as! Bool { res.append(variant) } } }
2
0
357
Jan ’25
CATransaction commit [Crashed: com.apple.root.user-initiated-qos.cooperative]
Description We are developing a app for iOS and iPadOS that involves extensive custom drawing of paths, shapes, texts, etc. To improve drawing and rendering speed, we use CARenderer to generate cached images (CGImage) on a background thread. We adopted this approach based on this StackOverflow post: https://stackoverflow.com/a/75497329/9202699. However, we are experiencing frequent crashes in our production environment that we cannot reproduce in our development environment. Despite months of debugging and seeking support from DTS and the Apple Feedback platform, we have not been able to fully resolve this issue. Our recent crash reports indicate that the crashes occur when calling CATransaction.commit(). Crash traceback The method names in this traceback are mapped to those in the code sample below. The app name has been masked. Crashed: com.apple.root.user-initiated-qos.cooperative 0 MyApp 0x887408 specialized static CAUtils.commitCATransaction() + 4340151304 (<compiler-generated>:4340151304) 1 MyApp 0x887408 specialized static CAUtils.commitCATransaction() + 4340151304 (<compiler-generated>:4340151304) 2 MyApp 0x8874a4 specialized static CAUtils.addDrawingItemsToRenderer(xxx) + 250 (CAUtils.swift:250) 3 MyApp 0x887710 specialized static CAUtils.drawOnCGImageWithCARenderer(xxx) + 267 (CAUtils.swift:267) 4 MyApp 0x8878c0 specialized static CAUtils.drawOnCGImageWithCARendererWithRetry(xxx) + 315 (CAUtils.swift:315) 5 MyApp 0x736294 XXXManager.generateCGImages(xxx) + 570 (XXXManager.swift:570) 6 MyApp 0x73404c closure #1 in XXXManager.updateCachedCGImages(xxx) + 427 (XXXManager.swift:427) 7 libswift_Concurrency.dylib 0x61104 swift::runJobInEstablishedExecutorContext(swift::Job*) + 252 8 libswift_Concurrency.dylib 0x62514 swift_job_runImpl(swift::Job*, swift::SerialExecutorRef) + 144 9 libdispatch.dylib 0x15d8c _dispatch_root_queue_drain + 392 10 libdispatch.dylib 0x16590 _dispatch_worker_thread2 + 156 11 libsystem_pthread.dylib 0x4c40 _pthread_wqthread + 228 12 libsystem_pthread.dylib 0x1488 start_wqthread + 8 Code Sample Below is a sample of our code. While the complete snippet is too long, the issue occurs in addDrawingItemsToRenderer. Please refer to the other methods for completeness and reference purposes. private let transactionLock = NSLock() private let deviceLock = NSLock() private let device = MTLCreateSystemDefaultDevice()! /// This is the method we call from outside. @inline(never) static func drawOnCGImageWithCARenderer( layerRect: CGRect, drawingItems: [DrawingItem] ) -> CGImage? { guard let (texture, renderer) = addDrawingItemsToRenderer( layerRect: layerRect, drawingItems: drawingItems ) else { return nil } renderer.beginFrame(atTime: 0, timeStamp: nil) renderer.render() renderer.endFrame() guard let colorSpace = CGColorSpace(name: CGColorSpace.sRGB), let ciImage = CIImage(mtlTexture: texture, options: [.colorSpace: colorSpace]) else { return nil } let context = CIContext() return context.createCGImage(ciImage, from: ciImage.extent) } /// This is the method will the crash happens @inline(never) fileprivate static func addDrawingItemsToRenderer( layerRect: CGRect, drawingItems: [DrawingItem] ) -> (MTLTexture, CARenderer)? { // We have encapsulated everything related to CALayer and its // associated creations and manipulations within CATransaction // as suggested by engineers from Apple Feedback Portal. beginCATransaction() defer { commitCATransaction() // The crash happens here } let (layer, imageWidth, imageHeight) = addDrawingItemsToLayer(layerRect: layerRect, drawingItems: drawingItems) return createTextureAndRenderer( layer: layer, imageWidth: imageWidth, imageHeight: imageHeight ) } // Below are all internal methods. We have split the method into very // granular parts and marked them as @inline(never) to prevent the // compiler from inlining our code, which may otherwise obscure usage // trackback information in our crash reports. @inline(never) fileprivate static func beginCATransaction() { transactionLock.lock() CATransaction.begin() } @inline(never) fileprivate static func commitCATransaction() { // From our crash report, we believe the crash happens on this line. CATransaction.commit() // It is unlikely that the lock cause the crash as we added it only recently // to ensure that there is only one transaction on our background thread, // and after we added this lock, the crash rate indeed lowered, but still // not fully disappear transactionLock.unlock() } -------------------------------- // The methods below are provided for reference and completeness. While // they may have issues, they do not frequently appear in our crash // reports as the one caused by `CATransaction.commit()` @inline(never) fileprivate static func addDrawingItemsToLayer( layerRect: CGRect, drawingItems: [DrawingItem] ) -> (layer: CALayer, imageWidth: CGFloat, imageHeight: CGFloat) { let layer = CALayer() layer.isGeometryFlipped = SharedAppUtils.isIOS layer.anchorPoint = CGPoint.zero layer.bounds = layerRect layer.masksToBounds = true for drawingItem in drawingItems { // We have thousands or hundred thousands of drawing items to add. // Each drawing item may produce a CALayer, CAShapeLayer or CATextLayer. // This is also why we want to utilise CARenderer to leverage GPU rendering. let sublayerForDrawingItem = drawingItem.createCALayerOrCATextLayerOrCAShapeLayer() layer.addSublayer(sublayerForDrawingItem) } let imageWidth = max(1, layer.frame.size.width * UIScreen.main.scale) let imageHeight = max(1, layer.frame.size.height * UIScreen.main.scale) layer.transform = CATransform3DMakeScale(UIScreen.main.scale, UIScreen.main.scale, 1) layer.frame = .init(origin: .zero, size: .init(width: imageWidth, height: imageHeight)) return (layer, imageWidth, imageHeight) } @inline(never) fileprivate static func createTextureAndRenderer( layer: CALayer, imageWidth: CGFloat, imageHeight: CGFloat ) -> (MTLTexture, CARenderer)? { deviceLock.lock() defer { deviceLock.unlock() } let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor( pixelFormat: .rgba8Unorm, width: Int(imageWidth), height: Int(imageHeight), mipmapped: false ) textureDescriptor.usage = [MTLTextureUsage.shaderRead, .shaderWrite, .renderTarget] guard let texture = device.makeTexture(descriptor: textureDescriptor) else { return nil } let renderer = CARenderer(mtlTexture: texture) renderer.bounds = layer.frame renderer.layer = layer.self return (texture, renderer) }
1
1
490
Jan ’25
Keyboard doesn't close if QuickType bar is open for password auto-fill in SwiftUI when using associated domains.
Description Our app (and sample app) are using associated domains to support deep linking. As an unintended side effect we get full support for auto-filling passwords with the QuickType bar on our login screen. However, after the username and password fields are filled and the user taps the Login button, the keyboard stays on screen. We have tried everything I can think of including @FocusState and UIKit resignFirstResponder, among other things. Our login screen is in a fullscreencover or sheet. When the sheet dismisses the keyboard is still present. In my sample app (and the code below) if I use a navigation stack and push the next view onto the stack, the keyboard closes. I'm not able to provide a useful video because the iOS keyboard closes when focus is in a SecureField. *Note: If we remove the associated domain from our app (and website) the backup iOS password functionality takes over and the keyboard works as expected. Code struct ContentView: View { @State private var name: String = "" @State private var password: String = "" @State private var showLogin = false @FocusState private var isFocused: Bool var body: some View { VStack { Button("Login") { showLogin.toggle() } } .fullScreenCover(isPresented: $showLogin) { VStack { TextField("Enter your name", text: $name) .textFieldStyle(.roundedBorder) .focused($isFocused) SecureField("Enter password", text: $password) .autocapitalization(.none) .autocorrectionDisabled(true) .textContentType(.password) .focused($isFocused) Button("Login") { isFocused = false showLogin = false } .buttonStyle(.borderedProminent) } } } } Steps to Reproduce Launch sample app Tap 'Login' Place keyboard focus in the first text field (name) Keyboard with QuickType bar opens Tap 'Passwords' Create a new password for this login item (choose any username) Passwords will close Tap 'Login' to close the sheet Force close the app Reopen the app Tap 'Login' Place keyboard focus in the first text field (name) Keyboard with QuickType” bar opens Tap the auto-fill password button (password for atomicrobot.com in my case) User name and password fields are filled out Keyboard with QuickType bar is still open; keyboard focus is in "password" field Tap 'Login' Sheet closes, keyboard is still open
Topic: UI Frameworks SubTopic: SwiftUI
1
0
304
Jan ’25
Swift unable to find sound file
Hi everyone, I'm currently facing an issue with AVAudioPlayer in my SwiftUI project. Despite ensuring that the sound file "buttonsound.mp3" is properly added to the project's resources (I dragged and dropped it into Xcode), the application is still unable to locate the file when attempting to play it. Here's the simplified version of the code I'm using: import SwiftUI import AVFoundation struct ContentView: View { var body: some View { VStack { Button("Play sound") { playSound(named: "buttonsound", ofType: "mp3") } } } } func playSound(named name: String, ofType type: String) { guard let soundURL = Bundle.main.url(forResource: name, withExtension: type) else { print("Sound file not found") return } do { let audioPlayer = try AVAudioPlayer(contentsOf: soundURL) audioPlayer.prepareToPlay() audioPlayer.play() } catch let error { print("Error playing sound: \(error.localizedDescription)") } }
8
0
2.7k
Jan ’25
iOS 18.3 Beta 1 Screen Time tracking got worse?
Hi there, I am flagging for extra attention that it feels to me that something feels extra off about Screen Time tracking in iOS 18.3 Beta. There's been many days now where I can't reconcile the time spent (it's much higher than expected - by multiple hours). Feedback is here with an image: FB16270245. Not sure if happens on Beta 2 - just upgraded.
2
1
704
Jan ’25
ProgressView does not complete on long running tasks
My project implements a way of copying files via drag and drop on MacOS. I use the ProgressView to show the progress of the copy operation. Conveniently Progress is used to interact with the NSItemProvider and the ProgressView. On longer running tasks (still seconds) the ProgressView is updated at first, but always stops before completion. The Progress Object has completed on the other hand, but it seems that the last update ist not affected. I am now using a timer to update the view, but that is somewhat a workaround. This is the code that is in the view. struct DragView: View { @State private var progress: Progress! var body: some View { ProgressView(value: progress.fractionCompleted, total: 1) } } Any hints into how I can get this to work? I am using Xcode 16.2
Topic: UI Frameworks SubTopic: SwiftUI
3
0
286
Jan ’25
SwiftUI Popover clips in iOS18
When you try to present medium height popover from the bottom of iPhone view then popover is clipped in iOS18 but works in old devices Sample code Button("Show Popover") { showPopover.toggle() } .popover( isPresented: $showPopover, arrowDirection: arrowDirection ) { conent } Result
5
0
1.9k
Jan ’25
SwiftUI crashes EXC_BREAKPOINT at _dispatch_semaphore_dispose
Based on crash reports for our app in production, we're seeing these SwiftUI crashes but couldn't figure out why it is there. These crashes are pretty frequent (>20 crashed per day). Would really appreciate it if anyone has any insight on why this happens. Based on the stacktrace, i can't really find anything that links back to our app (replaced with MyApp in the stacktrace). Thank you in advance! Crashed: com.apple.main-thread 0 libdispatch.dylib 0x39dcc _dispatch_semaphore_dispose.cold.1 + 40 1 libdispatch.dylib 0x4c1c _dispatch_semaphore_signal_slow + 82 2 libdispatch.dylib 0x2d30 _dispatch_dispose + 208 3 SwiftUICore 0x77f788 destroy for StoredLocationBase.Data + 64 4 libswiftCore.dylib 0x3b56fc swift_arrayDestroy + 196 5 libswiftCore.dylib 0x13a60 UnsafeMutablePointer.deinitialize(count:) + 40 6 SwiftUICore 0x95f374 AtomicBuffer.deinit + 124 7 SwiftUICore 0x95f39c AtomicBuffer.__deallocating_deinit + 16 8 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 9 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 10 SwiftUICore 0x77e53c StoredLocation.deinit + 32 11 SwiftUICore 0x77e564 StoredLocation.__deallocating_deinit + 16 12 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 13 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 14 MyApp 0x1673338 objectdestroyTm + 6922196 15 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 16 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 17 SwiftUICore 0x650290 _AppearanceActionModifier.MergedBox.__deallocating_deinit + 32 18 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 19 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 20 SwiftUICore 0x651b44 closure #1 in _AppearanceActionModifier.MergedBox.update()partial apply + 28 21 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 22 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 23 libswiftCore.dylib 0x3b56fc swift_arrayDestroy + 196 24 libswiftCore.dylib 0xa2a54 _ContiguousArrayStorage.__deallocating_deinit + 96 25 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 26 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 27 SwiftUICore 0x4a6c4c type metadata accessor for _ContiguousArrayStorage<CVarArg> + 120 28 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 29 libswiftCore.dylib 0x3d8950 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1>>::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 160 30 SwiftUICore 0x4a5d88 static Update.dispatchActions() + 1332 31 SwiftUICore 0xa0db28 closure #2 in closure #1 in ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 132 32 SwiftUICore 0xa0d928 closure #1 in ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 708 33 SwiftUICore 0xa0b0d4 ViewRendererHost.render(interval:updateDisplayList:targetTimestamp:) + 556 34 SwiftUI 0x8f1634 UIHostingViewBase.renderForPreferences(updateDisplayList:) + 168 35 SwiftUI 0x8f495c closure #1 in UIHostingViewBase.requestImmediateUpdate() + 72 36 SwiftUI 0xcc700 thunk for @escaping @callee_guaranteed () -> () + 36 37 libdispatch.dylib 0x2370 _dispatch_call_block_and_release + 32 38 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20 39 libdispatch.dylib 0x129e0 _dispatch_main_queue_drain + 980 40 libdispatch.dylib 0x125fc _dispatch_main_queue_callback_4CF + 44 41 CoreFoundation 0x56204 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 42 CoreFoundation 0x53440 __CFRunLoopRun + 1996 43 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588 44 GraphicsServices 0x11c4 GSEventRunModal + 164 45 UIKitCore 0x3d2eb0 -[UIApplication _run] + 816 46 UIKitCore 0x4815b4 UIApplicationMain + 340 47 SwiftUI 0x101f98 closure #1 in KitRendererCommon(_:) + 168 48 SwiftUI 0xe2664 runApp<A>(_:) + 100 49 SwiftUI 0xe5490 static App.main() + 180 50 MyApp 0x8a7828 main + 4340250664 (MyApp.swift:4340250664) 51 ??? 0x1ba496ec8 (Missing)
0
0
530
Jan ’25
CoreAutoLayout -[NSISEngine positiveErrorVarForBrokenConstraintWithMarker:errorVar:]
My App always encounter with CoreAutoLayout invade My SnapKit layout constraint as follow: popBgView.snp.makeConstraints { make in make.centerY.equalToSuperview() make.leading.equalTo(assistantTeacherView.snp.trailing).offset(.isiPad ? -50 : -40) if TTLGlobalConstants.isCompactScreen320 { make.width.lessThanOrEqualTo(300) } else { let widthRatio = .isiPad ? 494.0 / 1024.0 : 434.0 / 812.0 make.width.lessThanOrEqualTo(TTLGlobalConstants.screenWidth * widthRatio) } bubbleViewRightConstraint = make.trailing.equalToSuperview().constraint } ..... popBgView.addSubview(functionView) msgLabel.snp.remakeConstraints { make in make.leading.equalToSuperview().inset(Metric.msgLabelHorizantalInset) make.centerY.equalToSuperview() make.trailing.lessThanOrEqualToSuperview().inset(Metric.msgLabelHorizantalInset) make.top.equalTo(Metric.msgLabelVerticalInset) } functionView.snp.makeConstraints { make in make.leading.equalTo(msgLabel.snp.trailing).offset(Metric.msgLabelFunctionSpacing) make.centerY.equalToSuperview() make.trailing.equalToSuperview().offset(-Metric.msgLabelHorizantalInset) } msgLabel and functionView superview is popBgView However, when I try remove from superview for functionView, There is low probability crash: OS Version: iOS 16.1.1 (20B101) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: SEGV_NOOP Crashed Thread: 0 Application Specific Information: Exception 1, Code 1, Subcode 14967683541490370463 > KERN_INVALID_ADDRESS at 0xcfb7e4e0f8fe879f. Thread 0 Crashed: 0 CoreAutoLayout 0x382555f44 -[NSISEngine positiveErrorVarForBrokenConstraintWithMarker:errorVar:] 1 CoreAutoLayout 0x382555e9c -[NSISEngine positiveErrorVarForBrokenConstraintWithMarker:errorVar:] 2 CoreAutoLayout 0x3825557e4 -[NSISEngine removeConstraintWithMarker:] 3 CoreAutoLayout 0x382555198 -[NSLayoutConstraint _removeFromEngine:] 4 UIKitCore 0x34d87961c __57-[UIView _switchToLayoutEngine:]_block_invoke 5 CoreAutoLayout 0x382556e8c -[NSISEngine withBehaviors:performModifications:] 6 UIKitCore 0x34d8a1c38 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] 7 UIKitCore 0x34d7f01b0 __57-[UIView _switchToLayoutEngine:]_block_invoke_2 8 UIKitCore 0x34d879770 __57-[UIView _switchToLayoutEngine:]_block_invoke 9 CoreAutoLayout 0x382556e8c -[NSISEngine withBehaviors:performModifications:] 10 UIKitCore 0x34d8a1c38 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] 11 UIKitCore 0x34d8a1848 __45-[UIView _postMovedFromSuperview:]_block_invoke 12 UIKitCore 0x34e7ff8d0 -[UIView _postMovedFromSuperview:] 13 UIKitCore 0x34d85e3c8 __UIViewWasRemovedFromSuperview 14 UIKitCore 0x34d85b1a4 -[UIView(Hierarchy) removeFromSuperview] 15 Collie-iPad 0x203001550 [inlined] InClassAssistantView.functionView.didset (InClassAssistantView.swift:105)
Topic: UI Frameworks SubTopic: UIKit
0
0
241
Jan ’25
[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] Crash
In iOS 18, we encountered a crash: Thread 4 name: com.apple.root.user-interactive-qos Thread 4 Crashed: 0 CoreFoundation 0x18c4f9b10 __CFCheckCFInfoPACSignature + 4 1 CoreFoundation 0x18c53ed64 CFBundleGetInfoDictionary + 24 2 CoreFoundation 0x18c53ed1c CFBundleGetIdentifier + 16 3 Foundation 0x18b153740 -[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] + 84 4 UIKitCore 0x18ef26ef0 ___UIKitUserDefaults_block_invoke + 40 5 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 6 libdispatch.dylib 0x1941ef918 _dispatch_once_callout + 32 7 UIKitCore 0x18ef9de28 _UIKitUserDefaults + 80 8 UIKitCore 0x18f058a7c ___UIKitPreferencesOnce_block_invoke + 20 9 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 10 libdispatch.dylib 0x1941ef918 _dispatch_once_callout + 32 11 UIKitCore 0x18f056c8c _UIKitPreferencesOnce + 80 12 UIKitCore 0x18f0563b8 ___UIApplicationMainPreparations_block_invoke + 20 13 libdispatch.dylib 0x1941ec370 _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x1941ee0d0 _dispatch_client_callout + 20 15 libdispatch.dylib 0x1941fff60 _dispatch_root_queue_drain + 860 16 libdispatch.dylib 0x194200590 _dispatch_worker_thread2 + 156 17 libsystem_pthread.dylib 0x2136ffc40 _pthread_wqthread + 228 18 libsystem_pthread.dylib 0x2136fc488 start_wqthread + 8 Below image show more details: And after set a symbol breakpoint: [NSUserDefaults _initWithSuiteName:container:] We found that at the beginning of app launch, the system will call it: It not always crash, but sometimes especially when app upgrade, what the root cause maybe?
2
0
321
Jan ’25
[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] Crash
When using: [[NSUserDefaults alloc] initWithSuiteName:@"TestSuiteName"]; It sometimes cause crash, the crash detail is: Thread 4 name: com.apple.root.user-interactive-qos Thread 4 Crashed: 0 CoreFoundation 0x1963f9b10 __CFCheckCFInfoPACSignature + 4 1 CoreFoundation 0x19643ed64 CFBundleGetInfoDictionary + 24 2 CoreFoundation 0x19643ed1c CFBundleGetIdentifier + 16 3 Foundation 0x195053740 -[NSUserDefaults(NSUserDefaults) _initWithSuiteName:container:] + 84 4 UIKitCore 0x198e26ef0 ___UIKitUserDefaults_block_invoke + 40 5 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 6 libdispatch.dylib 0x19e0ef918 _dispatch_once_callout + 32 7 UIKitCore 0x198e9de28 _UIKitUserDefaults + 80 8 UIKitCore 0x198f58a7c ___UIKitPreferencesOnce_block_invoke + 20 9 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 10 libdispatch.dylib 0x19e0ef918 _dispatch_once_callout + 32 11 UIKitCore 0x198f56c8c _UIKitPreferencesOnce + 80 12 UIKitCore 0x198f563b8 ___UIApplicationMainPreparations_block_invoke + 20 13 libdispatch.dylib 0x19e0ec370 _dispatch_call_block_and_release + 32 14 libdispatch.dylib 0x19e0ee0d0 _dispatch_client_callout + 20 15 libdispatch.dylib 0x19e0fff60 _dispatch_root_queue_drain + 860 16 libdispatch.dylib 0x19e100590 _dispatch_worker_thread2 + 156 17 libsystem_pthread.dylib 0x21d7dfc40 _pthread_wqthread + 228 18 libsystem_pthread.dylib 0x21d7dc488 start_wqthread + 8 and for more detail crash info can see the attachment image . And Refer to the API's description: /// -initWithSuiteName: initializes an instance of NSUserDefaults that searches the shared preferences search list for the domain 'suitename'. For example, using the identifier of an application group will cause the receiver to search the preferences for that group. Passing the current application's bundle identifier, NSGlobalDomain, or the corresponding CFPreferences constants is an error. Passing nil will search the default search list. - (nullable instancetype)initWithSuiteName:(nullable NSString *)suitename API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0)) NS_DESIGNATED_INITIALIZER; It seems using a constants string is a wrong way. Does any one know what to root cause?
2
0
369
Jan ’25
App Clip No Available
1.APPStore Arraignment passed. Not yet released. The diagnostic link configuration is not available. Firstly,We filled in the configuration of the corresponding domain name, and the verification was successful. My AASA file is configured correctly (general deep links work with it, as well as some app clip URLs) and is also configured for app clips. "applinks": { "apps": [], "details": [ { "appID": "xxx.com.xx.easyshare", "paths": [ "*" ] }, { "appID": "xxx.com.xx.easyshareExport", "paths": [ "*" ] } ] }, "appclips": { "apps": [ "xxx.com.xx.easyshare.Clip" ] } } Well,I used https://es.xx.com/send or https://es.xx.com to get diagnostic information is wrong My TestFight config is ok Another problem is that using NFT jumps directly to Safire.
1
0
338
Jan ’25
App crash when using SwiftUI view in UICollectionView
Several users are seeing a crash that occurs when configureCell is called for a UICollectionView. This seems to occur specifically for cells that add SwiftUI views using UIHostedConfiguration. 0 libsystem_kernel.dylib 0xc1d4 __pthread_kill + 8 1 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 2 libsystem_c.dylib 0x77ad8 abort + 128 3 libswiftCore.dylib 0x3cc1a4 swift::fatalError(unsigned int, char const*, ...) + 134 4 libswiftCore.dylib 0x3cc1c4 swift::warningv(unsigned int, char const*, char*) + 30 5 libswiftCore.dylib 0x3cc810 swift_beginAccess + 538 6 libswiftCore.dylib 0x3cc864 swift_beginAccess + 84 7 SwiftUI 0x947a0 _UIHostingView._rootView.getter + 92 8 SwiftUI 0x94668 _UIHostingView.makeRootView() + 432 9 SwiftUI 0x943b8 _UIHostingView.updateRootView() + 264 10 SwiftUICore 0xa0d000 closure #1 in ViewRendererHost.updateGraph() + 204 11 SwiftUICore 0x1f1308 partial apply for thunk for @escaping @callee_guaranteed () -&gt; () + 28 12 AttributeGraph 0x144a8 AGGraphWithUpdate + 84 13 SwiftUICore 0x4a5f60 @objc closure #1 in closure #1 in closure #1 in static Update.syncMain(_:) + 84 14 SwiftUICore 0x3620 wait_for_lock + 112 15 SwiftUICore 0x3588 _MovableLockLock + 68 16 SwiftUICore 0x5bb6d4 _ViewList_ReleaseElements.deinit + 64 17 SwiftUICore 0x5bb838 _ViewList_ReleaseElements.__deallocating_deinit + 16 18 libswiftCore.dylib 0x3d783c _swift_release_dealloc + 56 19 libswiftCore.dylib 0x3d8950 bool swift::RefCounts&lt;swift::RefCountBitsT&lt;(swift::RefCountInlinedness)1&gt;&gt;::doDecrementSlow&lt;(swift::PerformDeinit)1&gt;(swift::RefCountBitsT&lt;(swift::RefCountInlinedness)1&gt;, unsigned int) + 160 20 SwiftUICore 0x7cf7bc assignWithTake for _ViewList_View + 52 21 SwiftUICore 0x18dbe0 assignWithTake for ExclusiveGesture + 76 22 SwiftUI 0x13aff8 outlined assign with take of ModifiedContent&lt;TableRowView, CollectionViewCellModifier&gt; + 100 23 SwiftUI 0x1394fc specialized PlatformListCell&lt;&gt;.defaultConfigureContent(_:transaction:) + 296 24 SwiftUI 0xb8308 CollectionViewListDataSource.configureCell(_:transaction:context:) + 1200 25 SwiftUI 0xb8e20 ShadowListDataSource.configureCell(_:transaction:context:) + 1336 26 SwiftUI 0xb670c closure #1 in UICollectionViewListCoordinatorBase.updateListContents(_:) + 452 27 SwiftUI 0xead7b4 partial apply for closure #1 in ListCoreDataSource.visitRowAt&lt;A&gt;(_:visitor:) + 32 28 SwiftUI 0xb6160 partial apply for closure #1 in ListCoreDataSource.visitRowAt&lt;A&gt;(_:visitor:) + 16 29 SwiftUI 0x171e1c Optional.map&lt;A, B&gt;(_:) + 516 30 SwiftUI 0xb98d8 ListCoreDataSource.visitRowAt&lt;A&gt;(_:visitor:) + 1064 31 SwiftUI 0x33b3c ListCoreDataSource.visitContent&lt;A&gt;(atRow:visitor:) + 536 32 SwiftUI 0xb5478 UICollectionViewListCoordinatorBase.updateListContents(_:) + 1696 33 SwiftUI 0x942dac closure #1 in performUpdates #1 &lt;A, B&gt;() in UICollectionViewListCoordinatorBase.update(_:to:transaction:performDiff:) + 416 34 SwiftUI 0x3261cc thunk for @escaping @callee_guaranteed (@unowned Bool) -&gt; () + 48 35 SwiftUI 0x94cf88 closure #1 in UpdateCoalescingCollectionView.performBatchUpdates(_:completion:) + 308 36 SwiftUI 0x3261cc thunk for @escaping @callee_guaranteed (@unowned Bool) -&gt; () + 48 37 UIKitCore 0x2b9bbc -[UICollectionView _updateAnimationDidStop:finished:] + 1240 38 UIKitCore 0xa02c38 __118-[UICollectionView _startViewAnimationsWithContext:oldVisibleViews:viewAnimator:viewAnimationsCompletedDispatchGroup:]_block_invoke + 36 39 UIKitCore 0x7d788 __47-[UICollectionViewAnimation startWithAnimator:]_block_invoke_3 + 272 40 UIKitCore 0x7bfb0 __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 36 41 UIKitCore 0x7be94 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 624 42 UIKitCore 0x7abb0 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 436 43 UIKitCore 0x86f38 -[UIViewAnimationState animationDidStop:finished:] + 192 44 QuartzCore 0x4e3cc run_animation_callbacks(void*) + 132 45 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20 46 libdispatch.dylib 0x129e0 _dispatch_main_queue_drain + 980 47 libdispatch.dylib 0x125fc _dispatch_main_queue_callback_4CF + 44 48 CoreFoundation 0x56204 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 49 CoreFoundation 0x53440 __CFRunLoopRun + 1996 50 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588 51 GraphicsServices 0x11c4 GSEventRunModal + 164 52 UIKitCore 0x3d2eb0 -[UIApplication _run] + 816 53 UIKitCore 0x4815b4 UIApplicationMain + 340 The crashes started occurring in October and only for iOS 18 users (all versions from 18.0.0 to 18.2.0). We have several cell types that use SwiftUI views and I haven't been able to isolate the issue to any particular cell type. I have tried setting contentConfiguration = nil in prepareForReuse but this didn't help. Has there been a change in UICollectionView/UIHostingConfiguration in iOS 18? Any ideas on how this can be further investigated or resolved?
1
1
757
Jan ’25