Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems initializing when XBPageDragView is used in a StoryBoard #36

Open
marcpalmer opened this issue Jan 13, 2013 · 4 comments
Open
Labels

Comments

@marcpalmer
Copy link
Contributor

Hi,

I'm pretty new to this, but I found that I couldn't get XBPageDragView to init properly when referenced from my root viewcontroller's view in the app storyboard. The problem was that when the NIB loader calls setViewToCurl, the frame of the viewToCurl has not yet been set (perhaps this is because I'm using auto layout?).

I managed to establish that calling refreshPageCurlView from viewDidAppear will work around this, but we do then have a bunch of false init where the frame is 0,0,0,0 and hence the OGL framebuffer inits fail.

It still works, but I'm thinking that the setter for viewToCurl should not be calling refreshPageCurlView and we should be doing this from somewhere else instead.

@xissburg
Copy link
Owner

That might be because of auto layout since I didn't face this issue and I also didn't test it with auto layout before. What I think that should be done is to recreate the mesh in -[XBCurlView layoutSubviews] if the size changes, and the frame buffer and the mesh should not be created if the size is zero. layoutSubviews must be called after the view gets its actual size then this should work.

@marcpalmer
Copy link
Contributor Author

Ok good tip, I will try it and let you know

@xissburg
Copy link
Owner

@matt-curtis as marc mentioned in his first post, you should call refreshPageCurlView in viewDidAppear, until this thing gets fixed ;)

@matt-curtis
Copy link

Ah, OK. I'd switched to XIB (I had no reason to use a Storyboard anyway) but thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants