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

StatusAlert object is not deinit #4

Closed
RSickenberg opened this issue Jul 10, 2018 · 11 comments
Closed

StatusAlert object is not deinit #4

RSickenberg opened this issue Jul 10, 2018 · 11 comments

Comments

@RSickenberg
Copy link

image

Version : 0.12.0

@LowKostKustomz
Copy link
Owner

LowKostKustomz commented Jul 11, 2018

Hi, could you please provide me code that presents alert and what are you doing?

@LowKostKustomz
Copy link
Owner

And all the code related to StatusAlert, setup, timings, and all the things that could help me identify the bug.

@RSickenberg
Copy link
Author

RSickenberg commented Jul 12, 2018

let likeAlert = StatusAlert()

... 

noFavorites.image = #imageLiteral(resourceName: "DislikeFullHighRes")
noFavorites.title = "Oh!"
noFavorites.message = "It seems you don't have any favorties. Go love your favorites on the ❤️ top right corner."
noFavorites.canBePickedOrDismissed = true
noFavorites.appearance = .copyCommon()
noFavorites.alertShowingDuration = TimeInterval(exactly: 5)!

@LowKostKustomz
Copy link
Owner

I think I get your problem: you are calling show method multiple times on one instance of StatusAlert, am I right?

If so then there is the rule for now: you should create new instance of alert for every new alert you want to present. I will fix this in a few days and distribute the fix, so stay tuned.

If this is not your problem then reply with some additional info.

@RSickenberg
Copy link
Author

RSickenberg commented Jul 12, 2018

You are right, Thanks for the fix, I update to the new version when she is ready :)

Thanks for taking time with me ! 😄

@LowKostKustomz
Copy link
Owner

You are welcome!

@LowKostKustomz
Copy link
Owner

The issue was fixed in version 0.12.1.

Now you can present the same instance of alert multiple times.

NOTE

  • more than one presentation of one instance of alert at the same time is not allowed and will be ignored;

@RSickenberg
Copy link
Author

Thanks @LowKostKustomz !

@RSickenberg
Copy link
Author

Hello @LowKostKustomz, thanks for your upgrade, but I have a new bug, when I keep init my view and I switch from a new tab and recall the Alert, I cannot dismiss it anymore, is it from my side?

@LowKostKustomz
Copy link
Owner

It depends on your code, could you please provide more detailed description of your bug what you are doing and show me the code that probably can cause the issue?

Also you can try to go to source files of my library and set a breakpoint to dismiss method and see if it is called. Try to debug it from the inside of my library and step by step getting up to your code, maybe some of your methods is not called.

@RSickenberg
Copy link
Author

RSickenberg commented Jul 30, 2018

I begin my ViewController with an instantiation of StatusAlert
let likeAlert = StatusAlert()

I call a method onViewDidLoad with those lines

StatusAlert.multiplePresentationsBehavior = .dismissCurrentlyPresented
methodName()

func methodName() {
    likeAlert.canBePickedOrDismissed = true
    likeAlert.alertShowingDuration = TimeInterval(exactly: 2)!
}

And that's it when I recall my StatusAlert if I didn't deinit (back to root) the status alert doesn't dismiss itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants