{"id":15028528,"url":"https://github.com/antoniocasero/panels","last_synced_at":"2025-05-16T02:10:13.332Z","repository":{"id":62450512,"uuid":"144263731","full_name":"antoniocasero/Panels","owner":"antoniocasero","description":"Panels is a framework to easily add sliding panels to your application","archived":false,"fork":false,"pushed_at":"2020-02-05T21:42:25.000Z","size":40536,"stargazers_count":1504,"open_issues_count":6,"forks_count":89,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-10T14:56:32.246Z","etag":null,"topics":["bottom","containerviewcontroller","iphone-x","notifications","panel","panels","popup","safe-area","sliding","sliding-menu","swift4","ui","ux"],"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/antoniocasero.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}},"created_at":"2018-08-10T09:05:52.000Z","updated_at":"2025-03-07T05:44:58.000Z","dependencies_parsed_at":"2022-11-01T23:31:32.983Z","dependency_job_id":null,"html_url":"https://github.com/antoniocasero/Panels","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniocasero%2FPanels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniocasero%2FPanels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniocasero%2FPanels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antoniocasero%2FPanels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antoniocasero","download_url":"https://codeload.github.com/antoniocasero/Panels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"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":["bottom","containerviewcontroller","iphone-x","notifications","panel","panels","popup","safe-area","sliding","sliding-menu","swift4","ui","ux"],"created_at":"2024-09-24T20:08:33.173Z","updated_at":"2025-05-16T02:10:13.314Z","avatar_url":"https://github.com/antoniocasero.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"420\" src=\"Resources/PanelsLogo.png\"/\u003e\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/antoniocasero/Panels.svg?branch=master)](https://travis-ci.org/antoniocasero/Panels)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods](https://img.shields.io/badge/pod-v2.0.2-blue.svg)](https://github.com/antoniocasero/Panels)\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift)\n\n[![Twitter](https://img.shields.io/badge/twitter-@acaserop-blue.svg?style=flat)](http://twitter.com/acaserop)\n\n\nPanels is a framework to easily add sliding panels to your application.\nIt takes care of the safe area in new devices and moving your panel when the keyboard\nis presented/dismissed.\n\nUpdated to Swift 5.1\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"Resources/Demo1.gif\" width=\"237\" height=\"471\" alt=\"Sliding Panel demo1\"\u003e\n    \u003cimg src=\"Resources/Demo2.gif\" width=\"237\" height=\"471\" alt=\"Sliding Panel demo2\"\u003e\n    \u003cimg src=\"Resources/Demo3.gif\" width=\"237\" height=\"471\" alt=\"Sliding Panel demo3\"\u003e\n\u003c/p\u003e\n\n## Usage\n\nFirst, create your own panel, you can use Interface Builder, use as reference the examples provided.\nMake sure that you conform the protocol `Panelable`\n\n```swift\nimport UIKit\nimport Panels\n\nclass PanelOptions: UIViewController, Panelable {\n    @IBOutlet var headerHeight: NSLayoutConstraint!\n    @IBOutlet var headerPanel: UIView!\n}\n```\nThis protocol defines the interface needed to be able to adjust the sliding panel\nto the container, expanding and collapsing. It will take care of the safe area\n\n\nThen in your  ViewController, where the panel is presented:\n\n```swift\nclass YourViewController: UIViewController {\n    lazy var panelManager = Panels(target: self)\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        let panel = UIStoryboard.instantiatePanel(identifier: \"YourPanelName\")\n        let panelConfiguration = PanelConfiguration(size: .oneThird)\n        \n        // To present the panel\n        panelManager.show(panel: panel, config: panelConfiguration)\n        ....\n        // To dismiss the panel\n        panelManager.dismiss()\n    }\n}\n\n```\n\nIf you want to get notifications when the panel is presented, collapsed or\nexpanded, just conform the protocol `PanelNotifications`\n\nYou can find extra options in the `PanelConfiguration` object:\n\n```swift\n    /// Storyboard name, the first Viewcontroller will be instantiated\n    public var panelName: String\n\n    /// Panel height\n    public var panelSize: PanelDimensions\n\n    /// Panel margins between the header and the next views.\n    public var panelMargin: CGFloat\n\n    /// Visible area when the panel is collapsed\n    public var panelVisibleArea: CGFloat\n\n    /// Safe area is avoided if this flag is true.\n    public var useSafeArea = true\n\n    /// Collapse and expand when tapping the header view.\n    public var respondToTap = true\n\n    /// Collapse and expand when dragging the header view.\n    public var respondToDrag = true\n\n    /// Collapse when tapping outside the panel\n    public var closeOutsideTap = true\n\n    /// Animate the panel when the superview is shown.\n    public var animateEntry = false\n\n    /// If parent view is a navigationcontroller child, this flag allow a better calculation when the panelSize is .fullScreen\n    public var enclosedNavigationBar = true\n```\n\nYou could add an arrow indicator to give more feedback to your panels. The perfect companion for `Panels` is [Arrows](https://github.com/antoniocasero/Arrows)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"Resources/ArrowExample.gif\" width=\"237\" height=\"471\" alt=\"Arrows Example\"\u003e\n\u003c/p\u003e\n\n\n## Installation\n\n### CocoaPods\nAdd the line `pod \"Panels\"` to your `Podfile`\n\n### Carthage\nAdd the line `github \"antoniocasero/Panels\"` to your `Cartfile`\n\n### SPM\n```\ndependencies: [\n  .package(url: \"https://github.com/antoniocasero/Panels.git\", from: \"2.2.3\")\n]\n```\n\n## Author\nProject created by Antonio Casero ([@acaserop](https://twitter.com/acaserop) on Twitter).\n\n## Credits\nSketch UI ([Elements](https://sketchapp.com/elements))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniocasero%2Fpanels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantoniocasero%2Fpanels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoniocasero%2Fpanels/lists"}