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

텍스트필드 편집 종료 시 스크롤되어 화면에 보이지 않으면 indexPath를 찾을 수 없음 #6

Open
youn9k opened this issue May 13, 2024 · 0 comments
Assignees
Labels
BUG 예상한 동작과 다르게 실행돼요
Milestone

Comments

@youn9k
Copy link
Collaborator

youn9k commented May 13, 2024

// 텍스트필드 편집을 종료하거나 다른 곳 터치 등으로 종료 될 경우 호출됨
private func deleteCellInTodayAgenda(_ cell: AgendaCell) {
        ...
        // TODO: 스크롤 되어 셀이 안보이면 못찾음
        guard let row = todayAgendaTableView.indexPath(for: cell)?.row else { return }
        guard let item = snapshot.itemIdentifiers[safe: row] else { return }
        snapshot.deleteItems([item])
    }

private func updateCellInTodayAgenda(_ cell: AgendaCell, _ text: String) {
       ...
        guard let row = todayAgendaTableView.indexPath(for: cell)?.row else { return }
        guard let item = snapshot.itemIdentifiers[safe: row] else { return }
    }

UITableView.indexPath(for:) 는 화면에 보여지고 있는 셀들에 대해서만 찾을 수 있음

@youn9k youn9k self-assigned this May 13, 2024
@youn9k youn9k added this to the v1.0.0 milestone May 13, 2024
@youn9k youn9k added the BUG 예상한 동작과 다르게 실행돼요 label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG 예상한 동작과 다르게 실행돼요
Projects
None yet
Development

No branches or pull requests

1 participant