Skip to content

Develop#1

Merged
lorencr7 merged 38 commits intomasterfrom
develop
Mar 21, 2018
Merged

Develop#1
lorencr7 merged 38 commits intomasterfrom
develop

Conversation

@lorencr7
Copy link
Member

No description provided.

internal func checkParameters(section: Int, row: Int?) -> Bool {

//TODO Test section and row conditions
if section > self.sectionManager.getNumberOfSections() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard?

return false
}

if let row = row {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard?


//MARK: - ALSectionManagerProtocol

func sectionOpened(at section: Int, numberOfElements: Int) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard

let estimatedHeight: CGFloat = self.sectionManager.getCellHeightFrom(indexPath: indexPath)
return estimatedHeight
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

este else lo veo innecesario

return false
}

public func remove(rowElement: ALRowElement, at indexPath: IndexPath, animation: UITableViewRowAnimation = .top) -> Bool {
Copy link
Contributor

@abimaelbarea abimaelbarea Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poner pragma o dividir en multiples extensions por tipo de remove, insert a lo mejor es más legible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

te separo en extensiones insert, remove, replace. Tambien en sections


import UIKit

class Master2TableViewCell: UITableViewCell, ALCellProtocol {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Los protocols yo soy de implementarlos en extensions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por que no hereda de TableViewController? al final estas creando tu propio controller no?

Copy link
Contributor

@abimaelbarea abimaelbarea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisa los comments

@abimaelbarea
Copy link
Contributor

Falta un update del readme

@lorencr7 lorencr7 merged commit fe68824 into master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants