iOS 下拉刷新视图:PeriscopyPullToRefresh
jopen
9年前
PeriscopyPullToRefresh 是下拉刷新视图,可以和 UIScrollView 及其子类一起使用。
override func viewDidLoad() { super.viewDidLoad() let titleView = PeriscopyTitleView(frame: CGRect(x: 0.0, y: 0.0, width: 140.0, height: CGRectGetHeight((self.navigationController?.navigationBar.frame)!)), attachToScrollView: tableView, refreshAction: { //your 'refreshing' code }) //customization titleView.titleLabel.textColor = .whiteColor() titleView.releaseLabel.textColor = .whiteColor() titleView.releaseLabel.highlightedTextColor = UIColor(red:207/255.0, green:240/255, blue:158/255, alpha:1.0) titleView.releaseLabel.text = "Release to reload" self.navigationItem.titleView = titleView }