TableRow 0.4.0

TableRow 0.4.0

Anton Kovtun维护。



TableRow 0.4.0

  • 作者:
  • Anton Kovtun

介绍

TableRow和TableInlineRow是Eureka表单库的自定义行。TableRow在单元格内部使用UITableView,允许在多个选项之间进行选择。TableInlineRow是TableRow之上的InlineRow。

用法

行是通用的,因此可能存在不同的情况

import Eureka
import TableRow

class ViewController: FormViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        form +++ Section()
            <<< TableRow<Int> { row in
            	row.options = [1, 2, 3]
            	row.displayValueFor = { "\($0 ?? 0)" }
            }
            <<< TableInlineRow<String> { row in
                row.options = ["first", second", "third"]
				row.value = "none"
            }
    }
}

需求

  • iOS 9.0+
  • Xcode 11.0+
  • Eureka 5.0+

安装

CocoaPods

  1. 将以下行添加到Podfile中

    pod 'TableRow'
  2. 运行 $ pod install

Carthage

  1. 将以下行添加到您的 Cartfile

    github "EurekaCommunity/TableRow"
    
  2. 运行 $ carthage update

  3. 在您的目标中链接 TableRow.framework,在 Build Phases 的 Copy Frameworks 脚本中将其添加到 input files 列表

自定义

TableRow

  • textColor - 为下层的 tableView cells 提供默认文字颜色
  • horizontalContentInset - 为 cells 提供内容内边距,用于区分其他行
  • configureCell callback - 在 cell 取消分配期间配置内部 cell
  • onDidSelect callback - 每次内部 cell 被选中时调用

TableInlineRow

  • subcellTextColor, subcellHorizontalInset - 为 TableRow 提供相应的参数
  • configureSubcell callback - 为 TableRow 设置 configureCell callback
  • onToggleInlineRow callback - 根据行切换状态可选地提供动作

作者