Skip to content
This repository has been archived by the owner on Jun 17, 2018. It is now read-only.

Custom Class #50

Closed
DanielSmith1239 opened this issue Jul 28, 2015 · 10 comments
Closed

Custom Class #50

DanielSmith1239 opened this issue Jul 28, 2015 · 10 comments

Comments

@DanielSmith1239
Copy link

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.

@kitasuke
Copy link
Owner

Hi,
It may be same case with #48 ?
Presenting only one custom view controller hasn't supported yet, but it will be fixed soon.

@DanielSmith1239
Copy link
Author

I added an additional view controller to test that out, and that was the problem. However, now I am experiencing another one. The selected tab moves to the side of the screen, not to the center. Also, How do I make the menu's appearance not opaque?
I am extremely close to completing my app, and this is the final component I need to complete before submitting it, so I would appreciate it if you could help me ASAP. I understand that you are likely extremely busy, and I don't want to pressure you or anything. I really appreciate the help, and I will (of course) give you credit in my app's "About" section.

@kitasuke
Copy link
Owner

Could you give me all the options you set for PagingMenuOptions? Because it's much easier to find out the reason of the unexpected behaviour. Also it would be great if I could see its screenshots.

@DanielSmith1239
Copy link
Author

Here is my code for the options: let options = PagingMenuOptions()
options.menuHeight = 44
options.menuDisplayMode = PagingMenuOptions.MenuDisplayMode.FlexibleItemWidth(centerItem: true, scrollingMode: PagingMenuOptions.MenuScrollingMode.ScrollEnabledAndBouces)
options.textColor = UIColor.blackColor()
options.backgroundColor = UIColor(netHex: 0xFCFCFC)
options.menuItemMode = PagingMenuOptions.MenuItemMode.Underline(height: 2, color: UIColor(netHex:0x0066FF))

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

Also, I just realized that the selected tab centers (as it should) while running in the iOS simulator, but it doesn't center when on a physical device (see image below).
img_4979

@kitasuke
Copy link
Owner

Thanks for helpful info. Also could you tell me what version of PagingMenuController you are using?

@DanielSmith1239
Copy link
Author

I am using the version for swift 2.

@kitasuke
Copy link
Owner

I'm digging into more detail with your options and try to tell you what's wrong ASAP. Please wait a bit more.

FYI, since Xcode 7 is still beta, any project written in Swift 2.0 can not be submitted at this moment if I'm correct.

@DanielSmith1239
Copy link
Author

Thank you, I apreciate all of the help.

@kitasuke
Copy link
Owner

kitasuke commented Aug 2, 2015

The selected tab moves to the side of the screen, not to the center. Also, How do I make the menu's appearance not opaque?

I set same options as yours and it works fine on my device. I'll look into more detail and let you know if there is something wrong.
I didn't make it opaque. How do you think it's opaque?

@kitasuke
Copy link
Owner

kitasuke commented Oct 1, 2015

Please try the latest version and reopen this issue if there is still something wrong.

@kitasuke kitasuke closed this as completed Oct 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants