Skip to content

DatePicker crash when reloadData #3

@floflo41

Description

@floflo41

Hello datePicker crash when reloadData of collectionView is called.
t will appear that this comes from constraints
thank you
`
collectionView?.topAnchor.constraint(equalTo: headerSeparator.bottomAnchor).isActive = true
collectionView?.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
collectionView?.bottomAnchor.constraint(equalTo: footerSeparator.topAnchor).isActive = true

    let gap = view.frame.size.width - (itemWidth * 7)
    collectionViewWidthConstraint = collectionView?.widthAnchor.constraint(equalTo: view.widthAnchor, constant: -gap)
    collectionViewWidthConstraint?.isActive = true`

This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes. Stack:( 0 CoreFoundation 0x000000010633db0b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x0000000105da2141 objc_exception_throw + 48 2 CoreFoundation 0x00000001063a6625 +[NSException raise:format:] + 197 3 Foundation 0x0000000105a9b17b _AssertAutolayoutOnAllowedThreadsOnly + 105 4 Foundation 0x0000000105a9af0f -[NSISEngine _optimizeWithoutRebuilding] + 61 5 Foundation 0x00000001058ca966 -[NSISEngine optimize] + 108 6 Foundation 0x0000000105a98ef4 -[NSISEngine performPendingChangeNotifications] + 84 7 UIKit 0x0000000107158feb -[UIView(Hierarchy) layoutBelowIfNeeded] + 267 8 UIKit 0x000000010716008e +[UIView(Animation) performWithoutAnimation:] + 90 9 UIKit 0x00000001079d0880 -[UICollectionViewAnimation startWithAnimator:] + 152 10 UIKit 0x00000001079fc06e __71-[UICollectionView _updateWithItems:tentativelyForReordering:animator:]_block_invoke.2030 + 976 11 UIKit 0x00000001071613da +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 572 12 UIKit 0x00000001071618dd +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 99 13 UIKit 0x00000001079fb244 -[UICollectionView _updateWithItems:tentativelyForReordering:animator:] + 6439 14 UIKit 0x00000001079f4b33 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 17030 15 UIKit 0x00000001079f06ce -[UICollectionView _updateRowsAtIndexPaths:updateAction:] + 372 16 Swift-Airbnb 0x000000010573bff8 _TFC12Swift_Airbnb11CalendarCVC9onSuccessfT4dictP_3keySS_T_ + 3016 17 Swift-Airbnb 0x00000001057428a2 _TTWC12Swift_Airbnb11CalendarCVCS_15RequestProtocolS_FS1_9onSuccessfT4dictP_3keySS_T_ + 98 18 Swift-Airbnb 0x0000000105729524 _TFFC12Swift_Airbnb7Request14getJsonFromUrlFT4url_SS5data_GVs10DictionarySSP__9callback_PS_15RequestProtocol_4key_SS_T_U_FTGSqV10Foundation4Data_GSqCSo11URLResponse_GSqPs5Error___T_ + 884 19 Swift-Airbnb 0x00000001057298dc _TPA__TFFC12Swift_Airbnb7Request14getJsonFromUrlFT4url_SS5data_GVs10DictionarySSP__9callback_PS_15RequestProtocol_4key_SS_T_U_FTGSqV10Foundation4Data_GSqCSo11URLResponse_GSqPs5Error___T_ + 124 20 Swift-Airbnb 0x00000001057299bb _TTRXFo_oGSqV10Foundation4Data_oGSqCSo11URLResponse_oGSqPs5Error____XFdCb_dGSqCSo6NSData_dGSqS1__dGSqCSo7NSError___ + 203 21 CFNetwork 0x000000010986087b __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19 22 CFNetwork 0x0000000109860095 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 143 23 Foundation 0x00000001058ac3b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7 24 Foundation 0x00000001058ac0bb -[NSBlockOperation main] + 101 25 Foundation 0x00000001058aa877 -[__NSOperationInternal _start:] + 627 26 Foundation 0x00000001058a65fc __NSOQSchedule_f + 198 27 libdispatch.dylib 0x000000010a39705c _dispatch_client_callout + 8 28 libdispatch.dylib 0x000000010a37594f _dispatch_queue_serial_drain + 221 29 libdispatch.dylib 0x000000010a376669 _dispatch_queue_invoke + 1084 30 libdispatch.dylib 0x000000010a378ec4 _dispatch_root_queue_drain + 634 31 libdispatch.dylib 0x000000010a378bef _dispatch_worker_thread3 + 123 32 libsystem_pthread.dylib 0x000000010a72e616 _pthread_wqthread + 1299 33 libsystem_pthread.dylib 0x000000010a72e0f1 start_wqthread + 13 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions