Giter Site home page Giter Site logo

pagingmenucontroller's People

Contributors

alexcurylo avatar chien avatar fabianpimminger avatar guoxweii avatar ikesyo avatar kayvink avatar kitasuke avatar ktanaka117 avatar newbdez33 avatar pableiros avatar patricks avatar spsammy avatar t avatar tranminhdtd avatar wwwjfy 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  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

pagingmenucontroller's Issues

Can you add the transition animation for the menu items when they are switched?

I think you can add a transition animation effect for the menu items when user slide the page slowly. The current design is only to determine whether a page is swiped over half of screen and then switch the menu and fire the underline animation. What I mean is to synchronise to animations for menus and sliding page.

Like the navigation bar, when you slide the detail page to root page, the bar will be changed according how much displacement of the sliding page.

Sorry, very poor expression. I hope you can understand.

Public Read Only Properties

Some properties could be for public access:

   // I might want to access a view controller through the index
    private(set) var pagingViewControllers = [UIViewController]() 

    private(set) var menuView: MenuView!
    private(set) var visiblePagingViewControllers = [UIViewController]()
    private(set) var currentPage: Int = 0
    private(set) var currentViewController: UIViewController!

The PagingMenuControllerDelegate protocol should inform the index and view controller which is being displayed.

validateDefaultPage crash with single ViewController

When using public func setup(#viewControllers: [UIViewController], options: PagingMenuOptions) to update after a view controller was deleted, and at that time the previous currentPage was the last page in the array, the app crashes on the following function in PagingMenuController.swift:

func moveToMenuPage(page: Int, animated: Bool)

Cause: page is out of bounds

Proposed fix:
In setup() put currentPage = self.options.defaultPage directly after self.options.menuItemCount = pagingViewControllers.count the page value will now be the default value, which can be set before updating.

CollectionView ReloadData bug for PagingMenuTitle

The steps to reproduce this error is the same as #102

My problem: When I click on an image which is on another view controller to view it and then exit back to the main view controller which contains the PagingMenuController, the area around the title refreshes itself.

What I expect: I think it shouldn't be refreshed like the image issue which was previously fixed.

User interaction disabled at random times

Hello. At random times, when I try to slide left/right or up/down (it is a UIWebView), it does't detect the gesture and doesn't scroll through he pager controller/scroll up/down the web view. Thanks again for all of the help.

Attach the PagingMenu within titleView

I'm still a newbie in iOS development and swift.

Just wondering is any suggestions if I want the PagingManu on navigation's titleView rather than in the subview?

I try to follow on the PagingMenuControllerDemo, and change the following codes (In the viewController class)

\\ view.addSubview(pagingMenuController.view)
self.navigationItem.titleView = pagingMenuController.view

once I ran the code, Xcode shows me:

'child view controller:<PagingMenuController.PagingMenuController: 0x7fa2661264a0> 
should have parent view controller:<UINavigationController: 0x7fa264818400> 
but actual parent is:<ModelApp.ViewController: 0x7fa26630b3b0>'

It looks like the PagingMenuController should be the child of the NavigationController because I put the segmented control inside the Nav Bar, but it still child of the ViewController. Am I miss some pref or done something wrong?

If I use the code in the demo in NavigationController (I create a new NavController attach to the Navigator), but it won't work (Ofc it won't)

Any advices will be great help, thanks

add image?

Is it possible to use an icon instead of text?

How to reset tabs on orientation change at run time

1- Tabs are showing fine on load, but when I change the orientation tabs not gonna set automatically, but when I tap on any tab, then view will be fine.

I was using PageMenu , in this library I handled the rotation with bellow code

  // Handler for view moved(up/down) before orientatin change
    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
        self.controllerArray[0].viewWillTransitionToSize(size, withTransitionCoordinator: coordinator);
    }

but I am facing an issue with that library too & they are not replying :(

2-First tab not showing auto selected even I used below code

let options = PagingMenuOptions()
options.defaultPage = 0

but it works when I tap on any tab

centerItem value being ignored on device

The centerItem value is being ignored (always true) on the device (Simulator works fine).

Add the following menuDisplayMode option to the Demo project to test it:

options.menuDisplayMode = PagingMenuOptions.MenuDisplayMode.FlexibleItemWidth(centerItem: false, scrollingMode: PagingMenuOptions.MenuScrollingMode.ScrollEnabledAndBouces)

Crash when menuItemViews.count == 1

My app crashes if I run the PagingMenuController with only one viewController

I have tracked the bug down to contentOffsetXForCurrentPage in MenuView.

menuItemViews.count is 1
nextIndex is 0
menuItemViews.count - 1 is 0
let ratio = nextIndex / menuItemViews.count - 1 is 0 / 0 which returns nan

Here is the error log:
2015-07-27 13:36:34.350 Authenticator[94857:984290] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan 0; 375 60]'

MenuView disappear

I am using the latest version 0.45 and integrate the PagingMenuController to my test project.

Following is my code to add the PagingMenuController to my view controller. And I found that the menu is disappear.
let viewController1 = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController1") as! ViewController1
viewController1.title = "Menu 1"

    let viewController2 = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController2") as! ViewController2
    viewController2.title = "Menu 2"

    let viewController3 = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController3") as! ViewController3
    viewController3.title = "Menu 3"

    let viewControllers = [viewController1, viewController2, viewController3]

    let options = PagingMenuOptions()
    options.menuDisplayMode = PagingMenuOptions.MenuDisplayMode.SegmentedControl

    let pagingMenuController = self.childViewControllers.first as! PagingMenuController
    pagingMenuController.delegate = self
    pagingMenuController.setup(viewControllers: viewControllers, options: options)

screen shot 2015-08-16 at 1 41 54 pm

Custom Class

Hello,
I am trying to present a custom view controller in the pager controller, but I keep getting the following error printed:
2015-07-28 00:37:36.056 YidKit[529:59574] Attempt to add this NSLayoutConstraint to an engine in which it already exists. This can cause engine corruption. Break on void _NSLayoutConstraintRedundantAdd() to debug. This will be logged only once. This may break in the future.
2015-07-28 00:37:36.061 YidKit[529:59574] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan 0; 375 50]'
*** First throw call stack:
(0x1839844d0 0x198303f9c 0x183984418 0x188808668 0x188808508 0x18903df44 0x18904c11c 0x18900d19c 0x100176a34 0x1001308b4 0x1890261c8 0x189025f50 0x100172bd0 0x10016e400 0x100167dcc 0x100167e00 0x188feb0ac 0x1888125b4 0x18880d1c0 0x1890014e4 0x10016d61c 0x1001681c0 0x100192668 0x1001926c8 0x188fef504 0x189007458 0x18919ae70 0x1890aaf4c 0x1890aac28 0x1890aab90 0x188feb070 0x1888125b4 0x18880d1c0 0x18880d080 0x18880c71c 0x18880c470 0x188fe13ac 0x18393b3f8 0x18393919c 0x1839395cc 0x183869280 0x18e9e00cc 0x189056df8 0x10013655c 0x198b468b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Thank you for the help.

Adding / deleting pages

It would be great to have something like

insertPageAtIndex(_:withPageAnimation:)

and

deletePageAtIndex(_:withPageAnimation:)

in case the amount of pages is not constant.

Disable menu item

Hello, @kitasuke! You've made a great job!
I have to disable the last menuItem in pagingMenuController. Is there an ability to disable the last menuItem? I've created pageMenu with three pages (screenshot) but the last one should be disabled for future work. Also, is there an ability to disable user swipe to the last page? Or where I should modify the code to make it work?
Thanks a lot!

MenuView disappears when changing to single View Controller

When one of two view controllers is deleted, the MenuItemView moves to the left and loses it's horizontal line. Currently deleting the page like so:

internal func didDeleteAccount(index: Int) {

   viewControllers.removeAtIndex(index)
   pagingMenuOptions.defaultPage = viewControllers.count / 2
   pagingMenuController.setup(viewControllers: viewControllers, options: pagingMenuOptions)


}

From this
screen shot 2015-08-05 at 17 24 01

To this

screen shot 2015-08-05 at 17 23 43

centerItem is still set to true but I think it probably happens because it gets confused what to center?

Any thoughts?

fatal error: unexpectedly found nil while unwrapping an Optional value

I installed the PagingViewMenu through CocoaPods and followed the instructions, but overtime I build and run the program I get the "fatal error: unexpectedly found nil while unwrapping an Optional value" and it points to line 40 "self.menuView.moveToMenu(page: currentPage, animated: false)" in PagingMenuController. How do I fix this issue?

How do I lazy-load pages tabs?

I have this issue with my app which I have about 5 pages in a View Controller.

Each of them parses a respective JSON file from the web on startup, this takes a long time for my app to load because it's trying to load at least 2 pages at once when I tested the app.

Is it possible for me to lazy-load the other pages or to choose when to load to the other view controllers beside the current view controller on the screen?

Selected label font is not updated

Hello,

Setting selectedFont in PagingMenuOptions has no effect. I think it's an issue with titleLabelFont property not being used in focusLabel method of MenuItemView.

Thanks for this great control,
Paul

Touch not recognised when only one view controller

There is a tap recogniser on on of my view controllers, it works fine when there are multiple but when there are only one it stops working. touchesBegan is not being registered at all any more. In the 3D debugger I found the contentView becomes 0px wide when there is only one VC, I suspect the problem is caused somewhere in the auto layout.

I think it stops registering touches because the View in theory doesn't exist. If you look at the images I've added one has the view coloured blue, the other one only has a blue line.

screen shot 2015-08-27 at 18 06 42

screen shot 2015-08-27 at 18 07 36

Positioning MenuView Subview

Is there an easy way to move the MenuView to the bottom of the associated container view, instead of the top where it currently displays? I've tried modifying the framework's vertical NSLayoutConstraint.constraintsWithVisualFormat for the layoutMenuView() function, but this resizes the entire container (I assume because the sizing of the container is based on the height of the menuContainer).

It looks like I will need to rewrite all of the sizing logic in PagingMenuController -- am I mistaken?

PageMenu Knock Off

This library is very much leaning on my library PageMenu, which is just not okay. From the naming to the customization options they are pretty much the same..

How to enable round rect view animation in the latest update 0.5.0?

I have just updated the 0.5.0 and tried to change the menuItemMode to options.menuItemMode = PagingMenuOptions.MenuItemMode.RoundRect(radius: 1, horizontalScale: 1, verticalScale: 1, selectedColor: UIColor.redColor()). There is no animation for the round rect transition. Do I need to configure other options?

Cannot load underlying module for PagingMenuController

I can't import PagingMenuController module into my project. It keeps giving me Cannot load underlying module in PagingMenuController. I install the module using Cocoapods pod "PagingMenuController" please help me out. What am I doing wrong?

CollectionView ReloadData bug

There's a bug with the usage of CollectionView and PagingMenuController with the reloading of the CollectionView affecting user experience.

Setup
Initial ViewController with a CollectionView
Second ViewController that shows an enlarged Image

Using JTSImageViewController to show enlarged image.

This issue can be replicated by showing the second VC and when it is dismissed, the CollectionView in the initial VC is reloaded

iOS 7.0 support

Why this framework does not support iOS 7.0? and circular system?

UI testing

  • Reduce future bugs
  • Maintain stable state easily

Carthage does not build version 4.6 of framework

Hi @kitasuke, not sure if you are aware but building PagingMenuController framework through carthage does not build 4.6 but instead the older version of the library. I had to switch to cocoa pods to build v4.6 of the swift_2.0 branch.

Scroll to top doesn't work on iPhone

When I touch in status bar, the scroll doesn't goes to top on iPhone. However, when I do the same thing on iPad, it works. I`m using collection views inside the PagingMenuController.

Do you have any idea?

Thanks

Is it possible to make the menu moving with scrolling views?

The existing design is adding menu on the top of the ContainerView(I used Storyboard). If the ContainerView is an UITableview or UICollectionView and when you scroll it, the menu is sticked at the top of the ContainerView. That mean the menu is outside the ContainerView.

Now I would like to make a view like the profile page in Instagram. There is a segment to switch 2 different views for your posts. However, when you scroll it, the whole page will move including the segment. It is possible to make the design like Instagram by using this library?

Background Color for RoundRect Mode

Hi,

thanks for making this component. I'm currently building an app where I would want to customize the background of the MenuView while using RoundRect items.

Example:

bildschirmfoto 2015-10-17 um 21 31 31

I've made the customization in a fork and would like to know if I should submit a pull request or if you are seeing any issues with colored backgrounds and RoundRect items?

fabianpimminger@5a25f76

Menu not showing when added programatically

Yesterday I implemented the PagingMenuController by copying the storyboard and working from your example, this worked perfectly fine. I'd rather do it programatically though, but the menu is not showing up now. Is there something I am missing?

my didFinishLaunchingWithOptions looks somethings like this

self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let containerViewController = ContainerViewController()
let navigationContoller = UINavigationController(rootViewController: containerViewController)
self.window!.rootViewController = navigationContoller
self.window!.makeKeyAndVisible()

Then later I configure the menu the same way as in the readMe

let viewController = UIViewController()
viewController.title = "First title"

let viewController2 = UIViewController()
viewController2.title = "Second title"

let viewControllers = [viewController, viewController2]

let options = PagingMenuOptions()
options.menuItemMargin = 5
options.menuHeight = 60
options.menuDisplayMode = PagingMenuOptions.MenuDisplayMode.SegmentedControl
let pagingMenuController = PagingMenuController(viewControllers: viewControllers, options: options)

self.addChildViewController(pagingMenuController)
self.view.addSubview(pagingMenuController.view)
pagingMenuController.didMoveToParentViewController(self)

The menu bar doesn't show but I can transition between VC's. What am I doing wrong?

Animation for the selected tab

Would you mind to add the animation changing the position of underline of the selected tabs? For the Obj-C library uacaps/PageMenu, there is an option called scrollAnimationDurationOnMenuItemTap that can control it. I hope you can add this animation effect to the library. Thanks.

NEED HELP - Attach the PagingMenu within titleView

I'm still a newbie in iOS development and swift.

Just wondering is any suggestions if I want the PagingManu on navigation's titleView rather than in the subview?

I try to follow on the PagingMenuControllerDemo, and change the following codes (In the viewController class)

\\ view.addSubview(pagingMenuController.view)
self.navigationItem.titleView = pagingMenuController.view

once I ran the code, Xcode shows me:

'child view controller:<PagingMenuController.PagingMenuController: 0x7fa2661264a0> 
should have parent view controller:<UINavigationController: 0x7fa264818400> 
but actual parent is:<ModelApp.ViewController: 0x7fa26630b3b0>'

It looks like the PagingMenuController should be the child of the NavigationController because I put the segmented control inside the Nav Bar, but it still child of the ViewController. Am I miss some pref or done something wrong?

If I use the code in the demo in NavigationController (I create a new NavController attach to the Navigator), but it won't work (Ofc it won't)

Any advices will be great help, thanks

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.