简体   繁体   English

jonkykong SideMenu presentationStyle 升级到 6.4.8 后停止工作

[英]jonkykong SideMenu presentationStyle stopped working after upgrade to 6.4.8

I am using the jonkykong SideMenu in a Swift 5 xcode project.我在 Swift 5 xcode 项目中使用jonkykong SideMenu。 The following code worked fine before 6.4.8.以下代码在 6.4.8 之前运行良好。

import UIKit
import SideMenu

class SideMenuViewController: UITableViewController {

    @IBOutlet weak var headerView: UIView!
    @IBOutlet weak var driverNameLabel: UILabel!
    @IBOutlet weak var vehicleRegoLabel: UILabel!

    var menuItems = [Dictionary<String, String>]()

    override func viewDidLoad() {
        super.viewDidLoad()

        // Config options for the Slide in side menu
        SideMenuManager.default.leftMenuNavigationController?.presentationStyle = .menuSlideIn
        SideMenuManager.default.leftMenuNavigationController?.presentationStyle.onTopShadowOpacity = 1

        // hides the 1px bottom border on the nav bar so the header seemless merges to the navbar
        self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")

        ... rest of controller code

After upgrading to 6.4.8 the presentationStyle has no effect.升级到 6.4.8 后,presentationStyle 无效。 The presentationStyle is always the default of viewSlideOut regardless of what I set in the above code.无论我在上面的代码中设置了什么,presentationStyle 始终是 viewSlideOut 的默认值。

I am unable to find anything in the README about changes to this in the latest version.我无法在 README 中找到有关最新版本对此所做更改的任何内容。 Any assistance would be greatly appreciated.任何帮助将不胜感激。

Please set presentationStyle in SideMenuSettings and assign it to SideMenuNavigationController.请在 SideMenuSettings 中设置 presentationStyle 并将其分配给 SideMenuNavigationController。

 func makeSettings() -> SideMenuSettings{
    var settings = SideMenuSettings()
    settings.allowPushOfSameClassTwice = false
    settings.presentationStyle = .menuSlideIn
    settings.statusBarEndAlpha = 0
    return settings
}

// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
       guard let sideMenuNavigationController = segue.destination as? SideMenuNavigationController else { return }
        sideMenuNavigationController.settings = makeSettings()
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM