测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年4月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Pratik 维护。
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
在 ViewController.swift 中导入 PatrickMultipleSelectionTableView
import PatrickMultipleSelectionTableview
要在您的控制器中显示多选控制器,请调用函数 showMultipleSelection()
func showMultipleSelectionTableview()
{
let podBundle = Bundle(for: PKMulipleSelectionVC.self)
let bundleURL = podBundle.url(forResource: "PatrickMultipleSelectionTableview", withExtension: "bundle")
let bundle = Bundle(url: bundleURL!)!
let storyboard = UIStoryboard(name: "Main", bundle: bundle)
let vc:PKMulipleSelectionVC = storyboard.instantiateViewController(withIdentifier: "PKMulipleSelectionVC") as! PKMulipleSelectionVC
vc.arrContent = ["IPhone","IMac","IPad","MacBook","IPod","MacMini","Apple TV"] // Pass Array Data
vc.backgroundColorDoneButton = UIColor.init(colorLiteralRed: 87.0/255.0, green: 188.0/255.0, blue: 100.0/255.0, alpha: 1.0)
vc.backgroundColorHeaderView = UIColor.init(colorLiteralRed: 76.0/255.0, green: 82.0/255.0, blue: 83.0/255.0, alpha: 1.0)
vc.backgroundColorTableView = UIColor.init(colorLiteralRed: 59.0/255.0, green: 65.0/255.0, blue: 66.0/255.0, alpha: 1.0)
vc.backgroundColorCellTitle = UIColor.init(colorLiteralRed: 87.0/255.0, green: 188.0/255.0, blue: 100.0/255.0, alpha: 1.0)
vc.backgroundColorDoneTitle = UIColor.white
vc.backgroundColorSelectALlTitle = UIColor.white
// Get Selected Index from PKMultipleSelectionVC
if let returnIndex = UserDefaults.standard.object(forKey: "indexPath") as? [Int] {
vc.objGetSelectedIndex = returnIndex
}
// Data Passing Usning Block
vc.passDataWithIndex = { arrayData, selectedIndex in
self.btnClickeMe.setTitle("\(arrayData)", for: UIControlState.normal)
UserDefaults.standard.set(arrayData, forKey: "data")
UserDefaults.standard.synchronize()
}
vc.willMove(toParentViewController: self)
self.view.addSubview(vc.view)
self.addChildViewController(vc)
vc.didMove(toParentViewController: self)
}
pratikpanchal131, [email protected]
PatrickMultipleSelectionTableView 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。