【发布时间】:2020-10-08 15:42:04
【问题描述】:
【问题讨论】:
标签: ios swift xcode uitableview uiviewcontroller
【问题讨论】:
标签: ios swift xcode uitableview uiviewcontroller
快速访问indexpath行有一个前置条件
/// The section of this index path, when used with `UITableView`.
///
/// - precondition: The index path must have exactly two elements.
public var section: Int
/// The row of this index path, when used with `UITableView`.
///
/// - precondition: The index path must have exactly two elements.
public var row: Int
如果要访问或更改行,则需要使用行和节来初始化 indexPath
var foo: IndexPath
foo = IndexPath(row: 0, section: 0)
foo.row = 1 // return foo (1,0)
【讨论】: