FAPanels - Swift

Overview

Alt text

Swift version Support Dependecy Manager Version Carthage Compatible License Platform CocoaPods CocoaPods

Famous Apps Using FAPanels


New Features Added


  • Swift Package Manager Support Added

Change Color Of Center Panel While Panning


open var colorForTapView: UIColor = UIColor.black.withAlphaComponent(0.35)
open var shouldAnimateWithPan: Bool = true

Issues Resolved ( > 0.5.0 only)


  • XCode 10 support
  • Swift 5.0 support

Issues Resolved ( > 0.4.0 only)


  • Presenting a UINavigation controller distorts the frames of center panel while left panel is open and its state is front, is resolved
  • Crash when right panel is nil and layout panel containers are updated is resolved

New Features Added ( > 0.3.5 only)


  • Execute a completion closure for any state of side menus, right after the animation of changing center panelVC
  • Smooth logout feature ( i.e: When user taps on logout button/cell in the side menu, you will change the center panelVC and then can set left panelVC to "nil" as you don't want the user to use side menus in login/signup stories)
  • Change Left/Right menus with smooth center panelVC animations

New Features Added ( > 0.3.1 only)


  • Create as many instances of FAPanelController with code only
  • Configure its left, right and center panels as you want
  • Update the Root Window Controller with any FAPanelController object

Usage

//  Create FAPanelController object with out any NSCoder, Storyboards and Nib files

let rootController = FAPanelController()

//  Configure the panels as you want and assign this panel controller to root controller of window.

window?.rootViewController = rootController


//  You can also set window's root controller to any FAPanelController object with different FAPanelConfigurations at any time.

New Features Added ( > 0.3.0 only)


  • Right panel position (front/back) to center panel
  • Dark Overlay on right panel, if right panel position is front

Right Panel Position

back front

Usage

//  Set the Right Panel position

let rootController: FAPanelController = window?.rootViewController as! FAPanelController

rootController.rightPanelPosition = .front
rootController.rightPanelPosition = .back

New Features Added ( > 0.2.1 only)


  • Left panel position (front/back) to center panel
  • Shadow on left panel, if left panel position is front
  • FAPanel State Delegate feature

Left Panel Position

back front

Usage

//  Set the Left Panel position

let rootController: FAPanelController = window?.rootViewController as! FAPanelController

rootController.leftPanelPosition = .front
rootController.leftPanelPosition = .back

Features


  • Implementation with code & storyboard
  • Left, right and center panel supported
  • Change left, right or center panel
  • Open left, right or center panel
  • Supports Animations
  • Multiple Panel configurations
  • Supports status bar preffered style for all panels

Transitions supported


  • Flip From Left
  • Flip From Right
  • Flip From Top
  • Flip From Bottom
  • Curl Up
  • Curl Down
  • Cross Dissolve
  • Move Up
  • Move Down
  • Move Left
  • Move Right
  • Split Horizontally
  • Split Vertically
  • Dump Fall
  • Box Fade

Panel configurations

// Panels width

var leftPanelWidth : CGFloat = 280  //  It will override the gap percentage value
var rightPanelWidth: CGFloat = 280

var leftPanelGapPercentage : CGFloat = 0.8
var rightPanelGapPercentage: CGFloat = 0.8


// resizes all subviews as well

var resizeLeftPanel : Bool = false
var resizeRightPanel: Bool = false


// Adds push animation on side panels

var pusheSidePanels: Bool = false


// Bounce effects on panel animations

var bounceOnLeftPanelOpen  : Bool = true
var bounceOnRightPanelOpen : Bool = true
var bounceOnCenterPanelOpen: Bool = true


var bounceOnLeftPanelClose   : Bool = false
var bounceOnRightPanelClose  : Bool = false
var bounceOnCenterPanelChange: Bool = true


var bouncePercentage : CGFloat = 0.075
var bounceDuration   : CGFloat = 0.1


//  Panning Gesture

var canRecognizePanGesture: Bool = true

var panFromEdge          : Bool = false
var minEdgeForLeftPanel  : CGFloat = 70.0
var minEdgeForRightPanel : CGFloat = 70.0

var canLeftSwipe : Bool = true
var canRightSwipe: Bool = true


// restricts panning gesture to work for top VC of Navigation/TabBar Controller

var restrictPanningToTopVC: Bool = true


// Handles the interface auto rotation of visible panel

var handleAutoRotation: Bool = true


// Applies corner radius to panels

var cornerRadius: CGFloat = 0.0


// Shadow configurations

open var shadowColor   : CGColor = UIColor.black.cgColor
open var shadowOffset  : CGSize  = CGSize(width: 10.0, height: 0.0)
open var shadowOppacity: Float = 0.5


// Remove panels from super view when possible

var unloadRightPanel: Bool = false
var unloadLeftPanel : Bool = false


// Max animation duration for animations of side panels

var maxAnimDuration  : CGFloat = 0.20


// percentage of screen's width to the centerPanel.view must move for panGesture to succeed

var minMovePercentage: CGFloat = 0.15


// Only Center Panel Change animation

var changeCenterPanelAnimated : Bool = true
var centerPanelTransitionType : FAPanelTransitionType = .crossDissolve
var centerPanelTransitionDuration: TimeInterval = 0.60

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate FAPanel into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '
   
   
    
    '
   
    do
pod 'FAPanels'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate FAPanels into your Xcode project using Carthage, specify it in your Cartfile:

= 0.2.0 ">
github "fahidattique55/FAPanels" >= 0.2.0

Run carthage update to build the framework and drag the built FAPanels.framework into your Xcode project.

Usage

Step 1

  • Set the root window as FAPanel controller as shown in below image,

Alt text

Step 2

  • Add the following code in AppDelegate.swift file,
//  Load the Controllers 

let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)

let leftMenuVC: LeftMenuVC = mainStoryboard.instantiateViewController(withIdentifier: "LeftMenuVC") as! LeftMenuVC

let rightMenuVC: RightMenuVC = mainStoryboard.instantiateViewController(withIdentifier: "RightMenuVC") as! RightMenuVC

let centerVC: CenterVC = mainStoryboard.instantiateViewController(withIdentifier: "CenterVC1") as! CenterVC
let centerNavVC = UINavigationController(rootViewController: centerVC)




//  Set the Panel controllers with just two lines of code

let rootController: FAPanelController = window?.rootViewController as! FAPanelController
rootController.center(centerNavVC).left(leftMenuVC).right(rightMenuVC)
  • All done! Run the code and see the magic.

Step 2 (Continue - Panel Controllers)

  • Don't want to set RightMenuVC then just remove the right panel code i.e,
//  This is the code to set all panels 

rootController.center(centerNavVC).left(leftMenuVC).right(rightMenuVC)


//  Updated code which have only left and center panels 

rootController.center(centerNavVC).left(leftMenuVC)


//  Similarly, if left panel is not needed the remove the left panel code.

rootController.center(centerNavVC).right(rightMenuVC)


//  In case you only want the center panel, then update code to

rootController.center(centerNavVC)

Step 2 (Continue - Panel Configurations)

  • Configre the Panels before setting the panels
rootController.configs.rightPanelWidth = 80
rootController.configs.bounceOnRightPanelOpen = false



//  Should Pan from edge? Add these lines of code, 

rootController.configs.panFromEdge = false
rootController.configs.minEdgeForLeftPanel  = 70
rootController.configs.minEdgeForRightPanel = 70


rootController.center(centerNavVC).left(leftMenuVC).right(rightMenuVC)


//  For more configurations and their details, Please have a look into ``` FAPanelConfigurations.swift ``` file 

Access Panel

  • Panel can be accessed from any view controller,
panel?.configs = FAPanelConfigurations()

Open/Close Panels

  • Open Left or Right panels with/without animations
panel?.openLeft(animated: true)
panel?.openRight(animated: true)

  • Open/Close Panels Preview

Change/Remove Panels

  • Change Left, Right or Center Panel from any view controller
//  Change Center panel

let centerVC: UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "CenterVC2")
let centerNavVC = UINavigationController(rootViewController: centerVC)

panel!.center(centerNavVC)



//  Change Left panel

let leftVC: UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "LeftVC")
panel!.left(leftVC)


//  Remove Left panel

panel!.left(nil)

  • Preview, when changing center panel from left/right panels

Change Center Panel (With custom transitions and durations)

  • Change Left, Right or Center Panel from any view controller
//  Specify the transition type

panel!.configs.centerPanelTransitionType = .transitionOption     // Transitions supported are mentioned in FAPanelTransitionType


//  Specify the transition duration

panel!.configs.centerPanelTransitionDuration = 0.60


//  Update the center panel

panel!.center(centerNavVC)

  • Transitions Preview
flipFromLeft flipFromRight
flipFromTop flipFromBottom
curlUp curlDown
crossDissolve moveRight
moveLeft moveUp
moveDown splitVertically
splitHorizontally dumpFall
boxFade

Supports interface rotation

License

FAPanels is licensed under the Apache License 2.0.

For more details visit http://www.apache.org/licenses/LICENSE-2.0

Author

Fahid Attique - (https://github.com/fahidattique55)

Comments
  • crash in appdelegate

    crash in appdelegate

    Hi after set this code let rootController: FAPanelController = window?.rootViewController as! FAPanelController

    app crash and get me this error

    Could not cast value of type 'LibraryForDeveloper.ViewController' my ViewController extend from UIViewController

    screen shot 1396-05-20 at 19 44 15

    thanks

    opened by MansoorJafari 21
  • About step 2

    About step 2

    I've already set the root window as FAPanel controller. But when i'm trying to do step 2, i can't let rootController: FAPanelController = window?.rootViewController as! FAPanelController because FAPanelController is a undeclared type.

    I'm pretty like this pod and want to use it in my project. Please let me know if there's any solution. Best regard

    opened by GilisHugo 8
  • Change dark overlay opacity with animation

    Change dark overlay opacity with animation

    Hi, I configured FAPanel to show dark overlay when left panel position is front configs.showDarkOverlayUnderLeftPanelOnTop = true

    But this overlay view appears/disappears without animation. I want to animate it's opacity depending on the left panel's distance from the edge (or while moving left panel with the finger).

    How can I achieve this? Thanks.

    enhancement In-Progress 
    opened by Shamsiddin 7
  • Import file issue

    Import file issue

    Hi, i'm importing the FAPanels but it is showing an error that no such module. I have properly installed the pods but it is showing such issue. Second one i want to ask that in my centerVC how can i open LeftFAPanel in click of button and same with other View controllers just on click of a button? It would be more better if u have a video tutorial also.

    opened by Hamza-Brainplow 6
  • FAPanel use from other viewcontroller

    FAPanel use from other viewcontroller

    Hi, This is not an issue, I need your help.
    How can I use FAPanel from another view controller. I don't want to use FAPanel from appDelegate. I have Signin View Controller after successfully signin I want to use FAPanel. I already set root view controller is signin view controller. How can I use FAPanels after user signin? I want to use FAPanel in my signin view controller.

    my view controller name is

    1. LeftViewController
    2. HomeViewController
    3. not use right view controller so I passed nill

    My Code is which is used in a signin view controller

                    //====FAPanel for XIB
                    let centerVC = HomeViewController(nibName: "HomeViewController", bundle: nil)
                    let leftMenuVC = LeftViewController(nibName: "LeftViewController", bundle: nil)
                  
                   let centerNavVC = UINavigationController(rootViewController: centerVC)
                    
                    let window = UIWindow(frame: UIScreen.main.bounds)
    

    // let appDelegate = UIApplication.shared.delegate as! AppDelegate

                    let rootController: FAPanelController = window.rootViewController as! FAPanelController
                    _ = rootController.center(centerNavVC).left(leftMenuVC).right(nil)
                    window.makeKeyAndVisible()
    

    But this code is not working.

    Can you please help me!

    I face this type of issue as well

    Could not cast value of type 'UINavigationController' (0x10b719ed8) to 'appname.FAPanelController' (0x106fc41f8). 2018-03-09 16:05:07.504574+0530 appname[28149:682526] Could not cast value of type 'UINavigationController' (0x10b719ed8) to 'appname.FAPanelController' (0x106fc41f8).

    opened by JayeshPoriya 6
  • Unknown Class

    Unknown Class

    I've followed the instructions for install but I keep getting this error. Also, even when I copy the sample project onto a new project. Any idea?

    2017-08-03 00:46:19.745949-0500 menu[82818:17871549] Unknown class _TtC4menu17FAPanelController in Interface Builder file. Could not cast value of type 'UIViewController' (0x1110a33f8) to 'FAPanels.FAPanelController' (0x10e28d4a0). 2017-08-03 00:46:19.981588-0500 menu[82818:17871549] Could not cast value of type 'UIViewController' (0x1110a33f8) to 'FAPanels.FAPanelController' (0x10e28d4a0). (lldb)

    opened by JesseRubio 6
  • How to open FAPAnnel inside ViewController not in app Delegate ??

    How to open FAPAnnel inside ViewController not in app Delegate ??

    i set it in app delegate already when the user open app for the second time but when he open it for first time i want to open main screen from this button action and i git this error

    screen shot 2018-10-21 at 5 14 53 pm
    opened by MahmoudKhaled 5
  • Create an example project

    Create an example project

    Working with your framework, I guess it will be amazing if a new user will be able not just look at README throughout working with FAPnels, but if he/she could download a small demo project with some easy-to-implement features and can touch it deeper, interacting and adapting to work with the framework in parallel.

    opened by hamsternik 5
  • Problem with closed menu.

    Problem with closed menu.

    @fahidattique55 I need to add a button on the left menu which would close it. I used this method for openCenter(animated: true). But when you click on the menu button closed without animation. And with the subsequent calls the menu animation was not smooth as it was before calling the method openCenter(animated: true). Correct it please, if possible, and add the method to closeMenu(animated: true).

    opened by xX-Lucifer-Xx 4
  • Panel Delegates responses are slow

    Panel Delegates responses are slow

    Not sure if it's only me

    Delegate methods are running called for the first few times.

    and

    let panel = FAPanelController() doesn't work, have to use (coder: ..)

    opened by djaygit 4
  • (Request) FAPanelDelegate

    (Request) FAPanelDelegate

    Might be useful to create a delegate for FAPanelController:

    public protocol FAPanelControllerDelegate: class{

    func centerPanelWillBecomeActive()
    func leftPanelWillBecomeActive()
    func rightPanelWillBecomeActive()
    
    func centerPanelDidBecomeActive()
    func leftPanelDidBecomeActive()
    func rightPanelDidBecomeActive()
    

    }

    opened by droni89 4
  • After navigate to root view controller from side menu,side menu is not able visible

    After navigate to root view controller from side menu,side menu is not able visible

    After navigate to root view controller from side menu,the side menu is not able to visible

    I have wrriten the below code in my side menu table view did select

    simulator_screenshot_9B502862-7DD7-4FAF-B2DA-BCE3294E1BE2

      let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
            let leftMenuVC: SideMenuViewController = mainStoryboard.instantiateViewController(withIdentifier: 
      "SideMenuViewController") as! SideMenuViewController
            let centerVC: TabbarViewController  = mainStoryboard.instantiateViewController(withIdentifier: "TabbarViewController") as! TabbarViewController
            let centerNavVC = UINavigationController(rootViewController: centerVC)
            centerNavVC.navigationBar.isHidden=true
            let appDelegate = UIApplication.shared.delegate as! AppDelegate
            //  Case 2: With Xtoryboards, Xibs And NSCoder
            let rootController: FAPanelController = appDelegate.window?.rootViewController as! FAPanelController
            _ = rootController.center(centerNavVC).left(leftMenuVC)
            //  For Case 1 only
            appDelegate.window?.rootViewController = rootController
    
    opened by venkateshaelegenie 0
  • It doesnt working Edge Tap Gesture.

    It doesnt working Edge Tap Gesture.

    I see working Edge Tap Gesture function attached your image. So I was runing this function in iphone SE simulator working well. But I can t run this function in other simulator. What is the solution for this? many thanks

    opened by monnaleeza 0
  • Side Menu Not Updating Value While App Runing

    Side Menu Not Updating Value While App Runing

    When ever i change the profile image or username from profile section response successful and change the name on all place except on left side menu i replace the username text of UILabel in view did load of side menu

    opened by Sulemanali511 3
  • FAPanels Crash *Shuffled()*

    FAPanels Crash *Shuffled()*

    Application crashed due to shuffled function in boxFade and dumpFall animation.

    Generate Error: Multipleclick on table view row. It is increasing UIImageview in an array and it will generate a crash.

    TtGCs23_ContiguousArrayStorageCSo11UIImageView$ shuffled array

    bug 
    opened by PGandhi30 7
  • ViewDidLoad in leftview will cause bug

    ViewDidLoad in leftview will cause bug

    I have written following line in view did load method of left menu vc

             let indexPath = IndexPath(row: 0, section: 0);
                    self.tableView.selectRow(at: indexPath, animated: false, scrollPosition: UITableView.ScrollPosition.none)
                    self.tableView(self.tableView, didSelectRowAt: indexPath)
    
    

    Now Press on drawer not opening the left menu first time. and on second time no animation is coming

    and then after everything working as usual

    I have also tried the same thing in sample code

    opened by PrashantKT 0
Releases(0.1.0)
Owner
Fahid Attique
Fahid Attique
Slide Menu (Drawer) in Swift

AKSwiftSlideMenu Slide Menu (Drawer) in Swift 5.0 Why to use a library everytime? Let's create our own Slide Menu in Swift 5.0 I have uploaded a video

Ashish Kakkad 281 Jan 5, 2023
⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion

CIRCLE MENU Simple, elegant UI menu with a circular layout and material design animations We specialize in the designing and coding of custom UI for M

Ramotion 3.4k Dec 29, 2022
A simple side menu for iOS written in Swift.

ENSwiftSideMenu A lightweight flyover side menu component for iOS with the UIDynamic's bouncing animation, UIGestures and UIBlurEffect. Allows you to

Evgeny Nazarov 1.8k Dec 21, 2022
Interactive view transition to display menus with flowing and bouncing effects in Swift

FlowingMenu FlowingMenu provides an interactive transition manager to display menu with a flowing and bouncing effects. The Objective-C countepart is

Yannick Loriot 975 Dec 21, 2022
Our Guillotine Menu Transitioning Animation implemented in Swift reminds a bit of a notorious killing machine.

GuillotineMenu.swift Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS 8.0+ Xcode 10 Swift 5.0 (v 4.1+) Swi

Yalantis 2.9k Dec 13, 2022
iOS Interactive Side Menu written in Swift.

Interactive Side Menu A customizable, interactive, auto expanding and collapsing side menu for iOS written in Swift. Here are some of the ways Interac

Handsome 706 Dec 15, 2022
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

Yuji Hato 3.3k Dec 29, 2022
✨ Awesome Dropdown menu for iOS with Swift 5.0

The eligible dropdown menu for iOS, written in Swift 5, appears dropdown menu to display a view of related items when a user click on the dropdown menu. You can customize dropdown view whatever you like (e.g. UITableView, UICollectionView... etc)

Kyle Yi 1.3k Dec 26, 2022
A Swift implementation of RESideMenu

SSASideMenu is a reimplementation of romaonthego/RESideMenu in Swift. A iOS 7/8 style side menu with parallax effect. ###Usage func application(

Sebastian 600 Oct 16, 2022
RadialMenu is a custom control for providing a touch context menu (like iMessage recording in iOS 8) built with Swift & POP

RadialMenu Looking for help? For $150/hr I'll help with your RadialMenu problems including integrating it into your project. Email [email protected] t

Brad Jasper 297 Nov 27, 2022
A Slide Menu, written in Swift, inspired by Slide Menu Material Design

Swift-Slide-Menu (Material Design Inspired) A Slide Menu, written in Swift 2, inspired by Navigation Drawer on Material Design (inspired by Google Mat

Boisney Philippe 90 Oct 17, 2020
The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when a user clicks on the navigation title.

Introduction The elegant yet functional dropdown menu, written in Swift, appears underneath the navigation bar to display a list of defined items when

Tho Pham 2.7k Dec 28, 2022
ExpandingMenu is menu button for iOS written in Swift.

ExpandingMenu ExpandingMenu is written in Swift. Requirements iOS 8.0+ Xcode 10.0+ Swift 3.x+ Installation CocoaPods You can install CocoaPods with th

null 454 Dec 7, 2022
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift

Persei Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift! Made in Yalantis. Check this project on Dribbble Check th

Yalantis 3.4k Dec 14, 2022
A side menu controller written in Swift for iOS

Description SideMenuController is a custom container view controller written in Swift which will display the main content within a center panel and th

Teo 1.2k Dec 29, 2022
Hamburger Menu using Swift and iOS 8 API's

FrostedSidebar Hamburger Menu using Swift and iOS 8 API's Heavily influenced by @_ryannystrom's RNFrostedSidebar This implementation uses iOS 8's new

Evan Dekhayser 429 Oct 21, 2022
UIKit drop down menu, simple yet flexible and written in Swift

DropDownMenuKit DropDownMenuKit is a custom UIKit control to show a menu attached to the navigation bar or toolbar. The menu appears with a sliding an

Quentin Mathé 258 Dec 27, 2022
Menu controller with expandable item groups, custom position and appearance animation written with Swift. Similar to ActionSheet style of UIAlertController.

Easy to implement controller with expanding menu items. Design is very similar to iOS native ActionSheet presentation style of a UIAlertController. As

Anatoliy Voropay 22 Dec 27, 2022
Rotating circle menu written in Swift 3

Swift-CircleMenu A rotating circle menu written in Swift 3. Features Gesture based rotation Configurable rotatability High customisability Simple intu

Shoaib Ahmed 123 Jul 29, 2022