在你的 Storyboard 中选择一个单元格,并使用检查器将自定义类更改为 FDTextFieldTableViewCell
。
切换到属性检查器并将样式设置为“右侧详情”。
在你的 UITableViewController
子类中,执行类似以下操作:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = self.tableView.dequeueReusableCellWithIdentifier("textField") as! FDTextFieldTableViewCell
cell.textLabel!.text = "hi"
cell.textField.text = "editMe"
return cell
}
使用 Swift Package Manager 将其添加到您的项目中。在 Xcode 中,只需:File > Swift Packages > Add Package Dependency... 即可完成。 以下显示了针对旧项目的替代安装选项。
如果您已经在使用 CocoaPods,只需将 'FDTextFieldTableViewCell' 添加到您的 Podfile
,然后运行 pod install
。
如果您已经在使用 Carthage,只需将其添加到您的 Cartfile
github "fulldecent/FDTextFieldTableViewCell"
然后运行 carthage update
来构建框架并将构建好的 FDTextFieldTableViewCell
.framework 拖到您的 Xcode 项目中。