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

whose view is not in the window hierarchy! #1

Closed
pbeneteau opened this issue Mar 4, 2017 · 20 comments
Closed

whose view is not in the window hierarchy! #1

pbeneteau opened this issue Mar 4, 2017 · 20 comments

Comments

@pbeneteau
Copy link

pbeneteau commented Mar 4, 2017

I get this error: "Sparrow.SPRequestPermissionDialogInteractiveViewController: ... whose view is not in the window hierarchy!".

I setup the RequestPermission like this:

var permissionAssistant = SPRequestPermissionAssistant.modules.dialog.interactive.create(with: [.Location, .PhotoLibrary, .Notification])

override func viewDidAppear(animated: Bool) {
        permissionAssistant.present(on: self)
}

Thanks.

@pbeneteau
Copy link
Author

It only works when I use it with a button... I want it to appear when the view appears.

@davnag
Copy link

davnag commented Mar 4, 2017

I had the same problem but i used permissionAssistant.present(on: self) in viewDidLoad when i presented a view modally. I moved it to viewDidAppear and it worked for me.

@ivanvorobei
Copy link
Member

@stealdre, thanks for your feedback!
I try repeat this mistake, but could not. @davnag is rights, it is necessary to call a function in viewDidAppear. But your do it.

Tell us more about the issue. The controller present with a mistake or just a mistake? How does this affect application performance? Any information that would help me to reproduce this problem

@pbeneteau
Copy link
Author

pbeneteau commented Mar 4, 2017

I don't know... I only did what I said:

  • import Sparrow
  • init permission assistant var like above
    -permissionAssistant.present(on:self) in the viewDidAppear()

This issue also occur in viewDidAppear() but this works with a button.
I have a simple viewController. I tried with an other viewController, same issue.
This is not affecting the application performances.
"The controller present with a mistake or just a mistake?" What do you mean?

@ivanvorobei
Copy link
Member

@stealdre you call super?

override func viewDidAppear(animated: Bool) {
        **super.viewDidAppear(animated: Bool)**
        permissionAssistant.present(on: self)
}

@pbeneteau
Copy link
Author

what's the super for?

@pbeneteau
Copy link
Author

I tried to call it but still not working...

@ivanvorobei
Copy link
Member

@stealdre please, show full class your ViewController

@pbeneteau
Copy link
Author

@ivanvorobei
Copy link
Member

@davnag I tried to show this mistake, but did not see it. Your code works well for me

@pbeneteau
Copy link
Author

Arf...

@pbeneteau
Copy link
Author

I also have all these errors: http://pastebin.com/ZvP5ep48

@ivanvorobei
Copy link
Member

@stealdre It is normal. In sparrow use BezierPath for small size image

@ivanvorobei
Copy link
Member

@stealdre The error you see using the simulator or device? The controller is presented or not?

@pbeneteau
Copy link
Author

"In sparrow use BezierPath for small size image" Can you explain this?
This errors come with simulator and with my device...

@ivanvorobei
Copy link
Member

@davnag in sparrow used BezierPath for drawRect. It used without context, and show warnings. It is not mistake. All right

@pbeneteau
Copy link
Author

OK so that's not the cause of my issue?

@pbeneteau
Copy link
Author

I found something: I need to user a timer before to perform my function a bit later like this:

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(true)
        _ = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(self.checkPermissionsState), userInfo: nil, repeats: false);
    }

This is working. Maybe the loading of the view is too long and my function is performed before the view did appear...

@ivanvorobei
Copy link
Member

@davnag if you use delay - all right? I do not understand what is the problem. I have everything working without delay...

@pbeneteau
Copy link
Author

I don't know ahah this is strange! :p

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

3 participants