{"id":18250542,"url":"https://github.com/urtaq/ssdrawerviewcontroller","last_synced_at":"2025-04-04T16:31:30.231Z","repository":{"id":79571800,"uuid":"67890002","full_name":"Urtaq/SSDrawerViewController","owner":"Urtaq","description":"MSDynamicDrawerViewController is written in Objective-C. So, I convert it and write in Swift.","archived":false,"fork":false,"pushed_at":"2017-05-10T15:18:37.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T15:12:36.734Z","etag":null,"topics":["drawerviewcontroller","swift","swift3","uidynamics","uikitdynamics"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Urtaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-10T19:23:27.000Z","updated_at":"2023-02-02T20:38:24.000Z","dependencies_parsed_at":"2023-05-12T10:15:45.383Z","dependency_job_id":null,"html_url":"https://github.com/Urtaq/SSDrawerViewController","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FSSDrawerViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FSSDrawerViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FSSDrawerViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urtaq%2FSSDrawerViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urtaq","download_url":"https://codeload.github.com/Urtaq/SSDrawerViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209387,"owners_count":20901766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drawerviewcontroller","swift","swift3","uidynamics","uikitdynamics"],"created_at":"2024-11-05T09:45:05.946Z","updated_at":"2025-04-04T16:31:30.225Z","avatar_url":"https://github.com/Urtaq.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSDrawerViewController\n\n[![Swift](https://img.shields.io/badge/Swift-3.0%2B-orange.svg)](https://swift.org)\n\n## What is this for?\n[MSDynamicDrawerViewController](https://github.com/erichoracek/MSDynamicsDrawerViewController) is written in Objective-C.\nSo, I convert it and write in Swift.  \nThis is integrated with UIKit Dynamics APIs(new in iOS7).  \nFor a detail, you can refer the [MSDynamicDrawerViewController](https://github.com/erichoracek/MSDynamicsDrawerViewController).\n\n## Requirements\n\n* iOS 8.1+\n* Swift 3.0+\n\n## Installation\n\n### Manual Import\n\nJust drag these sources into your project.  \nI'll support [Cocoapods]((https://github.com/CocoaPods/CocoaPods)) or [Carthage](https://github.com/Carthage/Carthage) ASAP.\n\n## Usage\n\nThe usage of SSDrawerViewController is same with [MSDynamicDrawerViewController](https://github.com/erichoracek/MSDynamicsDrawerViewController).  \nBut, compared to [MSDynamicDrawerViewController](https://github.com/erichoracek/MSDynamicsDrawerViewController), SSDrawerViewController is written in Swift.  \nAs a result, the usage is slightly different depends on each language's syntax.\n\nSo, I'd like to share my use case in Swift 3.\n\n```swift\n// AppDelegate.swift\n\nclass AppDelegate: UIResponder, UIApplicationDelegate, SSDrawerViewControllerDelegate {\n    ...\n    var window: UIWindow?\n    var drawerController: SSDrawerViewController?\n    var isDrawable: Bool = true\n    ...\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n    ...\n        // DrawerViewController\n        self.drawerController = self.window!.rootViewController as? SSDrawerViewController\n        self.drawerController?.delegate = self\n        self.drawerController?.addStylerFromArray([SSDrawerScaleStyler.styler(), SSDrawerFadeStyler.styler(), SSDrawerShadowStyler.styler()], forDirection: SSDrawerDirection.Left)\n\n        let menuViewController: SSMenuViewController = (self.window?.rootViewController?.storyboard?.instantiateViewController(withIdentifier: \"MenuViewController\") as? SSMenuViewController)!\n        menuViewController.drawerViewController = self.drawerController\n        self.drawerController?.setDrawerViewController(menuViewController, forDirection: SSDrawerDirection.Left)\n\n        // Transition to the first view controller\n        menuViewController.transitionToViewController()\n\n        self.window?.rootViewController = self.drawerController\n        self.window?.makeKeyAndVisible()\n    ...\n    }\n    \n    ...\n    \n// MARK: - SSDrawerViewControllerDelegate\n\n    func drawerViewController(_ drawerViewController: SSDrawerViewController, mayUpdateToPaneState paneState: SSDrawerMainState, forDirection direction: SSDrawerDirection) {\n        print(\"Drawer view controller may update to state `\\(paneState)` for direction `\\(direction)`\")\n\n        if paneState == .open {\n            if let menuViewController = drawerViewController.drawerViewController as? SSMenuViewController {\n                if let headerView = menuViewController.menuTableView.headerView(forSection: 0) as? SSMenuHeadView {\n                    headerView.configView()\n                }\n            }\n        }\n    }\n\n    func drawerViewController(_ drawerViewController: SSDrawerViewController, didUpdateToPaneState paneState: SSDrawerMainState, forDirection direction: SSDrawerDirection) {\n        print(\"Drawer view controller did update to state `\\(paneState)` for direction `\\(direction)`\")\n    }\n\n    func drawerViewController(_ drawerViewController: SSDrawerViewController, shouldBeginPanePan panGestureRecognizer: UIPanGestureRecognizer) -\u003e Bool {\n        return self.isDrawable\n    }\n}\n```\n\n```swift\n// SSMenuViewController.swift\n\nclass SSMenuViewController: UIViewController {\n    ...\n    weak var drawerViewController: SSDrawerViewController?\n    ...\n    func transitionToViewController() -\u003e Void {\n        let animateTransition: Bool = self.drawerViewController?.mainViewController != nil\n\n        let mainNavigationController: UINavigationController = (UIStoryboard(name: \"Main\", bundle: nil).instantiateViewController(withIdentifier: \"MasterNavigationController\") as? UINavigationController)!\n\n        self.drawerViewController?.setMainViewController(mainNavigationController, animated: animateTransition, completion: nil)\n    }\n}\n```\n\n## License\n\nSSDrawerViewController is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtaq%2Fssdrawerviewcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furtaq%2Fssdrawerviewcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furtaq%2Fssdrawerviewcontroller/lists"}