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

Insert rows without animations #3

Open
markst opened this issue Jun 27, 2016 · 4 comments
Open

Insert rows without animations #3

markst opened this issue Jun 27, 2016 · 4 comments

Comments

@markst
Copy link
Contributor

markst commented Jun 27, 2016

Unable to insert rows without KVO observing observableSections which inserts the rows inside table view animated updates.
Would be nice to avoid this when adding rows in viewDidLoad

@markst
Copy link
Contributor Author

markst commented Jun 27, 2016

Or perhaps just set
self.sectionAnimation = UITableViewRowAnimation.None and toggle back to .Fade after inserting the rows??

@tbergmen
Copy link
Owner

This is a good idea. Would you like to create a pull request?

@markst
Copy link
Contributor Author

markst commented Nov 2, 2016

@tbergmen what do you think would be appropriate?

to have the KVO observe observableSections?

addObserver(self, forKeyPath: "observableSections", options: NSKeyValueObservingOptions.new, context: nil)

and then simply add the section directly to the sections with a reload data call?

open func addSectionWithoutAnimation(_ section: TableSection) {
    assignParentsToSection(section)
    sections.add(section)
    self.tableView.reloadData()
}

@tbergmen
Copy link
Owner

tbergmen commented Nov 2, 2016

@markst that should work. Do you think there will be a flicker when reloading the data?

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

No branches or pull requests

2 participants