2014-11-24 79 views
1

在swift代码库上使用SVPullToRefresh + SVInfiniteScrolling。我怎样写SVPullToRefresh + SVInfiniteScrolling in Swift code

[tableView addPullToRefreshWithActionHandler:^{ 
    // prepend data to dataSource, insert cells at top of table view 
    // call [tableView.pullToRefreshView stopAnimating] when done 
}]; 

[tableView addPullToRefreshWithActionHandler:^{ 
    // prepend data to dataSource, insert cells at top of table view 
    // call [tableView.pullToRefreshView stopAnimating] when done 
} position:SVPullToRefreshPositionBottom]; 
在SWIFT代码

回答

1

尝试类似:

self.tableView.addPullToRefreshWithActionHandler({() -> Void in 
    //code  
}) 
1
myTableView.addPullToRefreshWithActionHandler({() -> Void in 

} 

记得SVPullToRefresh添加到您的清创头文件如“MyProject的桥接,Header.h

#import <SVPullToRefresh/SVPullToRefresh.h> 
0
tableView.addPullToRefreshWithActionHandler { 

} 
0

可以是:

myTableView.addPullToRefresh(actionHandler: { 

}) 

myTableView.addInfiniteScrolling(actionHandler: 
      {() -> Void in 

     }) 

雨燕现切的第一个参数的名字从函数名以及由罗伯特提到你需要包括这一点。您的桥接文件中的标题。