KYLateralSlide
https://github.com/ChavezChen/CWLateralSlide.git 实现的 Swift 版本,请指出写的不好的地方
参考使用方法:
使用 cocoapods 或者手动拖入。
platform :ios, '10.0'
target 'TargetName' do
pod 'KYLateralSlide'
end
无法找到最新版本的解决方案:
1、执行rm ~/Library/Caches/CocoaPods/search_index.json 删除索引的缓存再搜索,如果这样也搜索不到的话更新cocoapods
2、执行 pod repo update --verbose 更新成功之后就没问题了
1、显示抽屉:
let vc = LeftViewController.init()
ky_showSide(configuration: { (config) in
}, viewController: vc)
vc为你需要侧滑出的控制器,调用此方法即可获得抽屉效果以及左划/点击返回功能。
2、注册滑动手势驱动抽屉
// 手势注册
let vc = LeftViewController.init()
self.ky_registGestureShowSide { (direction) in
if direction == .left {
self.ky_showSide(configuration: { (config) in
config.animationType = .zoom
}, viewController: vc)
}else {
self.ky_showSide(configuration: { (config) in
config.direction = .right
}, viewController: vc)
}
}