本次已经有了一个Objective-C项目
1.创建 Demo-Bridging-Header.h,此页面声明的文件的所有的文件都可以用
Use this file to import your target's public headers that you would like to expose to Swift.
新工程刚创建时创建swift file可以自动生成;
若不自动生成可以手动创建
2.设置build Setting->package
3.在需要用的文件导入XXX-Swift.h,XXX是Product Module Name de值
此处为Demo-Swift.h
然后可以使用Swift的类和方法了
DGElasticPullToRefreshLoadingViewCircle * cricle = [[DGElasticPullToRefreshLoadingViewCircle alloc] init];
cricle.tintColor = [UIColor colorWithRed:78/255.0 green:221/255.0 blue:200/255.0 alpha:1.0];
[self.tableView dg_addPullToRefreshWithActionHandler:^{
[self.tableView dg_stopLoading];
} loadingView:cricle];
[self.tableView dg_setPullToRefreshFillColor:[UIColor colorWithRed:57/255.0 green:67/255.0 blue:89/255.0 alpha:1]];
工程结果如下:
反过来混编也是类似,不再赘述
附上刷新作者工程