JKBottomSearchView 1.1.1

JKBottomSearchView 1.1.1

Jarosław Krajewski 维护。



  • Jarosław Krajewski

JKBottomSearchView

Build Status

安装

CocoaPods

即将推出

Carthage

github "JeyKeyCom/JKBottomSearchView"

需求

  • #{18 フフとちょっと可愛いハートのアイコン}iOS 9+
  • #{19 フフとちょっと可愛いハートのアイコン}Xcode 9+
  • #{20 フフとちょっと可愛いハートのアイコン}Swift 4.1+

示例

您可以在以下链接查看使用 JKBottomSearchView 的示例项目: https://github.com/JaroVoltix/JKBottomSearchViewExample

使用方法

创建 JKBottomSearchView

func viewDidLoad(){
    super.viewDidLoad()
    let searchView = JKBottomSearchView()
    view.addSubview(searchView)
}

数据源与代理

JKBottomSearchViewDataSource 是 UITableViewDataSource 的别称。

extension ViewController:JKBottomSearchViewDataSource{}
searchView.dataSource = self

JKBottomSearchViewDelegate 是 UITableViewDelegate 和 UISearchBarDelegate 的别称。

extension ViewController:JKBottomSearchViewDelegate{}
searchView.delegate = self

自定义

//Change blur effect. Default nil
searchView.blurEffect = UIBlurEffect(style: .dark)

//Any non tableView and searchBar customization should be performed on contentView
searchView.contentView.backgroundColor = .red

//Customizing searchBar
searchView.barStyle = .black 
searchView.searchBarStyle = .minimal 
searchView.searchBarTintColor = .black
searchView.placeholder = "What are you looking for"
searchView.showsCancelButton = true
searchView.enablesReturnKeyAutomatically = true

//Customizing searchBar textField
let textField = searchView.searchBarTextField
textField.textColor = .red

//Customizing tableView
//You can access tableView and customize as You like by tableView property
searchView.tableView.isScrollEnabled = false

//Customizing expansion 
searchView.minimalYPosition = 100 // distance from top after fully expanding 
searchView.fastExpandindTime = 0.1
searchView.slowExpandingTime = 2
searchView.toggleExpand(.fullyExpanded,fast:false) // fast parameter is optional, default false

许可协议

示例中使用的图标可在以下位置获取: https://icons8.com

本项目的许可协议为 MIT 许可证 - 详细信息请参阅 LICENSE.md 文件。