UI Frameworks

Discuss the different user interface frameworks available for your app.

Posts under UI Frameworks tag

359 results found
Post marked as unsolved
911 Views

Cell should never be in update animation (UICollectionView crash)

I've got Cell should never be in update animation crash in UICollectionView reported by crashlytics This crash happens only for users on iOS 14. It wasn't noticeable when application used SDK iOS 13 (it affected less then 0.01 % of all users). But after supporting SDK iOS 14 crash frequency noticeably increased to almost 0.25 % of all users Internally UICollectionView, as far as I understand (from some UIKit disassembly journey), loops through visible cells and checks that cell animation counter is equal zero (else it crashes with the following stack trace). It's not for sure but presumably crash happens while performBatchUpdates(_:completion:) I wasn't able to reproduce this bug and I can't spend more time on digging into UIKitCore disassembled code trying to understand when and why this animation counter changes Fatal Exception: NSInternalInconsistencyException 0	CoreFoundation								 0x1915e9114 __exceptionPreprocess 1	libobjc.A.dylib								0x1a4e0fcb4 objc_exception_throw 2	CoreFoundation								 0x1914f8308 -[CFPrefsSearchListSource addManagedSourceForIdentifier:user:] 3	Foundation										 0x1927dc2c8 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4	UIKitCore											0x1935b8548 __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke_4.1070 5	UIKitCore											0x1935b8000 __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.1053 6	libdispatch.dylib							0x191221298 _dispatch_call_block_and_release 7	libdispatch.dylib							0x191222280 _dispatch_client_callout 8	libdispatch.dylib							0x1911d123c _dispatch_main_queue_callback_4CF$VARIANT$mp 9	CoreFoundation								 0x191568c30 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 10 CoreFoundation								 0x1915630e8 __CFRunLoopRun 11 CoreFoundation								 0x191562200 CFRunLoopRunSpecific 12 GraphicsServices							 0x1a765d598 GSEventRunModal 13 UIKitCore											0x193e28004 -[UIApplication _run] 14 UIKitCore											0x193e2d5d8 UIApplicationMain 15 Joom													 0x100dd2d1c main + 49 (main.m:49) 16 libdyld.dylib									0x191241598 start Did anyone faced with the same issue? Were you able to reproduce it?
Asked
Last updated .
Post marked as solved
89 Views

Proper way to resize a (custom) view whose frame is already set

Maybe this question is unnecessary, but I encountered the following problem (typical for SwiftUI). I have a custom view that is used all around my app. It has a .frame() modifier on it, because it show pictures (and more). It's called ParticipantsView. In some other view I want to use ParticipantsView but make it smaller. I can't use the .frame modifier again (because it will not change participantsView appearance). I can use .clipped(), but thats not what I want. Here comes my question ParticipantsView is used in 4 different sizes around the app, should I implement it more dynamic and just pass the needed frame-size as argument every-time I use this view or is there a simple solution, to just resize any given view, no mater if it has an inherent frame-size already set?
Asked
by schnphil.
Last updated .
Post marked as unsolved
320 Views

SwiftUI - Split View on iPad problem

Is there an simple way to use the UISplitViewController with SwiftUI? Currently I use a NavigationView. The problem is, that the ListView on the left only shows in landscape mode and not in portrait mode. This is the example of my code: import SwiftUI struct ContentView: View { &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;NavigationView { &#9;&#9;&#9;&#9;&#9;&#9;ListView() &#9;&#9;&#9;&#9;&#9;&#9;DetailView() &#9;&#9;&#9;}.navigationViewStyle(DoubleColumnNavigationViewStyle()) &#9;&#9;} } struct ContentView_Previews: PreviewProvider { &#9;&#9;static var previews: some View { &#9;&#9;&#9;&#9;ContentView() &#9;&#9;} } struct ListView: View { &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;List(0 ..< 5) { item in &#9;&#9;&#9;&#9;&#9;&#9;NavigationLink(destination: DetailView()) { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text("List Item") &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;.navigationTitle("My List") &#9;&#9;} } struct DetailView: View { &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;Text("Hallo") &#9;&#9;} } I tested it with a padding after navigationViewStyle but the List View only displays in landscape mode.
Asked
by Hanashi.
Last updated .
Post marked as unsolved
202 Views

How to store RawRepresentable, Codable conformant custom type to @SceneStorage?

Trying to save a custom type using @SceneStorage. Here is what I did...please see sample code below made the custom type RawRepresentable conformant marked it Codable Everything seems to work fine...but when the App goes to background...as expected ... block is executed... var rawValue: RawValue { .... crashes .... } and **JSONEncoder.encode(self). seems to go recursive and crash into a EXCMEMACCESS, code: 2... Any pointers are deeply appreciated ! struct AppUIState: RawRepresentable, Codable {    typealias RawValue = String    var enteredText: String?  static let empty = """                         {                            "enteredText": ""                          }                      """    init() { }    init?(rawValue: RawValue) {         guard let data = rawValue.data(using: .utf8), let result = try? JSONDecoder().decode(AppUIState.self, from: data) else { return nil }        self = result    }   var rawValue: RawValue {       debugPrint("var rawValue: self: \(self)")         /* ===== 👇 exc mem access crash after .encode(self) executed... seems to go recursive  ======*/         guard let data = try? JSONEncoder().encode(self), let stringResult = String(data: data, encoding: .utf8) else { return Self.empty }        return stringResult     } } /* View */ ContentView:&#9;View {     @SceneStorage("SceneStorage.Keys.appUserState")     var appUIState = AppUIState() ... ... ... ... } code-block
Asked
Last updated .
Post marked as unsolved
101 Views

Password Autofill Credential Provider Extension with empty window

OS: macOS Big Sur Version 11.2.3 (20D91) Xcode: Version 12.4 (12D4e) Create Autofill Credential Provider Extension (i.e. ‘AppAutofill’ ) Switch-On the ‘AppAutofill’ extension in ’ System Preferences - Extensions - Password AutoFill - AppAutofill ’ Open any app with security text field Set focus to security text field In papered autofill extensions: AppAutofill... Keychain… Choose created ‘AppAutofill’ Expected result: Appears ‘AppAutofill’ window with UI controls Actual result: some times Appears ‘AppAutofill’ empty window Is it a system or Xcode bug? I'd submit this ticket in Feedback Assistant, FB9047008
Asked
by John.O.
Last updated .
Post marked as unsolved
109 Views

libdispatch.dylib`_dispatch_assert_queue_fail in iOS 14

App is running video and before that its displaying the Ad using the Freewheel SDK. Its asking about the location permission before playing the ad. once user gave permission,ad started playing and after the few second it getting crashed. It not reproducible 100%.I am not able to find out why UI update happened in other than main thread. How to debug that. Below are the StackTrace. thread #34, name = 'WebThread'frame #0: 0x00000001083ce074 libdispatch.dylib_dispatch_assert_queue_fail + 99  frame #1: 0x00000001083ce00c libdispatch.dylibdispatch_assert_queue + 152   frame #2: 0x00007fff24ba402e UIKitCore-[UIImageView _mainQ_beginLoadingIfApplicable] + 65   frame #3: 0x00007fff24b9ce98 UIKitCore-[UIImageView setHidden:] + 66   frame #4: 0x00007fff23fb60d4 UIKitCore-[UIButton _updateImageView] + 539   frame #5: 0x00007fff23fb6b39 UIKitCore-[UIButton layoutSubviews] + 379   frame #6: 0x00007fff24bf25b8 UIKitCore-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2924   frame #7: 0x00007fff27aa2c33 QuartzCore-[CALayer layoutSublayers] + 258   frame #8: 0x00007fff27aa91a5 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 575   frame #9: 0x00007fff27ab4f47 QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) + 65   frame #10: 0x00007fff279f4408 QuartzCoreCA::Context::commit_transaction(CA::Transaction*, double, double*) + 496   frame #11: 0x00007fff27a2b1ef QuartzCoreCA::Transaction::commit() + 783   frame #12: 0x00007fff27a2c3ab QuartzCoreCA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 79   frame #13: 0x00007fff2038e1f8 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23   frame #14: 0x00007fff20388a77 CoreFoundation__CFRunLoopDoObservers + 547   frame #15: 0x00007fff20388752 CoreFoundationCFRunLoopRunSpecific + 691   frame #16: 0x00007fff29b88635 WebCoreRunWebThread(void*) + 581   frame #17: 0x00007fff60c8e109 libsystem_pthread.dylib_pthread_start + 148   frame #18: 0x00007fff60c89b8b libsystem_pthread.dylib`thread_start + 15
Asked
Last updated .
Post marked as unsolved
89 Views

Theme for View Controllers

Good day, I was thinking to beautify my app by adding some colors to the background, is there a way to set a theme quickly without editing every individual view controllers? Thank you!
Asked
Last updated .
Post marked as unsolved
244 Views

iOS14.2 UICollectionView Problem

I have a question about the UICollectionView Delegate below. (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath; In my APP, we used UICollectionView and we have implemented the above delegate method. until iOS13, it works well, the delegate method only be called when user select one cell, but from iOS 14.2, we found that sometime this delegate method will be called even user not selected any cell. Is there any change for this delegate method since iOS 14.2?
Asked
by shuailu.
Last updated .
Post marked as unsolved
70 Views

How do you ensure one of your app's hotkeys isn't reserved?

I was just stymied by a bug report of a hotkey not working in my app that I couldn't reproduce. It turned out that Mission Control hijacks Ctrl-arrow hotkeys, but I have all that turned off on my system. How do you check a hotkey you're planning to use in your app against ones in use by the OS? A Web search on this issue turns up plenty of questions but no answers that I've seen. Another annoyance is that the menu bar showed that the hotkey was going to work.
Asked
Last updated .
Post marked as unsolved
171 Views

UICollectionView - Changing UI of one specific cell causes changes for every fifth cell

Hey guys. I am having an issue with one of my projects. UICollectionViewCell in my UICollectionView has a plus button with the systemImage "plus". When clicked, its changing to systemImage "checkmark". The issue is, clicking one button, changes UI for every fifth cell. On top of that, animation does not finish. Alpha goes to 0, and then the image is being changed, alpha should go to 1 but never gets there. It stops somewhere between 0.7-0.8. Here is my animation block: private func animateButtonView(_ viewToAnimate: UIView) {         UIView.animate(withDuration: 0.2, animations: {viewToAnimate.alpha = 0}) { [weak self] (true) in             guard let self = self else { return }             switch true {             case true:                 DispatchQueue.main.async { self.addToFavoritesButton.setImage(SFSymbolsAsImg.checkmark, for: .normal) }                 UIView.animate(withDuration: 0.2, animations: {viewToAnimate.alpha = 1} )             case false:                 return             }         }     } Animation block is executed in my objective function that is called in addTarget for a button. I've asked that question on many forums and got not much. I'll appreciate any help. Many thanks!
Asked
by jmgawe.
Last updated .
Post marked as unsolved
173 Views

HomeKit - App crash on call addAndSetupAccessories

Hi. I have created a test application for HomeKit on iPad Mini (5th generation) with iOS 14.4 on Xcode 12.4. The app is only for iPad, the supported orientation is landscape only and it's very basically : one view controller with one button when tapped execute the following code. HomeStore.shared.homeManager.primaryHome?.addAndSetupAccessories(completionHandler: { (error) in             if error != nil             {                 // DO SOMETHING             }             else             {                 // DO SOMETHING ELSE             }         }) When the button is tapped the app crash with the following reason : ** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [HMSetupViewController shouldAutorotate] is returning YES' I wan't to support the portrait orientation also, because I want the locked in landscape. Is there a way to avoid the crash or is there a bug in HomeKit framework ?
Asked
by Lagmac.
Last updated .
Post marked as unsolved
120 Views

Add controls to large title in navigation bar

Good day together, I am already in despair, I would like to insert a button in the NavigationBar next to the NavigationBarTitle which also automatically shrinks or enlarges. The whole thing can be seen in the App Store under the menu item "search". There, when the user scrolls down, the search bar and the title is given as .inline but not the user button. I am currently trying to implement the whole thing in SwiftUI and can't find a solution. Is there already a solution for this or if someone has the exact documentation for this case I would be very grateful for it :). thank you very much!
Asked
by Cliplicht.
Last updated .
Post marked as unsolved
97 Views

how i can identifier the name of cells

Hi, How I can identifier the name the Cells. I Have 3 cell, (Hotels, flights, Cars) func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell {     let cell: UITableViewCell     if hotels.count 0 {       cell = getHotelsCell(tableView, indexPath: indexPath)       if cars.count 0 {         cell = getCarsCell(tableView, indexPath: indexPath)       }       if flights.count 0 {         cell = getFlightsCell(tableView, indexPath: indexPath)       }       return cell     }   } I have 3 objects hotels, cars, flights. In my case the indexPath is wrong, because i Have: 1 hotels 2 flights 1 Cars In my didSelectRowAt indexPath.row is not correct. for access object. I put in each cell on Text for number of index(This work) but i cant access cell.lbIndexPath.text. I try   func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {      if let cell = self.tableView(tableView, cellForRowAt: indexPath) as? UITableViewCell { /* this line cell is not identifier cell.lbIndexPath.text */ /* this if is wrong i know, this logic for index path */ if tableViewCell.name = Hotels { var index = cell.lbIndexPath.text open view details - Hotels[index] } if tableViewCell.name = flights { var index = cell.lbIndexPath.text open view details - flights[index] } if tableViewCell.name = Cars { var index = cell.lbIndexPath.text open view details - flights[index] } } tnks, a million.
Asked
Last updated .
Post marked as unsolved
136 Views

Width of primary column

How does one change the width of the primary column? I’ve tried preferredPrimaryColumnWidthFraction when the svc is intantiated but it has no effect. I’m using .doubleColumn style for the svc and my primary view controller is using .sidebar appearance style.
Asked
by Phantom59.
Last updated .