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

Issue with programmatically added tableView #73

Closed
EngrAhsanAli opened this issue May 12, 2020 · 2 comments
Closed

Issue with programmatically added tableView #73

EngrAhsanAli opened this issue May 12, 2020 · 2 comments
Labels

Comments

@EngrAhsanAli
Copy link

Hi!

I tried to wrapping DTTableViewManager and providing dynamically added UITableView. So when added addSubview(tableView) the following delegate needs some time to wait for its addition.

self.manager.startManaging(withDelegate: self)

However, I made the workaround which works well, but of course, it's not preferable.

DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
       self.manager.startManaging(withDelegate: self)
} 

Any good way to deal with programmatically added UITableView in class extended from NSObject?

@DenTelezhkin
Copy link
Owner

Hi!

What makes you think that you need to wait some time before calling startManaging(withDelegate:)?

@EngrAhsanAli
Copy link
Author

Hello!

I use to get the following error sometimes but now it's working well, closing this thread with an excuse! Thanks anyway!

Call startManagingWithDelegate: method only when UITableView has been created

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

No branches or pull requests

2 participants