How to implement a corner page curl UI? - iphone

I have an app with two full-screen views, one on top of the other. I would like to show the corner of the top view curled slightly away, and allow the user to curl it away more until the view underneath is completely showing.
The user should be able to interact with whatever part of the view underneath is exposed, and with whatever part of the view above is exposed.
I'd especially like this to look and feel like the page turn curling in iBooks. I've done a lot of searching about the iBooks page curl, but not much turns up. There's a great OpenGL implementation, but I don't know how to get from there to here. Any ideas?

A much simpler to implement, and therefore simpler visually approach is available here: http://github.com/brow/leaves
You may have a bit more success starting small.

Related

xCode, Swift: working with vs. working without storyboard

I'm new to programming apps, trying to realize a project for iOs using xCode and swift.
As far as I've learned most people seem to work with the storyboard feature, but I've come across people that suggest to deactivate the storyboard and work with code only.
I'd like to know your opinion on what method fits my needs best for the intended project. As I am just getting started, I'd like to stick with the appropriate method right away for I'm probably going to invest a lot of time.
This is about what the app is going to look like:
myApp Layout
Now this is what it' basically supposed to do:
The "settings"-button (blue area, top left) is going to take you to a different view to set preferences. The "search"-button (blue area, top right) is going to change the title into a search field.
You can browse through 3 categories. Each of them contains a couple of questions. Those are stored in a database and are supposed to be displayed list style within the red area. The order of the questions is going to depend on the users preferences.
Clicking any of the questions is going to take you to another view that displays the answer. When viewing the answer the "settings"-button (blue area, top left) is changing to a "go back"-button.
Now as far as I've learned the blue area might be realized with a navigation controller, navigation bar.
The white section works pretty much like a toolbar. However I've read it's close to impossible to move the standard toolbar from the bottom to the top.
I've seen tutorials of people realizing this type of layout with (to me) complex code but without using the storyboard. Am I wasting time on figuring out how to manipulate storyboard objects? Coming from coding and programming websites the project looks so unbelievably simple. Is a project like this in fact rather complex to do as an app?
In any big project you will have to use all approaches, it is all about experience. For example, I am using StoryBoards to make 95% of my UIViewControllers elements, using XIB for static screens like error messages, some loadings etc. and using code to append some gradient views, shadows etc. It is possible that in future I will be doing all in a different way. But if you are a beginner - better use Storyboard, it makes getting into all of it much easier, understanding UIKit and iOS development overall.

UIPageViewController curling effect required in iOS-4 [duplicate]

I am trying to switch between UIViews by making it look like you are turning a page in a book.
The UIViewAnimationTransitionCurlUp is pretty close if I could get it to curl toward the Left or Right. Is this possible?
I have tried to use the CATRansition but none of the animation types come close to a page turning.
Any suggestions on how to create this page animation transition that would turn a page toward the left or right?
Edit (June 2012) : It is now possible to use the native Apple implementation, check:
Page View Controller: Note that this is available since iOS 5.0.
Also check this other libs/methods:
Leaves: Not so realistic, but really easy to use.
PageCurl: Really nice effect, easy to use.
Implementing iBooks page curling using a conical deformation algorithm: Amazing, but it's just a proof of concept, difficult to expand.
There's nothing in the SDK that will do this for you. If you want this effect, you'll have to roll your own. "Classics" does a nice job with the page-flip animation.
You can manage this effect by changing the orientation of the UIViewController where the animation takes place.

Is Instagram's Feed View based on UIWebView or UITableView?

It looks like UIWebView, but how do they implement that download progress bar and the section bar(very smooth scroll)...?
I have snooped around their logs, and I cannot guarantee that if the feed itself is a UIWebView, but it just so happened that when I went to the feed, a log message came up saying: "WebView loaded". This hints that they use a UIWebView for their feed.
I decided to do some research, and it seems I am not the only one who thinks that they might be using a UIWebView
http://www.lukew.com/ff/entry.asp?1499
If they are using a UIWebView, you should be able to easily identify its traffic in a proxy such as Charles or sniffing all network traffic using Wireshark.
After putting Instagram though Charles, I see that its calling http://instagram.com/api/v1/feed/popular/ which returns a set of JSON results. This leads me to believe it is definitely not a UIWebView and something created in native code (almost certainly a UITableView. As Andrew mentioned, the username UI elements behave exactly like UITableView section headers on a plain-style table.
I would say it is almost definitly a UITableView. Here's why I think this.
The profile picture of the poster is shown at the top while scrolling in the exact same manner that a UITableView shows section headers. (As I see you already noticed)
There is a slight delay when loading the next cell.
The scrolling is pretty smooth, but it would be smoother with continuous view (though it would take much more memory and the page would take longer to load).
What they probably do is pull information from the server and cache it in Core Data. They populate the table from this until you click refresh or close and open the app, at which point they reload the data and refresh the page. This includes comments, likes, descriptions and images.
The rest of it is choosing the right drawing methods to make the UITableViewCells as performant as possible. I won't go into this here, but there is a lot you can do to make the scrolling smooth.
#Neo
I've experienced the same gateway error as the screenshot from this article:
http://kennethormandy.com/journal/your-favourite-app-isnt-native
Safe to say their using UIWebView?
The way Instagram does this has been meticulously optimized, so what I'm about to say hardly scratches the surface of all of the methods they used to make their feed work.
They start by checking for a cache, and if one is not present, they call to server. Server returns the first meta of objects, which are cached/stored to disk.
Then they pre-allocate the height of the cell based on number & size of comments.
Now they setup their IB & UI methods, and everything (for the most part) executes normally.
The only other main thing is that they use pagination. So they're caching/saving to disk with each pagination.
Again, this is just the surface. There are a ton of hacks implemented into the feed in order to make it work so well. If you are planning to replicate this with a very similar model (content, comments, profile images, etc), it's going to take you some time to get it right.

Creating a tableview in the form of a 'film strip'

I am developing an RSS-reader-type application. I am toying with the possibility of using a normal TableView application but showing the articles as a film-strip. I am mainly thinking for an iPad application (but possible it works on the smaller iPhone as well).
The idea is to have the cells passing/scrolling across the screen using swipe touches (but horizontal, and not vertical as with the normal TableView). They will be some-kind of miniatures of the full article, and when tapped (or with multi-touch zoom to have better control) can be enlarged to read. Then can then just be be moved on as soon as the user has seen enough of it.
Does anybody know if there is an easy way of accomplishing something like that?
The most obvious solution that springs to mind would be to use a UIScrollView, as this will provide the inertial effects, etc. for free - all you'd have to do it populate it with the relevant sub-views. (UITableView's actually use a UIScrollView.)
For more information and sample code, see Apple's UIScrollView docs.
If you want horizontal scrolling, take a look at Jeremy Tregunna’s JScrollingRow. It’s open source under a public domain licence.

Paging view within a productivity App navigation hierarchy

The Apple UI design guide suggests that a UIPageControl is ideal for presenting the top view of a utility app.
Would a paging view that appears at the 2nd or 3rd level down inside the main UINavigationController view trigger a fail during the App review process?
In my App I have inserted a 3 page view at the second navigation level down in my productivity style app. Each page presents a question and requires an answer that might by a multichoice tick or text box entry. The questions could be stacked vertically in a multi-section table but in my prototype flicking through the questions horizontally feels very natural.
However I have not seen an App store program that uses paging as I have.
I asked Apple a similar question recently and got back:
"Thank you for contacting the iPhone Developer Program. Apple is not able to provide pre-approval to developers for proposed application submissions."
In the end it really depends on the reviewer, the specifics of your app, full moon, etc.
Personally, I would simply try it. If the interface looks good and you think it will not confuse users, then just submit it.
Also, being rejected for stuff like that is not the end of the world. You just have to replace it with something similar. Happened to me once or twice. It is usually not a complete blocker.
Although you will probably not fail app review, I believe using a UIPageControl may be confusing to your users. As you pointed out, I can't think of any apps using the UIPageControl in this manner. The following quote from the iPhone Human Interface Guidelines is informative:
A page indicator gives users a quick
way to see how many views are open and
an indication of the order in which
they were opened; it does not help
users keep track of the steps they
took through a hierarchy of views.
Because the views in a utility
application tend to be peers of each
other, a page indicator is sufficient
to help users navigate through them. A
productivity application that displays
hierarchical information, on the other
hand, should offer navigation through
the elements in the navigation bar
(for more on this, see “Navigation
Bars”).
From your description of how this portion of your app is supposed to display, it doesn't sound like these pages with questions on them would be considered 'multiple views'. In addition, you probably want your users to answer each question sequentially and move on to the next. The UIPageControl is designed so that a user can switch between any of the views in any order they choose, not only in one direction.
This sounds much more like a hierarchical design, and this portion of your app would probably work a lot better if you used a navigation bar along with a UITableView. Requiring your users to answer a question by tapping a multichoice tick box, and then make them figure out that they need to swipe in a certain direction to get to the next question would not be obvious to a user, and could be much more intuitive. For example, as soon as the user selects a tick box, you could just programmatically navigate to the next question. Or, have a button at the bottom of each screen that's labelled "Next Question", which would transition to the next screen.
Hope this helps!