UIButton inside a UIScrollView - ios

I would like to use a scroll view inside my app.I will explain the situation:
Mine is a recipe app.I would like to show all the recipe images inside a scroll view and when i click an image inside the scroll view ,the corresponding ingredients and preparations has to be shown .I saw many tutorials using image view inside the uiscrollview,thought of replacing image view with button.But all those tutorials are so complicated .Can any one refer me a simple example.
This my apps seccond page.when i click a particular recipe in first page its image and ingredients and preparation is shown.But i would like to show all the images in uiscrollview,and when i click a particular image,corresponding ingredients and preparations has to be shown

From my point of view I think that if you would use a UITableView or a UICollectionView (or the corespondent controllers: UITableViewController and UICollectionViewController) you would achieve grater results than trying to add buttons with images inside a scroll view.
UITableView Tutorial and UICollectionView Tutorial
Also you can go and watch the Apple's WWDC videos
I hope this is helpful for you,
Cheeers

Place UIscrollview In View Xib, then add UIButtons Inside UIScrollview , set buttons actions by hooking action type touch up inside in button pressed add subview on UIView and Show details of Recipe.[self.view addSubView:RecipeDetailView]; here recipe detail view subview where you load reciepe info on button pressed.

Related

Table View is taking interaction when a view of same bounds is added above that in OS X

My app contains a Table View which is scrolling and taking events properly. But after that I have to show a custom pop up to screen for that I have added a full view over the Table View. But after adding the view over Table View, Table view is still scrolling and taking events.
Please help if anyone have knowledge about that...
Thanks
The best way to achieve this is to add a blur view into your nib file first. This is better approach as the user is made aware of the current enabled object.
Once you add the blur view over the tableView you are showing, add your custom pop-over. This would maintain a clear demarcation between the two views and you would be able to achieve the functionality you want as the touches won't flow to your tableView.
Follow below steps may work:
Add overlay view on screen to show data on top of table view
make TableView Disbaled as soon as u add view on it.

Why interface builder not let me to add uiview to uitableview?

I have a table view. I want to add some features so when user click on a cell another view opens and show details about that cell. I am trying to follow this part of video to add uiview:
youtube tutorial
But when I drag and drop it myself, it returns back and is not adding to tableview. Here is my storyboard.
I see your attached image and as per that i think you have use UITableViewController which has mainview is UITableView.
But the video you are trying to follow , in that they have take a UIViewController which has mainview is "UIView". in that they have have drag an drop UITableview. And then they have added a another UIView in "mainview which is "UIVIEW" " not UITableview.
If you want to learn how to sue UITableview in UIViewController, there here is the tutorial link :
http://www.appcoda.com/ios-programming-tutorial-create-a-simple-table-view-app/ 
If you follow this steps then also you will be able to create the same tableview which you have currently developed. And then you try to add a view to MAINVIEW. it will allow you to add it.
You shouldn't be adding UIViews to UITableView. The content that UITableView displays should be cells returned by the relevant methods of UITableViewDataSource and UITableViewDelegate.
Specifically for your case, in the YouTube tutorial you referred to, the UIView is dragged on top on the UITableView, and not inside the UITableView. So the parent view isn't the table view, is the View Controller's main view.
Try that and continue with the tutorial to get to the table view's content - the cells. Good Luck!

Modify or delete table view cell in master-detail ipad app

I am developing a simple master-detail ipad app. Using xcode template for master-detail app when "Edit" navigation item is pressed in table view cell red circle appears which allows to delete selected cell.
In my app I would like to have the following: when edit button is pressed each cell can be deleted or modified (by performing segue to detail view). In other words with the red circle I would like to have another "icon" to modify the contents of that cell. Is it possible to perform this and how can be it done?
You can do this kind of stuff in multiple ways.
First is that you assign a custom gesture like swipe on the cell using the UIGestureRecognizer with custom selector that will called each time when the cell is swiped.
You can then display the buttons that are initially hidden from User.
Look into the following post to understand it better - How To Make A Swipeable Table View Cell With Actions – Without Going Nuts With Scroll Views
You could always instead of using the default Edit button, implement a swipe feature that allows the user to swipe the cell to view more options. This link provides a tutorial walkthrough on how to implement this functionality.
Also, this StackOverflow post might help as well if this is the direction you choose to take.

I wish I could create custom view with tableview in iOS

I'm having trouble creating a view hierarchy. I'm developing a custom UIView to display a list.
Here is what I would like to achieve:
Instead, I'm getting the following weird output:
I want the OK button to be at a specific X,Y position.
**My Current View Hierarchy is like **
UIView
ContainerView-(CustomView to show tableview with UIButton)
ContainerView contains UITableView,UILabel,UIButton (with titled OK )
Sorry for my English :)

Create a swipe feature within an UIImageView

In my current test app I have a UITabBarController, linked to a UINavigationController that leads to a UIViewController with 6 buttons in it and a second UIViewController with a UIImageView. I've created a segue for each button, wich works.
I want to be able to create a swipe pictures feature inside that UIImageView. The source pictures are inside the app's folder.
I'm not sure about your question.
If you need to create a sort of slider of images, you could create a UIViewController with a UIScrollViewas the main view (or as a subview of UIViewController's view).
Once set up, you could create a for-loop where you create UIImageView elements to wrap the image you are loading from your app folder and add each UIImageView to the scroll view.
To make possible to snap photos within the UIScrollView set its property pagingEnabled to YES.
For further info you could take a look at Scrolling sample provided by Apple.
Hope this helps.

Resources