Slide Sidebar Menu IOS 8 Swift [closed]

2019-01-10 02:21发布

Is there a way to implement Slide Sidebar Menu (Like Facebook app) in IOS Swift without any third party library? I look for solutions but I only founded this feature implemented in Objective-C.

标签: swift ios8
7条回答
forever°为你锁心
2楼-- · 2019-01-10 03:04

Slide side bar menus for iOS7 and iOS8, Swift coded.

If you want it at NavigationController level (it means, for al View controllers behind it):

https://github.com/evnaz/ENSwiftSideMenu

If you want it just in one ViewController:

Video: https://www.youtube.com/watch?v=qaLiZgUK2T0

Source-code: http://goo.gl/ULWxJh

In this case, for iOS7 compatibility, just add this "if" condition where the "Add blur view" comment is placed, like this:

if (NSClassFromString("UIVisualEffectView") != nil) {        
    // Add blur view
    let blurView:UIVisualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.Light))
    blurView.frame = sideBarContainerView.bounds
    sideBarContainerView.addSubview(blurView)
}
查看更多
登录 后发表回答