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

Avoid dismiss displayActivityIndicator() during operation #31

Closed
MickaelCruzDB opened this issue Nov 28, 2017 · 1 comment
Closed

Avoid dismiss displayActivityIndicator() during operation #31

MickaelCruzDB opened this issue Nov 28, 2017 · 1 comment

Comments

@MickaelCruzDB
Copy link

Hi! In my project I'm using displayActivityIndicator() in order to wait during a sync/download. I would like to avoid that the user can dismiss the download and close the activity indicator.
My idea was to insert self.view.isUserInteractionEnabled = false like the example below. However it doesn't work I can dismiss the item. Any idea ? Thanks a lot in advance!

        self.page.actionHandler = { (item: PageBulletinItem) in
            item.manager?.displayActivityIndicator()
            self.view.isUserInteractionEnabled = false
            iControl.ICSes.login(user: "xxxx", pass: "xxx") { (loginStatus) in
                switch loginStatus {
                case .online:
                    iControl.ICSes.synchronize { (synchronizeStatus, error) in
                        if synchronizeStatus {
                            //Two next lines avoid to have multiple refresh buttons iterations
                            self.refreshMode.removeFromSuperview()
                            self.collectionView?.reloadSections(IndexSet(0 ..< 1))
                            
                            self.collectionView.reloadData()
                            
                            self.page.nextItem = BulletinDataSource.makeCompletionPage()
                            
                            item.manager?.displayNextItem()
                            self.view.isUserInteractionEnabled = true
                            self.tipView?.dismiss()
                            self.refreshMode.stop()
                            
                        } else { NSLog("Error: \(error!.stringValue)") }
                    }
                case .local: break
                case .none: break
                }
            }
        }
@MickaelCruzDB
Copy link
Author

I'm stupid..
self.page.isDismissable = true is already made for this...

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

1 participant