Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone X issue with presenting Alert right after previous was closed #62

Closed
Banck opened this issue Jun 25, 2018 · 12 comments
Closed

iPhone X issue with presenting Alert right after previous was closed #62

Banck opened this issue Jun 25, 2018 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@Banck
Copy link

Banck commented Jun 25, 2018

Describe the bug
Hello!
There is issue when we are trying to show Alert when the previous one was closed.
To Reproduce
Steps to reproduce the behavior:

  1. show alert "centerFloat"
  2. In
SwiftEntryKit.dismiss(with: {
               
           })

show new alert "centerFloat"

Attribute:

var attributes: EKAttributes
attributes = .centerFloat
attributes.windowLevel = .normal
attributes.hapticFeedbackType = .success
attributes.screenInteraction = canBeClosed ? .dismiss : .absorbTouches
attributes.entryInteraction = .absorbTouches
attributes.roundCorners = .all(radius: 20)
attributes.scroll = .enabled(swipeable: canBeClosed ? true : false, pullbackAnimation: .jolt)
attributes.screenBackground = .color(color: UIColor(white: 0, alpha: 0.7))
attributes.entryBackground = .color(color: .white)
attributes.entranceAnimation = .init(scale: .init(from: 0.9, to: 1, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 0, to: 1, duration: 0.3))
attributes.exitAnimation = .init(scale: .init(from: 1, to: 0.9, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 1, to: 0, duration: 0.3))
attributes.displayDuration = .infinity
attributes.border = .value(color: .black, width: 0.5)
attributes.shadow = .active(with: .init(color: .black, opacity: 0.3, radius: 5, offset: .zero))
attributes.positionConstraints.maxSize = .init(width: .offset(value: CGFloat(40.0.dp)), height: .intrinsic)
attributes.positionConstraints.keyboardRelation = .bind(offset: .init(bottom: 10, screenEdgeResistance: 10))

  1. iPhone X freezes

iPhone (please complete the following information):

  • Device: only iPhone X
  • iOS Version: 11.
  • Xcode Version 9.4.1
  • Dependency Manager Version: CocoaPods 1.5.3
  • SwiftEntryKit Release # 0.5.1
@huri000
Copy link
Owner

huri000 commented Jun 25, 2018

Hi, I'll test it. Are you sure your SwiftEntryKit version is not 0.5.0 by any chance?
I've already fixed that issue in 0.5.1.

@Banck
Copy link
Author

Banck commented Jun 25, 2018

image

@Banck
Copy link
Author

Banck commented Jun 27, 2018

@huri000 Have you found the reason of this bug?

@huri000
Copy link
Owner

huri000 commented Jun 27, 2018

Not yet. I’ll look into it this weekend and let you know.

@huri000 huri000 self-assigned this Jun 28, 2018
@huri000 huri000 added the bug Something isn't working label Jun 28, 2018
huri000 added a commit that referenced this issue Jun 29, 2018
iPhone X issue with presenting Alert right after previous was closed #62
@huri000
Copy link
Owner

huri000 commented Jun 29, 2018

@Banck, I've managed to reproduce the issue using iPhone X simulator.
Thanks for reporting this. The issue was due to missing the window hierarchy multiple times in the same run-loop. Really weird I admit. The solution was to execute each SwiftEntryKit a asynchronically on the main thread so that the next action would have to be executed on the next run-loop.
Available on 0.5.2.

@realvadim
Copy link

Hi there!

Unfortunately similar issue happens on iOS 9.3.2 (iPhone 5c).

If there is an entry displayed on the screen, showing a new entry will freeze the iPhone.

Although it works perfectly on iOS 10., 11. and even iOS 9.2.

@Banck
Copy link
Author

Banck commented Jul 13, 2018

@realvadim Hey!
Do you use the latest version of SwiftEntry (0.5.5)?

@realvadim
Copy link

realvadim commented Jul 13, 2018

Hi, @Banck Yes, I do.
image

@huri000
Copy link
Owner

huri000 commented Jul 13, 2018

Hi @realvadim,
I'm looking into it. It seems like only in iOS 9.3 the layout keeps updating the constraints in an endless loop. That's not supposed to happen of course.
This is a different issue, with different circumstances, so, could you please open a different bug report? I'll keep you updated over there.

I'll keep you updated.

@realvadim
Copy link

Trying to solve the issue, I first called dismiss if there is an entry on the screen and in its completion present a new entry (Not that good, though acceptable). However, even doing so it does freeze in some cases.

@realvadim
Copy link

@huri000 I will open a new one. Thanks taking time to reply that fast. Appreciate it.

@huri000
Copy link
Owner

huri000 commented Jul 13, 2018

Sure :-) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants