iphone search swiping - iphone

I am wanting to have half of a view taken up by a page control. The page control will allow the user to swipe from left to right on a selection of 5 different table view lists.
Is this possible?
What is the best approach.
Will each table view that will be put into the page control need its own controller? Or am i totally off the path.
The example i want it flow like is the screenshots of apps in the app store app details page. Except for screenshots i will be showing lists of data.
Thanks in advance

It sure is possible. Use a scroll view with paging enabled.
And you dont need to have separate controllers for each table view. You can handle multiple tables in a single TableViewDelegate, as all the delegate methods have the table view a parameter.
Check PageControl and ScrollViewSuit code samples.
And about covering half the view, well, your scroll view can be any size.

Related

Cannot get scroll view to scroll with multiple table views in the document view

I am trying this using a Document-Based application. I'm new to programming, so if I need to use a view-based let me know. I am trying to create a data entry screen that has one table view as the master, and many more table views as the Details. I am using interface Builder. I have embedded all views (master and detail) in a scroll view. I've also tried embedding all the details views into a box, and embedding that box into a scroll view. I cannot get any of the tries to scroll. It "bounces" when I try to scroll and I can see the other table views for a second, but it won't scroll. I have tried adding constraints and having IB add the constraints. No combination of constraints or no constraints seems to work. I have also tried changing the size of the Custom View that holds all the other views and that doesn't work either. I know I'm missing something simple. If you need more information, let me know. Thanks for all suggestions.
EDIT to add more detail.
I am using Master-Details for this part of the project. The goal is to be able to scroll vertically up and down to access all of the nine table views that are part of the Details for the Master Airport Table View.
All of the table views I have work correctly, scrolling as expected inside of the table views. The trouble occurs with the Details Bordered Scroll View that contains all the text labels, buttons and individual table views. That Details Bordered Scroll View will not scroll. In the view hierarchy below it is Bordered Scroll View - Box.
You can see in the view hierarchy I have a Master Table View called Airport Bordered Scroll View - Table View, with the associated labels and buttons separate from the Details table views.
I embedded all the table views, labels and buttons that are part of the Details section of the Master-Details in a Box named Details Box. Then I tried embedding the Details Box in a Scroll View so I can access every Details Table View, but that didn’t work. In another build, I tried embedding the Details Table Views and associated buttons and labels into their own scroll view, without the box. Again, that wouldn’t scroll either.
I'm too new on this site for uploading screen shots, so I think it gives a link to see it.
View Hierarchy:
This is the view hierarchy when I tried using a box around the Details views.
View hierarchy
This is what I have built using interface builder. Again, all of the table views perform normally.
Interface Builder
Here is the running app. You can see that the last table View, HUD Data, is not shown in the screen and I cannot scroll down to see it.
Window after running
The code I have added in Document.swift is mainly for undo and archiving so I don't think it would help here (I could be very wrong though, let me know if so).
I have created separate types for each of the tableViews. Again, the only code in them so far are the properties and NSCoding protocols.
I can definitely post these if you need to see them.
I used interface builder for every view, label and button so there is no code for them.

How to build this screen in iOS?

I'm new to iOS development and am trying to build something like the screen below:
If I was doing it in Android, I can easily build the above UI in a few minutes. However, I don't know how to go about it with iOS.
I understand that the whole ViewController can be embedded in a navigation controller, which produces the title bar above. What about the bottom part though? I'm thinking of using something like a grouped UITableView but I'm not sure, since every cell will have very different contents:
A search bar, perhaps a subclassed UISearchBar, which I also don't know how to customize--the Search button at the right is required but isn't in the default UISearchBar. When the user taps on it, the UISearchBar must be translated to the navigation bar, no need to display a UITableView of suggested results. I don't know how to do that, too.
A button that, when tapped, flies in a modal from the bottom (I imagine it to be another ViewController with a grouped UITableView), to allow the user to choose from defined locations. Once selected, the modal closes and the button text is replaced with the selected location. This sounds much easier to do.
A header ("Item categories") and the list of categories, which may change in number. If the parent isn't a grouped UITableView, I think this part can be a UILabel and a non-scrolling UITableView with a height that changes depending on how many cells it has. If there are plenty table cells that don't fit given the screen's height, everything below the navigation bar can be scrolled vertically. That, I also don't know how to do.
If anyone can just guide me to what native iOS components I can use to build the above screen, and maybe a couple of tutorials to the things I just said I don't know how to do, I'd appreciate it.
You said it right .All the basic info you need is with you.
To build a searchbar like that i dont think you have to subclass it.
Bottom comprises of tableview.
Actually these Questions are seperately available in SO itself.So search seperately for your needs and you can achieve whatever you want
One basic principle : You cant achive anything by just thinking.Trying and get to it and if you have any issues look forward at it.All the issues will have an answer on the way.
Lots of components you need there.. Search Bar, UIPickerView and UITableView. I would like to give you some pointers.
1) You can refer http://www.appcoda.com/how-to-add-search-bar-uitableview/ for Search bar
2) When clicking on the Button, you can bring up a UIPickerView instead of another controller. For that you can refer http://www.techotopia.com/index.php/An_iOS_5_iPhone_UIPickerView_Example
3) You can use a normal Tableview with a single section, configure the section header to display Item categories.
You are asking too much to ask how to do every component of your UI. I will just answer a little.
Yes, a grouped table view is a good design. I am using a grouped table view for varying types of input. I have an actual table, with rows that can be added, and deleted, and contain an editable text area. Then I have three groups that only really show one piece of content each: two are sliders and one is a switch.
For choosing the location, pushing another view controller on your navigation stack would be the more typical way to handle it. You will save some effort that way, with some buttons and behaviors built in, but a modal view controller is not much harder. I'm not sure if you can make a navigation view fly in vertically, but does your app have to be frame-for-frame identical to the android version?

Best way to show a small view/dialog over an existing screen?

All my views/pages in apps so far have been full screen UIViewControllers that i push and pop from the stack.
I see some apps create a new view/window that appears about the 1/3 the size of the full screen on an iPad, containing tables of items to select or other UI elements. They are commonly used to allow users to filter the current view they were on.
Seeing them in apps, I guess that they are just adding a UIView to there current screen and change its frame depending on where on the screen they want it to appear.
Or am I wrong? Is there another/better way to do this?
I guess you are talking about UIPopovercontroller. There are several tutorials to build the same.check this. Hope that helps you.
It's a little unclear from your question what the view looks like.
If the view is "attached" to a UI element (has a little triangular arrow connecting it to, e.g., a button) and goes away if you tap outside it, then it's a view presented from a UIPopoverController.
If the view overlays everything and dims the content behind it, is likely a model view controller presented with a presentation style of ether page sheet or form sheet.
Both are common and easy to set up. See the class documentation I have linked.
In most cases, these are probably normal modal view controllers whose modalPresentationStyle property is set to either UIModalPresentationPageSheet or UIModalPresentationFormSheet.
Yes you can make your own UIViews and just add them as subviews. Another option for iPads specifically is with the UIPopoverController class.

ios view transitions animations, page curl

i'm new to the ios sdk and i'm developing my first app. i need to implement a curl transition between multiple views; giving the user the impression they are reading a book. the documentation only talks about doing it between two views in a single view controller. like i said i need to implement this with a stack of several views. do i need to use more than 1 view controller? if so how? or do i have to use 1 view controller but use say 10 views in a stack? again how would i go about doing this.
would greatly appreciate your help.
Ideally, you would use only two views for this: one for the view being animated (to an offscreen position), and one for the view underneath. To handle multiple flips, you would animate the top view to its offscreen position, then fill it with the data for the page underneath the current page and then insert it underneath the current page. For the subsequent flip, you would animate the current off the screen, etc.
You could alternatively use a number of views that matches the total number of pages you want to display. This might make your coding simpler, but it would eat up a lot more memory.

Nested UIScrollView-iPhone photos application

I have been facing the same nested UIScrollView problem for long time.I tried some open source codes like Scrolling madness ,three-20 and others but all fails finaly.I am trying to make a photo Viewer application same as iPhone.For that I have created the structure like this:-
1)one View controller.
2)on view of view controller one UIScrollView (i.e inner/parent scroll view) as a child.
3)on inner/parent scroll view number of child scroll views(i.e. outer/child scroll views) ,each represents one page of photos application.
4)On each scroll view one image View on which i am displaying my image.
So what I want is when user scrolls the outer scroll view it should scroll horizontally with all the child views so I will get the look and feel of paging in photos application.Also when user is on one specific image(i.e. child/outer scroll view) he should be able to zoom in/out,swipes and perform single/double tapping.I was able to make it work in sdk 2.1,but it dosnt work since sdk 3.0.Please tell me the idea behind your project.Means which scroll view you are subclassing ,in which view to detect touches.How this completely child - parent relation should be.
If possible provide any sample code also.
There is a WWDC session from 2010 that deals with this very issue.
Here's the short of it:
You need a single scroll view that is paginated and scrolls horizontally. Each "page" of that scroll view is another scroll view containing a photo.
First, it looks like you want to subclass UIScrollView? Every interaction method you need is provided for you in either the delegate callbacks or the touch methods. (Many of Apple's more advanced classes, such as UIScrollView, react poorly to subclassing.)
Second, it sounds like you have a first responder problem. IOW, your innermost scrollview isn't getting the first crack at the touch events.
Andrew
I also struggled with this for a long time trying samples you mentioned. I could finally figure it out with the samples provided by apple (iphone dev center).
http://developer.apple.com/iphone/library/samplecode/Scrolling/Introduction/Intro.html
http://developer.apple.com/iphone/library/samplecode/ScrollViewSuite/Introduction/Intro.html
The first one is pretty basic and probably what u already have. The second one is all about zooming, etc. Just study these and the samples you already have, I think you will be able to figure it out. On specific topics just come back here search for answers or post another question.
EDIT: I forgot this one check out these examples by Andrey Tarantsov hosted on github. This is what you want... http://github.com/andreyvit/ScrollingMadness