use of UIpageControl - iphone

Can any one explain what is the specific usage of UIPagecontrol in iPhone please.
I am using it for pagination in scroll view. Is there any other specific purpose for it???

Reading documentation for UIPageControl help you to understand uses of pagination.
Pagination, which automatically separates the content in your form into smaller groups of rendered content. When you use pagination, these groups of content are automatically formatted to fit the target device. The form also renders user interface (UI) elements that you can use to browse to other pages.
Here is the more simple explanation
http://www.smashingmagazine.com/2007/11/16/pagination-gallery-examples-and-good-practices/

You can know how many pages are there and also tapping on it ll navigate to next page.

Related

Flip from one ViewController to another iBooks Style

I'm trying to load in content from a database and allow the user to flip through it like pages, then at the end of the content, give them options to go to another section of content (probably with buttons). The content is currently just formatted with html, but how do I implement the buttons to navigate? I'm a little new to Xcode so maybe I'm not even looking in the right direction.
refer a this opensource: https://github.com/devindoty/iBooks-Flip-Animation
this is very little code and perfectly works.

Limit number of tablecells to be displayed

I am trying to do something like what FaceBook has done. Whereby it limits the number of cells it display. If the user would like to more items, he/she will scroll down the tableview and it will display more.
How do I go about doing so? Any tutorial out there? Sorry but I didn't know what to search for.
This behaviour is implemented in STableViewController.
It basically checks the scroll position of the underlying UIScrollView of the UITableView to see whether it has reached the end of the page and then loads more content if it has. It also uses a custom tableFooterView to indicate that it is loading content.

Is there a way to create custom UIDataDetectorTypes?

What I am trying to do is create tooltip functionality so that certain words in my instructional app can be tapped and the definition pops up. For the popup part I plan on using code from “AFInformationView” which provides bubbles on the iPhone.
The part I'm struggling with is how to associate A particular word's location with the bubble. Currently I have the text on a UILabel that is on a custom UITableCell. Since I calculate the row height on the fly with:
[textToUse sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:CGSizeMake(stop-start, 500)];
I'm not sure what the coordinates for a specific word will be. I was thinking that if I created a custom DataDetectorType that could be the fix.
If anyone knows how to do this or has any other ideas I would be happy to hear them.
Thanks,
Andrew
I didn't create a custom UIDataDetectorTypes but Craig Hockenberry did something like it with his TwitterrificTouch.
He uses regular expressions to detect links and other things. I provide it with my keywords and then they become tappable. He places buttons on top of the matching text from the underlying labels. You can google a lot of posts that talk about "putting transparent buttons on top" of various things but Craig's code is the only example/working code I could find.
Here is the link:
http://furbo.org/2008/10/07/fancy-uilabels/
I don't think this is possible. The (few) Data Detector types that the iPhone currently supports are hard-coded with a integer type id. There does not seem to be a mechanism to extends that list of types.
File a feature request in their bug tracker. I will do the same.
AFAIK, you can't create custom data detectors.
The best approach for this sort of thing seems to be using UIWebViews. At least that's what I did. However, you shouldn't use a UIWebView inside a UITableViewCell. In fact, no subview of a UITableViewCell should respond to user input. So I think the best approach would be to display a UIWebView when the cell is tapped.
UIWebViews could be a possible approach but on scrolling you should consider that the whole text should be parsed to detect the words.You could use HTMl tags to make them blue and provide the links.But how could i then assign a custom behavior then opening in safari?
If you want custom data detector you could write an extractor method to primarly patch the links with help of NSregularExpression. For example
NSString regex = #"(http|https|fb)://((\w)|([0-9]*)|([-|_]))+(\.|/)"; to patch alll the links including Facebook URLs inside text like fb://friends.
Then you could use NSattributedString yo mark the links with different colors etc.
ThreeTwenty has a great library called TTTAttributedLabel where you could assign links to certain parts of a text. I also scrolls quite fast if you use it in tableviews
https://github.com/mattt/TTTAttributedLabel

TableView or ScrollView for edit form?

I wonder which will be the best route for build edit forms on the iPhone, using a TableView or using a scrollview.
I need:
Support up to 15 fields (similar to contact app)
The same behavior of safari forms, where is possible go back/forward among fields, and the form center the selected field and stay there when the user end the editing
Simple layout (one field after other)
I'm looking for the most-user friendly experience. Which route has been proved to be the better?
Exist good examples of great edit forms on iPhone apps?
I would vote for a tableview organized by sections. If nothing else, it is a more common layout and most users will be familiar with it.
In either case, you will have to handle the transition from field to field with custom code.

What's the best layout for a scrollable iPhone "detail view" with variable content?

I'm building a navigation controller based iPhone application and am curious how to go about building the detail view for my application. The part that's complicating my endeavor is: What UI elements/hierarchy should I employ to create a variable-height yet scrollable detail view?
A great example of my goal is an arrangement like the mobile App Store detail view. The horizontal divisions between the heading, description, screenshot, etc leads me to believe it's a table view in disguise, but that's just a guess.
Currently, I'm using a UIScrollView for my detail view, but since I can never be sure of the exact length of my incoming content, my description view ends up with either unused space or truncated text. Is there some set of elements that would be best suited for displaying this variable-height content in "blocky" format (like the example) while still maintaining overall view scroll-ability?
Thanks in advance for your assistance!
If you want to be able to easily format complex content you can use a UIWebView. What I basically do is create an HTML template and add it as a resource. At run time I load the content of this HTML doc and do string replacement to add the content I want. Within the HTML I place placeholders like
<div><!-- ARTICLE_TITLE --></div>
I don't think the App Store detail view is a UITableView. In fact, I'm pretty sure it's a subclass of UIScrollView.
To determine the size of your content, you can use NSString's sizeWithFont method.
A little late, but still relevant: The App Store broke a few weeks ago, and the "Featured" tab of the App Store was very obviously HTML without CSS applied. So, it's actually a UIWebView, or web content displayed in some fashion.
The touch-down behaviors of the iTunes app, while appearing quite similar, behave differently, in a more native fashion. I'm not convinced this app is implemented in the same way.