Giter Club home page Giter Club logo

interactivesidemenu's People

Contributors

alexkorovyansky avatar andreyarzhannikov avatar enmiller avatar okonor avatar otbivnoe avatar progn avatar sdbrown2 avatar sofbix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interactivesidemenu's Issues

White Screen While opening Side menu only in iphone 7 & 7 +

Hii Team ,

I have used your this control in my most recent work & it's working really nice except it goes blank or say white screen on iPhone 7 & 7+ while i open it from Left side button with didOpenMenu() function. i don't get it why it just happening only in this particular device only. please help me.
Thank you.

How to push ViewController?

When I try to push ViewController I got an error:

Could not cast value of type 'TestApp.HostViewController' (0x106c025f0) to 'UINavigationController' (0x10b3763c8).
(lldb)

My code:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let destinationViewController = storyboard.instantiateViewController(withIdentifier: "MarketShowViewController") as! MarketShowViewController
let navigationController = UIApplication.shared.windows.first?.rootViewController as! UINavigationController
navigationController.pushViewController(destinationViewController, animated: true)

Status bar vanishes when loading a menu item inside a navigation controller

When I create my menu item controllers, I embed them in navigation controllers.

e.g.

let text = TextViewController(textView: TextView.init(frame: UIScreen.main.bounds), pageID: page.pageid) let navigationController = UINavigationController(rootViewController: text) contentList.append(navigationController)

Issue is when I click one of these items, it loads, but the status bar vanishes and just leaves a black box.

How can i get the behaviour to work as expected and retain the status bar which then takes on the background colour of the navigation bar, as it would do outside of the side menu encapsulation

Lots of errors

I tried to add the pod by pod install. But when I open my porject I get the following errors:

screen shot 2017-09-28 at 19 03 35

showSideMenu() not working in UIViewController

if present storyboard in UIViewController showSideMenu() not working

let presentAA = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "AA") as! AAViewController
        self.present(presentAA, animated: false, completion: nil)

//not working 
func menu() {
        showSideMenu()
}

Adjusting Gesture Area for view?

How can i achieve a wider recognition area for the menu pull out? currently by default its on the very edge of the view and it would be good to have a slightly wider area available

RightSideMenu support?

how can i do right menu ?
and also if it possible to change with according to the app locale language

Status Bar not properly calculated into the menu

I don't know what the issue is here, but in my project the menu doesn't go under the status bar up to the top of the screen. As an example see this (you can see that where the menu ends the background is black):

simulator screen shot 31 08 2017 15 25 30

Open Again that Controller But its not Reload

when click on the side menu and click on the buttons first time it reload the Controller but if I Come again to that controller its not updated it show the last opening Thing how can I call reload the controller

add support to rtl for some language like persian & arabic

if there is possible add a feature so that we simply change layout while the language is Persian or arabic

the menu open from left side so after adding that feature we may open from right side based on language

because the menu in this language should open from right side

How to remove damping effect?

Hi, I want to remove the damping effect in the open and close animations. How can I only set curveEaseOut animation for both? Thanks

Storyboard to Nib

Hi i'm still new in IOS development. a quick question, is there anyway to implement this into Nib? Since most of my modules I'm using Nib, so for me to implement this using storyboard very confusing for me. Thank you.

Button constraints are corrupt on iPad / button is moving when closing MenuViewController

Hey,

I am having some trouble with InteractiveSideMenu.
I tried to use the framework for iPad running iOS 11, but there seems to be a problem; the first time I close the side-menu, my button moves about 20px to the top.
I attached some pictures of it. I am using the same constraints as in your official Sample project.

The console output:

[LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x600000280550 UILayoutGuide:0x6000001b9360'UIViewSafeAreaLayoutGuide'.bottom == UITableView:0x7f8f3f823c00.bottom + 20   (active)>",
    "<NSLayoutConstraint:0x600000280730 UITableView:0x7f8f3f823c00.centerY == UIView:0x7f8f3f400ce0.centerY   (active)>",
    "<NSLayoutConstraint:0x600000280780 UITableView:0x7f8f3f823c00.top == UILayoutGuide:0x6000001b9360'UIViewSafeAreaLayoutGuide'.top   (active)>",
    "<NSLayoutConstraint:0x600000280640 'UIViewSafeAreaLayoutGuide-bottom' V:[UILayoutGuide:0x6000001b9360'UIViewSafeAreaLayoutGuide']-(0)-|   (active, names: '|':UIView:0x7f8f3f400ce0 )>",
    "<NSLayoutConstraint:0x6000002805a0 'UIViewSafeAreaLayoutGuide-top' V:|-(0)-[UILayoutGuide:0x6000001b9360'UIViewSafeAreaLayoutGuide']   (active, names: '|':UIView:0x7f8f3f400ce0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600000280730 UITableView:0x7f8f3f823c00.centerY == UIView:0x7f8f3f400ce0.centerY   (active)>

This might refer to #53 , but I am not sure.

bildschirmfoto 2017-11-30 um 21 16 25

bildschirmfoto 2017-11-30 um 21 17 20

bildschirmfoto 2017-11-30 um 21 17 27

bildschirmfoto 2017-11-30 um 21 17 33

Performance improvement & Memory consumption

Hey guys,

Thanks for the great library.
Currently contentViewControllers requires instantiated view controllers which could cause high memory usage specially with complex views. I tried to change it to array of StoryBoard identifiers and instantiate VC inside selectContentViewController() which resolves the allocation issue and I can see that previous views gets de-initialized successfully but now I am having a UI Performance issue and changing the SideMenuItemContent seems a bit slow.

Have you tried to fix the memory allocation issue in another way or do you have any suggestions that can improve the overall performance impact ?

Width of the menu not has full screen width

In my project the width of the menu view controller doesn't change to the visible size. Instead it just keeps the full size of the screen as you can see on the label which gets cut. Also I've attached the view debugger rendering of the same screen where you can see that there should actually even be a checkmark which is being overlapped by the content view though. How would I deal with that?

simulator screen shot 31 08 2017 15 25 30
bildschirmfoto 2017-08-31 um 15 33 23

UISplitViewController

Hi, can this library be used for UISplitViewController project? I am going to build UISplitViewController that has slide menu that will push to respective ViewController based on the menu selected on the side menu. Thanks!

Using SideMenu with a TabBarController?

I currently use sidemenu and it instantiates its controller tabs when it inits.

Issue is i want to use a tab bar controller inside my first view controller tab, which can quick link me to 3-4 other controllers that are also in the sidemenu.

What approach is needed architecturally to allow for the tab bar controller to instantiate its controllers without overlapping with those created by the sidemenu?

Thanks

White Screen when presenting hostViewController?

Following the example files, I have an issue where my view is blank white once I present the hostController, the ViewDidLoad is hit on both the menu and the home page (first VC in array) but there isnt anything visible.

From the below is the reason for this obvious? I push hostController with:

let hostViewController = HostViewController()
self.appDelegate.window?.rootViewController = hostViewController

Here is my setup code:

 class HostViewController: MenuContainerViewController {
    
    var manager = APIManager()
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    var sideMenuViewItems: [MenuItem] = [MenuItem]()
    
    override func viewWillAppear(_ animated: Bool) {
        getMenuItems(apiKey: appDelegate.apiKey, userID: appDelegate.userID, eventID: appDelegate.defaultEvent)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let screenSize: CGRect = UIScreen.main.bounds
        self.transitionOptions = TransitionOptions(duration: 0.4, visibleContentWidth: screenSize.width / 6)
        // Instantiate menu view controller by identifier
        self.menuViewController = NavigationMenuViewController(navigationMenuView: NavigationMenuView(frame: UIScreen.main.bounds))
        // Gather content items controllers
        contentViewControllers = contentControllers()
        // Select initial content controller. It's needed even if the first view controller should be selected.
        selectContentViewController(contentViewControllers.first!)
    }
    
    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransition(to: size, with: coordinator)
        // Options to customize menu transition animation.
        var options = TransitionOptions()
        // Animation duration
        options.duration = size.width < size.height ? 0.4 : 0.6
        // Part of item content remaining visible on right when menu is shown
        options.visibleContentWidth = size.width / 6
        self.transitionOptions = options
    }
    
    private func contentControllers() -> [UIViewController] {
        var contentList = [UIViewController]()
        let dashBoard = HomeScreenViewController(homeView: HomeScreenView.init(frame: UIScreen.main.bounds))
        contentList.append(dashBoard)
        let welcome = TextViewController(textView: TextView.init(frame: UIScreen.main.bounds))
        contentList.append(welcome)
        let agenda = AgendaViewController(agendaView: AgendaView.init(frame: UIScreen.main.bounds))
        contentList.append(agenda)
        let poll = PollsViewController(pollsView: PollsView.init(frame: UIScreen.main.bounds))
        contentList.append(poll)
        return contentList
    }
}

and my MenuViewController:

class NavigationMenuViewController: MenuViewController {
    
    var navigationMenuView: NavigationMenuView!
    var sideMenuViewItems: [MenuItem] = [MenuItem]()
    var manager = APIManager()
    let appDelegate = UIApplication.shared.delegate as! AppDelegate
    var apiKey: String?
    var user: User?
    var userID: String?
    var eventID: String?
    
    init(navigationMenuView: NavigationMenuView) {
        super.init(nibName: nil, bundle: nil)
        self.navigationMenuView = navigationMenuView
        self.view.addSubview(navigationMenuView)
        self.view.setNeedsUpdateConstraints()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewWillAppear(_ animated: Bool) {
        // remove nav bar from side menu
        self.navigationController?.setNavigationBarHidden(true, animated: animated)
        // pull app delegate values
        configureUserDetails()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        print("THE MENU VIEW WAS LOADED")
        // setup
        navigationMenuView.menuTable.register(MenuItemCell.self, forCellReuseIdentifier: "MenuItemCell")
        navigationMenuView.menuTable.selectRow(at: IndexPath(row: 0, section: 0), animated: false, scrollPosition: UITableViewScrollPosition.none)
    }
    
}

extension NavigationMenuViewController: UITableViewDelegate, UITableViewDataSource {
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.sideMenuViewItems.count
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 43
    }
    
    func numberOfSections(in tableView: UITableView) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        guard let menuContainerViewController = self.menuContainerViewController else {
            return
        }
        menuContainerViewController.selectContentViewController(menuContainerViewController.contentViewControllers[indexPath.row])
        menuContainerViewController.hideSideMenu()
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let menuItem = self.sideMenuViewItems[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "MenuItemCell", for: indexPath) as! MenuItemCell;
        // styling
        cell.backgroundColor = UIColor.clear
        cell.selectionStyle = UITableViewCellSelectionStyle.none
        // properties
        let imageURL = URL(string: menuItem.icon);
        cell.icon.af_setImage(withURL: imageURL!) // make safe
        cell.titleLabel.text = menuItem.title
        cell.titleLabel.textColor = UIColor.white
        cell.badgeLabel.text = menuItem.badgeCount
        // show/hide badge based on value
        if(menuItem.badgeCount == "" || menuItem.badgeCount == "0" || menuItem.badgeCount == nil) {
            cell.badgeView.alpha = 0;
        }
        else {
            cell.badgeView.alpha = 1;
        }
        return cell
    }
}

install through CocoaPods -> Use of unresolved identifier 'TransitionOptions'

Just installed it through CocoaPods. Set my UIViewController to conform to MenuContainerViewController. And this XCode error appears: Use of unresolved identifier 'TransitionOptions'. And i couldn't find implementation for this in InteractiveSideMenu Pod classes. transitionOptions property is missing too. I compared the class MenuContainerViewController from Pod and from example from GitHub and they seem different! Could you please help me what am doing wrong?
screen shot 2017-08-30 at 19 37 28

Cant find SideMenuItemContent and TransitionOptions in InteractiveSideMenu

I recently added InteractiveSideMenu through Cocoapods and I could not Set my UINavigationController protocol to SideMenuContent. And also to set the visible width I cannot see the TransitionOptions. Please Help!

I checked ChangeLogs and even forums, couldn't find any reference of anyone using it. Everyone uses the earlier version only. Even the changelog mentions use of TransitionOptions. How to go about it?

Preserving the state of a view controller if it is currently selected

I want to preserve the state of my view controller if it is currently selected because all the data in my Table View will be gone when I tap on the menu item.

How do I get the current selected VC?

guard let menuContainerViewController = self.menuContainerViewController else {
	return
}
	
if (self.view.superview! == menuContainerViewController.contentViewControllers[1]) {
		
	print("It is the current VC, do not selectContentViewController")
}
else {
		
	menuContainerViewController.selectContentViewController(menuContainerViewController.contentViewControllers[1])

}
menuContainerViewController.hideSideMenu()

Spring Animation parameters customization

On the main page, you've written that your menu supports "spring animation with params customization". On the same page at the example code, there is no a single word about how to do that. And when I'm looking into the "Sample Code" for more details, I see the very same example code that doesn't clarify spring customization.

I've looked into your source code and tried to do it in the same way, but it doesn't work because 'SpringParams' initializer is inaccessible due to 'internal' protection level.

I'm sorry if I get something wrong or missed something, but please, can you help me to deal with spring animation parameters customization?

MenuViewController subclass of UITableViewController

As of now it is not possible to subclass from UITableViewController for the MenuViewController. For example I've written the following class:

class MyMenuViewController: UITableViewController {
    // some logic
}

Now I would like to use this framework. The README states I just need to make MyMenuViewController a subclass of MenuViewController which doesn't work though as I need to subclass UITableViewController and MenuViewController is just a UIViewController subclass.

Using with tabbar

Hello i have one tabbar and navigation bar for each item inside tabbar.

var contentList = [MenuItemContentViewController]()
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let tabbarVC = storyboard.instantiateViewController(withIdentifier: "TabBarViewController") as! TabBarViewController
contentList.append(tabbarVC as MenuItemContentViewController)

I am trying to add tabbar but it gives me an error. Do you know how can i use with tabbar ?

Creating Menu without instantiating controllers?

I wondered if there is an approach to using the side menu in which I dont need to create an array of viewControllers straight away?

Its becoming an issue with the nature of my app to have an array of initialised viewControllers stored for the menu, rather than the approach ive seen elsewhere where the controllers are created on tap on the side menu cell via a switch statement on the item.

Any advice on this?

coco pod not working

When installing pod I get the error "Unable to find a specification for InteractiveSlideMenu"

How can showmenu inside of navigation page ?

Hi,

I have 5 pages inside side menu..
One of that is HomePage.

My flow is like this.

HomePage (tableview) >> CategoryPage

Now From this category page when click button for showmenu getting error like bellow
Could not cast value of type 'UINavigationController' (0x2ee9244) to 'InteractiveSideMenu.MenuContainerViewController' (0x544ab0).

Kindly provide solution for this.

Navigation Controller in side menu

Adding Navigation Controller As menu item do not show menu, i have three controller embedded in respective navigation controller as root view and i have added menu as bar button item, showSideMenu() method is being called but menu is not shown.

Row Current Selection like in the demo gif?

I wondered if there was the ability to add the custom row selection as seen in your demo gif on the home page? I wanted a colour block or something to indicate the currently visible viewController in the side menu. Not sure if this is a feature of the api or if this is handled in the tableview delegate methods?

have a navigationviewcontroller support ?

i want to use navigationviewcontroller on my one of view controller instantiate from your api but i getting this error.
Could not cast value of type 'Mosyo.EntriesController' to 'UINavigationController'

let nav = segue.destination as! UINavigationController
let productListController = nav.topViewController as! EntriesController
      
let cell = sender as! UICollectionViewCell
let indexPath = self.collectionView!.indexPath(for: cell)

how can i fix this ?

thanks.

Rotation

Possible to disable rotation on all the sub pages except 1?
I've tried many of the solutions on SO, for NavBar UI, but they don't seem to work with this.

Thanks,
Dave

Content turns white when menu open

In your animation, it shows the content from an itemViewController when the menu is open. In your Sample app and in my implementation the content disappears and you can only see a blank white view controller off to the side. I'm probably missing something simple to maintain the itemViewController content after it animates to the right.

Edit: That was a worded poorly haha When we're looking at the Cat photo on the Sample App and we open the menu....why does the cat photo disappear? Is it possible to keep the cat photo when the menu is open?

Unnecessary property `contentViewControllers`?

What's the point in setting the property contentViewControllers? I don't see where it is being used in your code โ€“ I don't need a list of all content view controllers for my app, therefore I'm curious: What's the reason for including it and is it really needed as stated in the README? Couldn't we simplify this library a bit by removing it?

Menu Opening Up on Swipe But Not On Clicking Button

I am trying to open the Side Menu by clicking a button, but the menu isn't opening . I am using the showSideMenu() function, and also have the SideMenuItemContent Delegate present ,but the side view isn't coming .

UINavigationBar resizing issue - iOS11, Swift 3, Xcode9

Hello guys, first off very nice library!

Intro

  • Xcode 9 GM
  • Swift 3.2
  • iOS 11
  • Simulator and device

Issue

If we embed UINavigationController as child view to MenuContainerViewController on iOS11, there is an issue with UINavigationBar height, when closing the side menu. When interaction starts, UINavigationBar will resize itself from the top to the size that will be 20pt less then the size of child view, so you will be able to see the view behind.

This can be only seen on iOS11. I tried various stuff to fix it but without much success. If we hide navigation bar, or if the status bar is hidden, the issue will disappear.

I'm also attaching a project so that you can check it out.

InteractiveSideMenu-Issue.zip

Lateral menu cover current view

Hi!
I have a lateral menu on the left side of my screen. Right now, when I tap the menu button, the lateral menu comes from the left side and pushes my current view to the right.
I was wondering if it's possible to have the lateral menu covers my current view instead of pushing to the right. Also, if it isn't, is there any workaround that I can do to achieve that?

Thanks a lot!
And thanks for this great library too!

Switching side menu to right side?

Is there a simple method to change the menu to come from screen right rather than screen left?

I need it to be inverted to the default method

Cheers

showSideMenu() no response

In SideMenuItemContent added this code:

func openMenu() {
    showSideMenu()
}

and:

menuButton.addTarget(self, action: #selector(openMenu), for: .touchUpInside)

But when I click the button there is no response.

What does `SideMenuItemContent` do?

Really, again when starting to use this library in my app I can't see why I need to conform to the SideMenuItemContent protocol im my view controllers? Is it only a hint so people don't forget they have to call showSideMenu() somewhere? Cause I can't find how view controllers that conform to that protocol are used within this library ... if it's only a reminder, why not solve it via docs?

I mean you could simplify the library and the docs again by simply saying: If you want to show the side bar, simply call showSideMenu(). The one thing that would really help would be some kind of helper which allows access to the method from everywhere like the following (which is actually a helper I have written so I don't have to mess with all the stuff in different files but use one file with a quite understandable API instead):

import UIKit
import InteractiveSideMenu

class MenuHelper {
    // MARK: - Stored Type Properties
    static let shared = MenuHelper()

    // MARK: - Stored Instance Properties
    let menuViewCtrl = MenuContainerViewController()

    // MARK: - Instance Methods
    func setMenuViewController(_ menuViewController: MenuViewController) {
        menuViewCtrl.menuViewController = menuViewController
    }

    func showContentViewController(_ contentViewController: UIViewController) {
        menuViewCtrl.selectContentViewController(contentViewController)
    }

    func openMenu() {
        menuViewCtrl.showSideMenu()
    }

    func closeMenu() {
        menuViewCtrl.hideSideMenu()
    }
}

side menu on tabbar only I am facing problem

Hello

My home viewcontroller has tab bar when I try to push any viewcontroller from side menu then tab bar is getting hidden or not able to see.

I am new to swift and just for practice I am tried to implement this.

here you can find my repository if you want to know what I have done.

Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.