Construct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.

Posts under UIKit tag

178 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

TextKit2 : - The text inserted between the attributedText(Paragraph) doesn't inherit the attributes of existing text
I have added an custom attribute for a paragraph using the below method textStorage.addAttribute(.customCase, value: "checkList", range: paragraphRange) When I insert some text in between the text which contains the custom attribute, that text is not inheriting/propagating the custom attribute of existing paragraph text Old Text : - This is a test New Text : - This is "some new" a test The inserted part is not getting the custom attribute of the old text, Can I know why it's happening, Is it some textKit2's behaviour.
0
0
399
Dec ’24
Hide header animated from UICollectionViewCompositionalLayout
Hello! I have a collectionView and assigned a layout to it: collectionView.collectionViewLayout = createLayout(hasHeader: true) func createLayout(hasHeader: Bool) -> UICollectionViewCompositionalLayout { let layout = UICollectionViewCompositionalLayout { [weak self] (section,environment) -> NSCollectionLayoutSection? in // configure cells } // adding a header: if hasHeader { let header = //... layout.boundarySupplementaryItems.append(header) } return layout } Now, I just want to hide the header (animated). Removing the header can simply be done this way, but this is not animated: collectionView.collectionViewLayout = createLayout(hasHeader: false) Is there any other possibility to hide it animated?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
317
Dec ’24
Immersive Space not working
if I set UIApplicationPreferredDefaultSceneSessionRole to UISceneSessionRoleImmersiveSpaceApplication then my Immersive Space for image is working fine but when I try with UIWindowSceneSessionRoleApplication this option and try to open Immersive space on particular sub screen then its not showing image in immersive space(Immersive space not open). Any one have idea what the issue. <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationPreferredDefaultSceneSessionRole</key> <string>UIWindowSceneSessionRoleApplication</string> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>UISceneSessionRoleImmersiveSpaceApplication</key> <array> <dict> <key>UISceneInitialImmersionStyle</key> <string>UIImmersionStyleFull</string> </dict> </array> </dict> </dict> My info.plist value as above
1
0
491
Dec ’24
Crash using NSMutableAttributedString with an HMTL document inside a collection view - iOS 18, XCode 16
We're attempting to upgrade to XCode 16 but are encountering a consistent crash when doing so. The actual exception message comes from the UICollectionView, with this message and stack trace. *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: <Redacted: 0x17831f080; baseClass = UICollectionViewCell; frame = (16 923.667; 408 450); layer = <CALayer: 0x6000004ad680>>; Collection view: <UICollectionView: 0x10ca67000; frame = (0 0; 440 809.667); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000d41e60>; backgroundColor = <UIDynamicProviderColor: 0x600000285640; provider = <__NSMallocBlock__: 0x600000c7aac0>>; layer = <CALayer: 0x600000322400>; contentOffset: {0, 139.66666666666666}; contentSize: {440, 3247.625}; adjustedContentInset: {0, 0, 34, 0}; layout: <UICollectionViewCompositionalLayout: 0x15a8732a0>; dataSource: <_TtGC5UIKit34UICollectionViewDiffableDataSourceOC8Redacted_: 0x60000000ead0>>' *** First throw call stack: ( 0 CoreFoundation 0x00000001804b910c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x0000000180092da8 objc_exception_throw + 72 2 Foundation 0x0000000180e67c70 _userInfoForFileAndLine + 0 3 UIKitCore 0x00000001852348a4 __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.445 + 136 4 UIKitCore 0x0000000185b2a42c -[_UICollectionViewSubviewManager removeAllDequeuedViewsWithEnumerator:] + 188 5 UIKitCore 0x000000018523436c -[UICollectionView _updateVisibleCellsNow:] + 4000 6 UIKitCore 0x0000000185234288 -[UICollectionView _updateVisibleCellsNow:] + 3772 7 UIKitCore 0x0000000185239174 -[UICollectionView layoutSubviews] + 284 8 UIKitCore 0x00000001860a3418 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2404 9 QuartzCore 0x000000018b335624 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 432 10 QuartzCore 0x000000018b3403f8 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 124 11 QuartzCore 0x000000018b272430 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 464 12 QuartzCore 0x000000018b2a0c70 _ZN2CA11Transaction6commitEv + 652 13 QuartzCore 0x000000018b2a21c4 _ZN2CA11Transaction25flush_as_runloop_observerEb + 68 14 UIKitCore 0x0000000185b302fc _UIApplicationFlushCATransaction + 48 15 UIKitCore 0x0000000185a60eb4 __setupUpdateSequence_block_invoke_2 + 352 16 UIKitCore 0x00000001850a5cec _UIUpdateSequenceRun + 76 17 UIKitCore 0x0000000185a60858 schedulerStepScheduledMainSection + 168 18 UIKitCore 0x0000000185a5fc90 runloopSourceCallback + 80 19 CoreFoundation 0x000000018041d294 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 20 CoreFoundation 0x000000018041d1dc __CFRunLoopDoSource0 + 172 21 CoreFoundation 0x000000018041c99c __CFRunLoopDoSources0 + 324 22 CoreFoundation 0x0000000180416e84 __CFRunLoopRun + 788 23 CoreFoundation 0x00000001804166f4 CFRunLoopRunSpecific + 552 24 UIFoundation 0x0000000184c5c0c0 -[NSHTMLReader _loadUsingWebKit] + 1416 25 UIFoundation 0x0000000184c5cbe8 -[NSHTMLReader attributedString] + 20 26 UIFoundation 0x0000000184bdc3c8 _NSReadAttributedStringFromURLOrDataCommon + 2760 27 UIFoundation 0x0000000184bd82d4 _NSReadAttributedStringFromURLOrData + 180 28 UIFoundation 0x0000000184bd81b8 -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 144 29 Redacted.debug.dylib 0x000000010f53b6d0 $sSo25NSMutableAttributedStringC4data7options18documentAttributesAB10Foundation4DataV_SDySo012NSAttributedC24DocumentReadingOptionKeyaypGSAySo12NSDictionaryCSgGSgtKcfcTO + 204 30 Redacted.debug.dylib 0x000000010f53a984 $sSo25NSMutableAttributedStringC4data7options18documentAttributesAB10Foundation4DataV_SDySo012NSAttributedC24DocumentReadingOptionKeyaypGSAySo12NSDictionaryCSgGSgtKcfC + 76 31 Redacted.debug.dylib 0x000000010f53a860 $sSS8RedactedE20htmlAttributedStringSo09NSMutablecD0CSgyF + 572 32 Redacted.debug.dylib 0x000000010fbddf54 $s8Redacted + 132 33 Redacted.debug.dylib 0x000000010fbde71c $s8Redacted + 196 34 Redacted.dylib 0x000000010f75b1d0 $s8Redacted + 544 35 Redacted.dylib 0x000000010f2ca174 $s8Redacted + 2052 36 Redacted.debug.dylib 0x000000010e7e6884 $s8Redacted 37 Redacted.debug.dylib 0x000000010e7de9f0 $s8Redacted + 2376 38 Redacted.debug.dylib 0x000000010f336820 $s8Redacted 39 UIKitCore 0x0000000184f0c3e8 block_destroy_helper.22 + 18032 40 UIKitCore 0x0000000184f109a4 block_destroy_helper + 11080 41 UIKitCore 0x0000000184f0e810 block_destroy_helper + 2484 42 UIKitCore 0x00000001851aa8f0 -[__UIDiffableDataSource collectionView:cellForItemAtIndexPath:] + 136 libc++abi: terminating due to uncaught exception of type NSException The collection view cell being dequed contains a string that is created from HTML content with NSMutableAttributedString This line is where execution stop data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil ) This code has worked fine for years but now inexplicably is crashing. I've seen various similiar posts related to iOS 18 but none with a resolution
Topic: UI Frameworks SubTopic: UIKit Tags:
3
2
846
Jan ’25
Not possible to remove variable: 221: <unknown var (bug!) with engine as delegate:0x301a75580>{id: 12318} colIndex:60 from engine <NSISEngine: 0x151bc3100>{ delegate:0x151bc2bc0
On the iOS 18 system, we have found that some pages will definitely experience this kind of crash phenomenon when displayed. It's puzzling that I can modify different codes and this kind of crash won't occur on the 18 system. This has had a great impact on my code development, and I don't know if I can still use this API in the future. Can you help me solve this dilemma. thank
1
0
338
Dec ’24
Xcode 16: SwiftUI plain Button & UIButton not working
It looks like Xcode 16 has changed this behavior so I'm not sure if this is a bug or not. When a SwiftUI Button wraps a UIButton, the button doesn't work on iOS 18.0+ import SwiftUI struct ContentView: View { var body: some View { VStack { Button(action: { print("Not called on iOS 18") }) { WrapperButton() .frame(width: 200, height: 50) } } } } struct WrapperButton: UIViewRepresentable { func makeUIView(context: Context) -> some UIView { let button = UIButton(type: .system) button.setTitle("OK", for: .normal) return button } func updateUIView(_ uiView: UIViewType, context: Context) {} } This occurs with the app build with Xcode 16 and running on iOS 18 but it was worked with Xcode 15 builds and running on iOS 18
1
0
539
Dec ’24
UISearchController is hidden initially until I scroll down.
I have been implementing a UISearchController, I add it to the navigationItem of the view. When the view loads, it is hidden until I scroll down to show it. I want it to be shown initially. I have changed the navigationItem.hidesSearchBarWhenScrolling to false, it solved the initial problem but I also want it to be hidden when the user is scrolling through the collectionView of the view. I am currently using Swift 6 and iOS 18+. I will add the current configuration function. private func configureSearchController() { let searchController = UISearchController() searchController.searchResultsUpdater = self searchController.searchBar.delegate = self searchController.searchBar.placeholder = "Search for a username" searchController.obscuresBackgroundDuringPresentation = false navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false }
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
384
Dec ’24
iOS18.childViewController lifecycle of UITabbarController does not execute
I have encountered a tricky problem and hope to receive help. My APP process does not exist, and then I click on the notification message of the APP to open it. At this time, my APP will first configure uitabbarccontroller, and then push the first (index=0) viewcontroller (A) from the tab to the notification message list viewcontroller (B). However, I found that on iOS18, the lifecycle of A (viewDidLoad) did not execute at the end of this process. I am sure this problem will occur stably on iOS18.1.1. Versions lower than iOS18 will not. Can someone tell me why this is?
0
0
384
Dec ’24
Crash in QLPreviewController on iOS18.1 +
We found some Firebase crashes in QLPreviewController on iOS18.1 +. It shows cash info in QLPreviewController that we haven't changed for some years. Please help with this. Thanks in advance. // stack info from Firebase Fatal Exception: NSInvalidArgumentException *** -[NSURL URLByAppendingPathComponent:]: component, components, or pathExtension cannot be nil. 0 CoreFoundation __exceptionPreprocess 1 libobjc.A.dylib objc_exception_throw 2 Foundation -[NSURL(NSURLPathUtilities) URLByAppendingPathComponent:] 3 QuickLookUICore +[NSURL(_QL_Utilities) _QLTemporaryFileURLWithType:filename:] 4 QuickLookUICore +[NSURL(_QL_Utilities) _QLTemporaryFileURLWithType:uuid:] 5 QuickLook -[QLPreviewController(ScreenshotsSupport) screenshotService:generatePDFRepresentationWithCompletion:] 6 ScreenshotServices __82+[SSScreenshotMetadataHarvester _grabPDFRepresentationForIdentifier:withCallback:]_block_invoke_3 7 libdispatch.dylib _dispatch_call_block_and_release 8 libdispatch.dylib _dispatch_client_callout 9 libdispatch.dylib _dispatch_main_queue_drain 10 libdispatch.dylib _dispatch_main_queue_callback_4CF 11 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ 12 CoreFoundation __CFRunLoopRun 13 CoreFoundation CFRunLoopRunSpecific 14 GraphicsServices GSEventRunModal 15 UIKitCore -[UIApplication _run] 16 UIKitCore UIApplicationMain 17 Glip main.swift - Line 13 main + 13
1
0
750
Dec ’24
UIPasteboard
To store the data, I used the following api: (nullable UIPasteboard *)pasteboardWithName:(UIPasteboardName)pasteboardName create:(BOOL)create The official document says that starting from iOS10, clipboard data does not support persistence, but from the test practice, I use this clipboard to save the data always exists, no matter uninstall and reinstall the APP, restart the phone, or even update the system, then what scenarios may lead to the clipboard data is deleted, using this scheme to store data is reliable?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
190
Dec ’24
Help with SwiftUI and UIKit Interjection
Hi, need some help with an iOS application we are trying to make future safe. Basically, we know that our app would require SwiftUI so the app is made in that framework, however we require some important elements that are available only in UIKit, so we've made a bridge that allows us to pass UIKit views to SwiftUI to display them. So most of the app actually has UI made in UIKit, however, we now need to use the Charts framework present in SwiftUI, we've used SwiftUI buttons in our UIKit before by passing them through a HostingController (Passing SwiftUI buttons to UIKit to use). And we are currently considering to the same for SwiftUI Charts. Just to recap, it's a SwiftUI iOS app, that is mostly made in UIKit (through a bridge) but also has other SwiftUI elements injected into it. What we want to know that, is this the best way to do this? Or is there a better way to have UIKit and SwiftUI work more comfortably with eachother. The reason for such looping around is also because we interoping our C++ code to Swift for making this application, since we are making it for many other platforms and the business logic is in C++. Let me know if there are better ways to go about this!
1
0
341
Dec ’24
Modifying SwiftUI view added as a subview to UIKit View
I have a UIKit application and I have some swiftUI views(like button widget etc) that I m using in this application which are added as a subview using UIHostingController. I wanted to understand what is the right way as per the apple recommendation on how to perform some updates on these views, since the UIKit and SwiftUI have a different way of operating. In a pure swiftUI application we use the @State variables which when modified the view are re-rendered. However, in an UIKit application we can directly modify the widget property like color or font from the object. So, my question is should I get the hostingController object from the swiftUI view and then perform any update on that UIKit view. Is this the right way? If not, what is the correct way? can someone provide a detailed explanation?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1
0
376
Feb ’25
Crash on [UITextField inputAssistantItem] + 68
I have a crash on 19 [UITextField inputAssistantItem] + 68 It is running on a Simulator, is this related? Details: ========= code in app ================================ numberTextField = CursorInCenterTextField() numberTextField.listener = self numberTextField.delegate = self numberTextField.textAlignment = .left numberTextField.adjustsFontSizeToFitWidth = true numberTextField.isUserInteractionEnabled = true numberTextField.inputView = UIView() numberTextField.inputAssistantItem.leadingBarButtonGroups = [] numberTextField.inputAssistantItem.trailingBarButtonGroups = [] numberTextField.font = UIFont.systemFont(ofSize: 24.0, weight: .medium) numberTextField.autocorrectionType = .no numberTextField.returnKeyType = .search ========= crash stack from ips file ======================== Incident Identifier: 50AF117D-546E-409E-8915-6E4607C83BC0 CrashReporter Key: 4AB5D894-3E17-F998-4B64-F931D05DC65D Hardware Model: Macmini9,1 Process: Glip [47003] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/83049BCF-16F7-481C-BE83-58727242A065/data/Containers/Bundle/Application/82E219BC-96B5-4A0F-AB20-D068A88C792F/Glip.app/Glip Identifier: com.glip.mobile.rc Version: 25.1.10 (132) Code Type: X86-64 (Native(?)) Role: Foreground Parent Process: launchd_sim [38628] Coalition: com.apple.CoreSimulator.SimDevice.83049BCF-16F7-481C-BE83-58727242A065 [1342] Date/Time: 2024-12-04 22:47:10.4249 +0800 Launch Time: 2024-12-04 22:47:02.4577 +0800 OS Version: macOS 14.5 (23F79) Release Type: User Baseband Version: None Report Version: 104(?) Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000001b3531d10 Exception Codes: 0x0000000000000001, 0x00000001b3531d10 Exception Note: EXC_CORPSE_NOTIFY(?) VM Region Info: 0x1b3531d10 is not in any region. Bytes after previous region: 3427601 Bytes before following region: 176880 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL Rosetta Generic 1b31ec000-1b31ed000 [ 4K] rw-/rwx SM=PRV ---> GAP OF 0x370000 BYTES Rosetta Generic 1b355d000-1b355e000 [ 4K] rw-/rwx SM=PRV Termination Reason: SIGNAL;[11] Segmentation fault: 11 Terminating Process: exc handler [47003] Triggered by Thread: 0 Kernel Triage: None Thread 0 name: com.apple.main-thread Thread 0 Crashed: 0 None 0x11e1e0144 0x0 + 4800250180 1 CoreUI 0x14fa08817 -[CUIStructuredThemeStore renditionWithKey:usingKeySignature:] + 406 2 CoreUI 0x14fa3e8ac -[CUICatalog _storageRefForRendition:representsODRContent:] + 94 3 CoreUI 0x14fa3b244 -[CUICatalog namedVectorGlyphWithName:scaleFactor:deviceIdiom:layoutDirection:glyphContinuousSize:glyphContinuousWeight:glyphPointSize:appearanceName:locale:] + 1909 4 CoreUI 0x14fa3b3a5 -[CUICatalog namedVectorGlyphWithName:scaleFactor:deviceIdiom:layoutDirection:glyphSize:glyphWeight:glyphPointSize:appearanceName:locale:] + 74 5 UIKitCore 0x167c4f99c __78-[_UIAssetManager imageNamed:configuration:cachingOptions:attachCatalogImage:]_block_invoke_2 + 201 6 UIKitCore 0x167c51fce __88-[_UIAssetManager _performLookUpObjectForTraitCollection:outNamedLookup:objectAccessor:]_block_invoke + 79 7 UIKitCore 0x16713340e -[UITraitCollection _enumerateThemeAppearanceNamesForLookup:] + 215 8 UIKitCore 0x167c51f3d -[_UIAssetManager _performLookUpObjectForTraitCollection:outNamedLookup:objectAccessor:] + 172 9 UIKitCore 0x167c520c0 -[_UIAssetManager _lookUpObjectForTraitCollection:objectAccessor:] + 40 10 UIKitCore 0x167c4f709 __78-[_UIAssetManager imageNamed:configuration:cachingOptions:attachCatalogImage:]_block_invoke + 849 11 UIKitCore 0x167c4f137 -[_UIAssetManager imageNamed:configuration:cachingOptions:attachCatalogImage:] + 291 12 UIKitCore 0x167c5001d -[_UIAssetManager imageNamed:configuration:] + 224 13 UIKitCore 0x1670c1b87 +[UIImage _systemImageNamed:withConfiguration:allowPrivate:] + 297 14 UIKitCore 0x167ae8cc0 +[UIAssistantBarButtonItemProvider configuredSymbolImageWithName:size:keyboardLanguageCode:] + 585 15 UIKitCore 0x167ae747e +[UIAssistantBarButtonItemProvider barButtonItemForAssistantItemStyle:target:forcePlainButton:] + 2850 16 UIKitCore 0x167ae90f1 +[UIAssistantBarButtonItemProvider defaultSystemLeadingBarButtonGroupsForItem:] + 206 17 UIKitCore 0x167ae9935 +[UIAssistantBarButtonItemProvider systemDefaultAssistantItem] + 55 18 UIKitCore 0x167719194 -[UIResponder(UIResponderInputViewAdditions) inputAssistantItem] + 67 19 UIKitCore 0x167b67898 -[UITextField inputAssistantItem] + 68 20 Glip 0x105915dbc BaseDialPadViewController.setupTopContainerViewConstraintAndSubViews() + 780 21 Glip 0x105917869 BaseDialPadViewController.setupContentViewForM1X() + 2681 22 Glip 0x105915781 BaseDialPadViewController.setupUI() + 193 ........
Topic: UI Frameworks SubTopic: UIKit Tags:
1
1
319
Dec ’24
Button in navigation bar using UIHostingController appears after push animation
I'm trying to push a SwiftUI view from UIKit using UIHostingController. In the new view there is a button in the right side of the navigation bar, but it pops after the push animation. I can't make it appear with an animation like in a normal UIViewController. I tried adding the button in the navigationItem of the hosting controller and in the toolbar of the SwiftUI but none gives a smooth animation. I've made a small test and this are the results. This is the code: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() title = "Home" } @IBAction func buttonNavPressed(_ sender: Any) { let vc = UIHostingController(rootView: ContentView()) vc.navigationItem.title = "NavItem Button" vc.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(sayHello)) navigationController?.pushViewController(vc, animated: true) } @IBAction func buttonSwiftUIPressed(_ sender: Any) { let vc = UIHostingController(rootView: ContentViewWithButton()) navigationController?.pushViewController(vc, animated: true) } @objc func sayHello() { print("Hello") } } struct ContentView: View { var body: some View { Text("No button") } } struct ContentViewWithButton: View { var body: some View { Text("With button") .navigationTitle("SwuitUI W Button") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button(action: { print("Hello") }, label: { Image(systemName: "camera") } ) } } } } There is any workaround to this problem?
0
0
300
Dec ’24
TextKit 2 : replaceContents(in:with:) is not working
I have NsTextList and it has [NsTextListElement], I want to replace an NsTextListElement with other element like NsTextParagraph or NstextListElement or an AttributedString. For some reason the below method is not working at all. And I couldn't find any alternate way of replacing the elements textLayoutManager.replaceContents(in: element.elementRange, with: NSAttributedString(string: "happy"))
2
0
829
Dec ’24
In 18.2 beta, WKWebView consumes `buildMenu`
I have a view controller that is hosing a WKWebView. My view controller overrides buildMenu(with builder: UIMenuBuilder), and prior to the beta, this was called reliably. However under 18.2 beta 4, it is not called at all, despite no code changes on my part. Things I've tried: Ensured that my responder chain is set up correctly. Walked through the debugger via a symbolic breakpoint on [UIResponder buildMenuWithBuilder:] to understand that the web view is the last object to get a buildMenuWithBuilder message. Any feedback or commiseration would be appreciated.
3
0
624
Dec ’24
Need help with objc_fatalv crash
My app's top crash is a mysterious one and I can't seem to figure it out. It always crashes on _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) But the stack traces include a few different possible culprits like NavigationBridge_PhoneTV.pushTarget(isDetail:) UIKitNavigationBridge.update(environment:) ViewRendererHost.updateGraph() UIScrollView(SwiftUI) _swiftui_adjustsContentInsetWhenScrollDisabled Crash reports here: 2024-12-02_21-37-21.7864_-0600-1e78918e5586309b96a1c2986ff722778dec8a77.crash 2024-12-02_19-18-29.1251_-0500-a2fc5513683cd647b4adbbe03cc59e4a09237b5f.crash 2024-12-01_11-59-09.8888_-0500-9eb224ab3d37e76d0b966ea83473f584ac3bbe18.crash 2024-11-28_17-17-38.4808_+0100-46208989f016fbefd16c30873a88c2ef61dd91a1.crash Hopefully someone here can shed some light. For context we use a lot of UIHostingController's to bridge our SwiftUI views.
1
0
750
Dec ’24
Xamarin application crashing in iOS 18.1
My xamarin application running fine in iOS 17 and below versions. but in iOS 18 and above when I open application and then when I use it for few min it gets crashed automatically and does not even show any crash report in mobile. When I checked the console logs in XCode then I found out that One error is logging more than 700 times in a sec. that is why the application is crashing. I will attach the error below. Modifying properties of a view's layer off the main thread is not allowed: view <Xamarin_Forms_Platform_iOS_FrameRenderer: 0x7f9605e5e7a0> with nearest ancestor view controller <Xamarin_Forms_Platform_iOS_GroupableItemsViewController_1: 0x7f9605f96dc0>; backtrace: ( 0 UIKitCore 0x0000000152d29c00 -[UIView(UIKitManual) _raiseExceptionForBackgroundThreadLayerPropertyModification] + 453 1 UIKitCore 0x0000000152d2a188 -[UIView(UIKitManual) actionForLayer:forKey:] + 609 2 QuartzCore 0x0000000126f731da -[CALayer actionForKey:] + 151 3 QuartzCore 0x0000000126f7a425 ZN2CA5Layer12begin_changeEPNS_11TransactionEjP11objc_objectRS4 + 199 4 QuartzCore 0x0000000126f7ead8 _ZN2CA5Layer6setterEj12_CAValueTypePKv + 974 5 QuartzCore 0x0000000126f727e9 -[CALayer setOpacity:] + 49 6 Leadrat.Mobile.Forms.iOS 0x0000000101122fc9 xamarin_dyn_objc_msgSend + 217 7 ??? 0x00000001a315f176 0x0 + 7031091574 8 ??? 0x00000001b312d0bb 0x0 + 7299322043 9 ??? 0x000000019d76712b 0x0 + 6936752427 10 Mono 0x000000010b9b70b5 mono_jit_runtime_invoke + 1621 11 Mono 0x000000010bbac1e8 mono_runtime_invoke_checked + 136 12 Mono 0x000000010bbb1c9d mono_runtime_delegate_try_invoke + 157 13 Mono 0x000000010bbd0957 start_wrapper_internal + 647 14 Mono 0x000000010bbd06ae start_wrapper + 62 15 libsystem_pthread.dylib 0x000000012a21018b _pthread_start + 99 16 libsystem_pthread.dylib 0x000000012a20bae3 thread_start + 15
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
464
Dec ’24
prefersPointerLocked not worked properly if run on MacOS environment
Hi community. I am trying to adopt my first person shooter iOS game for running on MacOS environment. I need to lock the pointer when I enter battle mode, and unlock in lobby. On iOS all works fine (with mouse and keyboard) - pointer locks and unlocks according to my commands. However, on MacOS I faced the following behavior: after switching the pointer lock state and setNeedsUpdateOfPrefersPointerLocked invocation, the pointer does not locked immediately. To enable pointer lock, the user must click in the window. I checked the criteria listed in documentation: I do have fullscreen mode, I monitor UISceneActivationState and can confirm it is UISceneActivationStateForegroundActive, I do not use MacCatalyst (it is disabled in app's capabilities). However pointer locks only after click on window, which is weird. Can someone confirm that this is the exact behaviour as designed by Apple developers, or am I doing anything wrong. I have read the note: "Bringing an app built with Mac Catalyst to the foreground doesn’t immediately enable pointer lock. To enable pointer lock, the user must click in the window. To exit pointer lock, users can use Command-tab to switch to another app, or using Command-tilde.", but again, I don't use MacCatalyst. Any hints are highly appreciated! Best regards. refs: https://developer.apple.com/documentation/apple-silicon/running-your-ios-apps-in-macos https://developer.apple.com/documentation/uikit/uiviewcontroller/3601235-preferspointerlocked?language=objc
1
0
468
Dec ’24