mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

Crash in Swift 3 #131

Open Chelsea-Pritchard opened 7 years ago

Chelsea-Pritchard commented 7 years ago

I updated to Swift 3 and now I'm getting a crash every time I call "showOverlayAddedto" MRProgressOverlayView.showOverlayAdded(to: self.view, title: "Connecting...", mode: .indeterminate, animated: true)

See error below:

016-10-28 13:48:10.541[6475:86244] * Assertion failure in void PushNextClassForSettingIMP(id, SEL)(), /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UIAppearance.m:760 2016-10-28 16:14:10.920 FileThis[6475:86244] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please file a radar on UIKit if you see this assertion.' * First throw call stack: ( 0 CoreFoundation 0x000000010ca10d85 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010c06cdeb objc_exception_throw + 48 2 CoreFoundation 0x000000010ca10bea +[NSException raise:format:arguments:] + 106 3 Foundation 0x000000010bcb6e1e -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 169 4 UIKit 0x0000000108bb8209 PushNextClassForSettingIMP + 469 5 UIKit 0x0000000108bc1587 __workaround10030904InvokeWithTarget_block_invoke + 26 6 UIKit 0x0000000108512920 +[UIView _performSystemAppearanceModifications:] + 66 7 UIKit 0x0000000108bc155b workaround10030904InvokeWithTarget + 1102 8 UIKit 0x0000000108bbb6fb applyInvocationsToTarget + 1864 9 UIKit 0x0000000108bba812 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:onlySystemInvocations:] + 1888 10 UIKit 0x00000001085361df 88-[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]_block_invoke + 64 11 UIKit 0x0000000108536169 -[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 189 12 UIKit 0x000000010853607f -[UIView(Internal) _didChangeFromIdiomOnScreen:traverseHierarchy:] + 182 13 UIKit 0x000000010853560e -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1739 14 UIKit 0x00000001085352a3 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 864 15 UIKit 0x00000001085352a3 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 864 16 UIKit 0x000000010852a562 45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 155 17 Foundation 0x000000010bc403d3 -[NSISEngine withBehaviors:performModifications:] + 155 18 UIKit 0x000000010852a480 -[UIView(Hierarchy) _postMovedFromSuperview:] + 575 19 UIKit 0x000000010853826c -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1967 20 FileThis 0x00000001078a02b2 +[MRProgressOverlayView showOverlayAddedTo:title:mode:animated:] + 194 21 FileThis 0x0000000107aac098 _TFC8FileThis30IntroDestinationViewController4nextfPs9AnyObjectT + 584 22 FileThis 0x0000000107aac736 _TToFC8FileThis30IntroDestinationViewController4nextfPs9AnyObjectT + 54 23 UIKit 0x0000000108482a8d -[UIApplication sendAction:to:from:forEvent:] + 92 24 UIKit 0x00000001085f5e67 -[UIControl sendAction:to:forEvent:] + 67 25 UIKit 0x00000001085f6143 -[UIControl _sendActionsForEvents:withEvent:] + 327 26 UIKit 0x00000001085f5263 -[UIControl touchesEnded:withEvent:] + 601 27 UIKit 0x00000001084f599f -[UIWindow _sendTouchesForEvent:] + 835 28 UIKit 0x00000001084f66d4 -[UIWindow sendEvent:] + 865 29 UIKit 0x00000001084a1dc6 -[UIApplication sendEvent:] + 263 30 UIKit 0x000000010847b553 _UIApplicationHandleEventQueue + 6660 31 CoreFoundation 0x000000010c936301 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION** + 17 32 CoreFoundation 0x000000010c92c22c CFRunLoopDoSources0 + 556 33 CoreFoundation 0x000000010c92b6e3 __CFRunLoopRun + 867 34 CoreFoundation 0x000000010c92b0f8 CFRunLoopRunSpecific + 488 35 GraphicsServices 0x000000010fa65ad2 GSEventRunModal + 161 36 UIKit 0x0000000108480f09 UIApplicationMain + 171 37 FileThis 0x0000000107ab6a8f main + 111 38 libdyld.dylib 0x000000010e17b92d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

This is the line causing the crash in the MRProgressOverlayView.m class: screen shot 2016-10-28 at 4 13 56 pm

lukaskollmer commented 7 years ago

I'm getting the same crash from Objective-C. Did you find a way to fix this @Chelsea-Pritchard ?

Chelsea-Pritchard commented 7 years ago

@lukaskollmer My fix was to remove MRProgress and replace it with SwiftSpinner :)