Conversation
…o de las funciones
…mplazo de celdas y secciones
…acer una clase enorme
…s y de los headers y footers
| internal func checkParameters(section: Int, row: Int?) -> Bool { | ||
|
|
||
| //TODO Test section and row conditions | ||
| if section > self.sectionManager.getNumberOfSections() { |
| return false | ||
| } | ||
|
|
||
| if let row = row { |
|
|
||
| //MARK: - ALSectionManagerProtocol | ||
|
|
||
| func sectionOpened(at section: Int, numberOfElements: Int) { |
There was a problem hiding this comment.
Estos dos métodos se parecen mucho, se podría hacer uno genérico que recibiera un método como parámetro e invocarlo desde otros dos pasándole la linea de insert o delete
There was a problem hiding this comment.
Si. De hecho tenia un metodo que te creaba ya el array de indexpathes, asi que lo he usado
|
|
||
| func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | ||
|
|
||
| if let cell: UITableViewCell = self.sectionManager.getCellFrom(tableView: tableView, indexPath: indexPath) { |
| let estimatedHeight: CGFloat = self.sectionManager.getCellHeightFrom(indexPath: indexPath) | ||
| return estimatedHeight | ||
| } | ||
| } else { |
There was a problem hiding this comment.
este else lo veo innecesario
| return false | ||
| } | ||
|
|
||
| public func remove(rowElement: ALRowElement, at indexPath: IndexPath, animation: UITableViewRowAnimation = .top) -> Bool { |
There was a problem hiding this comment.
poner pragma o dividir en multiples extensions por tipo de remove, insert a lo mejor es más legible
There was a problem hiding this comment.
te separo en extensiones insert, remove, replace. Tambien en sections
|
|
||
| import UIKit | ||
|
|
||
| class Master2TableViewCell: UITableViewCell, ALCellProtocol { |
There was a problem hiding this comment.
Los protocols yo soy de implementarlos en extensions
There was a problem hiding this comment.
pfff este codigo es de prueba para ir probando que funcionaba. Seguramente esta clase la borrare en un futuro xD
| case end = -2 | ||
| } | ||
|
|
||
| class ALTableView: NSObject, ALSectionManagerProtocol { |
There was a problem hiding this comment.
Por que no hereda de TableViewController? al final estas creando tu propio controller no?
abimaelbarea
left a comment
There was a problem hiding this comment.
Revisa los comments
|
Falta un update del readme |
No description provided.