SwiftEntryKit
SwiftEntryKit copied to clipboard
SwiftEntryKit crashs sometimes
Describe the bug
In app where we use SwiftEntryKit fabric shows that SwiftEntryKit crashed sometimes(not often) over several versions. We can't reproduce this crash, but maybe you will somehow. Here is a screenshots from fabric

iPhone (please complete the following information):

- Xcode Version: 11.x
- SwiftEntryKit Release # 1.2.0
Hi, could you provide more info?
Device type statistics are typically provided on the Firebase console.
Does the crash happen on background/foreground mode (also provided on Firebase)
Also, could you please update to 1.2.3? possibly related to #253.
Could you also send the raw text? (button on the top-right)
- Any other info you can think about of and able to provide
Screenshot of iOS versions i posted in first message.
Device States here:
Raw text:
Crashed: com.apple.main-thread
0 SwiftEntryKit 0x1051c0570 $s13SwiftEntryKit16EKWindowProviderC20setupWindowAndRootVC33_508357B7538CEB0C8D4141987D5008BELLAA20EKRootViewControllerCyF + 104
1 SwiftEntryKit 0x1051c03e4 $s13SwiftEntryKit16EKWindowProviderC7prepare33_508357B7538CEB0C8D4141987D5008BELL3for22presentInsideKeyWindowAA20EKRootViewControllerCSgAA12EKAttributesV_SbtF + 40
2 SwiftEntryKit 0x1051c176c $s13SwiftEntryKit16EKWindowProviderC7display33_508357B7538CEB0C8D4141987D5008BELL9entryView5using22presentInsideKeyWindow08rollbackS0yAA07EKEntryN0C_AA12EKAttributesVSbA2AC08RollbackS0OtFTf4ndnnn_n + 1116
3 SwiftEntryKit 0x1051c6dfc $s13SwiftEntryKitAAC7display5entry5using22presentInsideKeyWindow08rollbackJ0ySo16UIViewControllerC_AA12EKAttributesVSbAB08RollbackJ0OtFZyycfU_ + 3168
4 SwiftEntryKit 0x10518847c $sIeg_IeyB_TR + 28
5 libdispatch.dylib 0x197340a38 _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x1973417d4 _dispatch_client_callout + 16
7 libdispatch.dylib 0x1972ef004 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068
8 CoreFoundation 0x197892c1c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9 CoreFoundation 0x19788db54 __CFRunLoopRun + 1924
10 CoreFoundation 0x19788d0b0 CFRunLoopRunSpecific + 436
11 GraphicsServices 0x199a8d79c GSEventRunModal + 104
12 UIKitCore 0x1c40c3978 UIApplicationMain + 212
13 App Name 0x102ba75a4 main + 27 (AppDelegate.swift:27)
14 libdyld.dylib 0x1973528e0 start + 4
I'm presenting Entry with ViewController. ViewController contains UIScrollView. And there is one strange behavior: on my iPhone X (iOS 13.2, and previously on 12.x) it freezing when scroll without dropping fps. When present this ViewController without SwiftEntryKit (just normally present) - all is fine.
I'll try to repro, but in the meantime, would be good to use 1.2.3 instead.
ViewController contains UIScrollView. And there is one strange behavior: on my iPhone X (iOS 13.2, and previously on 12.x) it freezing when scroll without dropping fps. When present this ViewController without SwiftEntryKit (just normally present) - all is fine.
@Banck could you upload a small project that demonstrates that? I may be able to look into it today.
@huri000 I can't reproduce this behavior outside this project. But, i've noticed, that these 2 lines (apart and together) affect performance in this entry (with other entries all is fine with the same attributes):
attributes.screenBackground = visualEffect(style: .dark)
attributes.entryBackground = .color(color: .init(UIColor.white))
Issue with performance reproduced only on iPhone X (13.2). Don't know why
Crashes can't reproduce.
P.S. Updated to 1.2.3
@huri000 I can't reproduce this behavior outside this project. But, i've noticed, that these 2 lines (apart and together) affect performance in this entry (with other entries all is fine with the same attributes):
attributes.screenBackground = visualEffect(style: .dark) attributes.entryBackground = .color(color: .init(UIColor.white))Issue with performance reproduced only on iPhone X (13.2). Don't know why
Crashes can't reproduce.
P.S. Updated to 1.2.3
Strange...but now it doesn't help. Nevermind
@Banck No other developers have been reported this crash. Does it still occur?
Hi, @huri000. I have this crash as well. But i couldn't reproduce it. I am using 2.0.0 version.

This is how I call SwiftEntryKit
func showTransactionListPage() {
let transactionListPage = pagesFactory.makeTransactionListPage()
transactionListPage.didSelectTransaction = { [weak self] type in
SwiftEntryKit.dismiss()
self?.routeToCreateTransactionPage(by: type)
}
SwiftEntryKit.display(entry: transactionListPage, using: .controllerAttribute)
}
static var controllerAttribute: EKAttributes {
var attributes = EKAttributes.bottomFloat
attributes.displayDuration = .infinity
attributes.screenBackground = .color(color: .black.with(alpha: 0.5))
attributes.entryBackground = .clear
attributes.screenInteraction = .dismiss
attributes.entryInteraction = .forward
attributes.scroll = .enabled(swipeable: true, pullbackAnimation: .jolt)
attributes.hapticFeedbackType = .success
attributes.entranceAnimation = .init(translate: .init(duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)),
scale: .init(from: 1.05, to: 1, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)))
attributes.exitAnimation = .init(translate: .init(duration: 0.2))
attributes.positionConstraints.size = .init(width: .offset(value: 0), height: .offset(value: 0))
attributes.positionConstraints.safeArea = .overridden
attributes.positionConstraints.verticalOffset = 0
return attributes
}