Coder Social home page Coder Social logo

Comments (19)

xissburg avatar xissburg commented on June 19, 2024

I am gonna add a demo of this feature in the samples app as soon as possible.

Anyway, this can be achieved through the XBPageCurlView, but there are some stuff yet to be implemented.

from xbpagecurl.

paraboul avatar paraboul commented on June 19, 2024

Hey,

Any update on this?

Thanks :)

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Hi, sorry for the delay.. I started to implement this but didn't commit anything yet. Been busy. I will try to continue to work on this feature this week.

from xbpagecurl.

paraboul avatar paraboul commented on June 19, 2024

Awesome. Thanks

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

I currently have the first working version in the branch "flip". I will continue to work on it to improve the API (suggestions are welcome) and I still have to implement correct dragging while the cylinder is snapped to another point.

The PageCurlViewController is the sample that uses this feature in a MapView. The process to make your view behave like that is quite manual yet. First you have to create a XBPageCurlView, configure it, add is as subview on top of the view you want to curl (add it to the superview of that one) and set it as hidden. Enable snapping and add some snapping points so that the cylinder will stick to them when the user releases his finger off the screen.

You also need another view that will act as a button that will start the curling (like in Google Maps for the iPad, where the "button" is the curled corner of the view on the bottom right of the screen). In the first touch, since the pageCurlView is hidden, we have to start to delegate the touches to it, hence you have to implement the touches* methods. In touchesBegan:withEvent: you also have to setup the pageCurlView for display and start its rendering loop.

One more thing that must be done is to implement XBPageCurlViewDelegate to be notified about snapping to the snapping point located at the bottom right which should stop the curlView and hide it and show the original mapView.

It's quite a lot of things to do to get this working yet :) . API suggestions are welcome.

from xbpagecurl.

paraboul avatar paraboul commented on June 19, 2024

Hey,

Thanks, let me give it a try. I keep you in touch (no pun intented) ;)

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Hey I'm facing same issue, can't seem to figure out how to link the the finger touches to the curled page, all I managed to do is to put the curlView method in touchesEnded and it will curl the page to the position of the finger when touches ends, but if i put the method in touchesMoved, I will get a very odd behavior for it will try each time to curl a new page to the position of the finger, and it ends up curling the front View plus a bunch of shadows and it will not move with the finger.
I have another issue, since i'm working with epubs, I need to use a webview to display the content, and touchesBegan, touchesMoved and touchesEnded do not respond to the touches on the webview.
your help will be highly appreciated,
thank u in advance

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

I had an idea for a simpler solution to this. I will try to crank it up today.

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Hey,

I have implemented that idea finally. There's a new sample called Page Curl that shows how to use the new feature. Basically, create an instance of XBPageDragView, place it somewhere (you can add any subviews into it) on your main view, set its viewToCurl property (it's an IBOutlet so you can link it in InterfaceBuilder), and you're all set already. Have a look in PageCurlViewController.* and PageCurlViewController_iPhone.xib to see how I did it. Quite simple. HTH

x

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Thank u, I truly appreciate it, I hope it works on webview I will try it right away.

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Its working perfectly thank u very much, just one tiny little problem, the dragging doesn't work on ipad1, same for simpleCurl, the animation of curling doesn't show on ipad1, it only works on ipad2 & 3 :s
Any idea why?
Anyway thk u again for ur efforts.

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Unfortunately I don't have an iPad 1 to test it here. Can you give more detail about what does not work? Error messages? Chashes? Have you tried debugging it to find the source of the problem?

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

The problem is that XPageCurlView andXPageDragView don't show, for instance, in simple curl, when i click on curl button I directly see the backView, (no animation or curling occur) no clashes or errors shows in the console. When I click uncurl I'll see the front page back but again without any curling or any animation.
Thank u for ur assistance.

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Hy again, is it possible to make the curl in the opposite direction for arabic books as well?
thank u in advance,

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Well since I don't have an iPad 1 I can't reproduce this problem. If you could look further into it, you cant ix it and submit a pull request :)

Yea, I did not make the XBPageDragView flexible there yet. It must allow you to set the initial cylinder state so that you can drag from any direction. I will look into this later.

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Hy there, no prob, I had it tested on another ipad1 the prob didn't occur, so I guess its only that device.
I'm currently integrating the curl effect to my program, it works but the prob is: in CATransition only a layer of the view gets removed but in the curl effect you implemented the whole view gets removed, I'm currently trying to make some changes to make it work. Any advice would be appreciated, hope things work with the initial cylinder state.
Thank u again for ur assistance,

from xbpagecurl.

coder4567 avatar coder4567 commented on June 19, 2024

Oh its fine I worked that out, Instead of hiding the curlView I update it and send to back. so no prob.

from xbpagecurl.

xjrad avatar xjrad commented on June 19, 2024

hi there,i download you latest code,it's works great.you'are amazing.

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Ok. I suggest you open a new issue for the page dragging direction thing.

from xbpagecurl.

Related Issues (20)

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.