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

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.

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.

Swift canEditRowAtIndexPath not working in UIPageViewController EZSwipeViewController

I have the following scenario and need help in resolving a tricky situation in the scenario
There is an Xcode project and am using EzSwipeController for swipe (pagination effect) between three View Controllers at the moment.
In my first ViewController (this viewController is fetched from my custom dynamic framework as part of my requirement) -
Code to fetch ViewController:
userProfile.createProfileUI(userSession!) { result in
switch result {
case let .Success(profileViewController):
myDetailsVC = profileViewController //myDetailsVc is passed to EZSwipControllerDataSource array
default:
break
}
}
The other two ViewControllers are within my project storyboard
The Problem -
In the first ViewController, there is a tableView with canEditRowAtIndexPath enabled for few cells (phone numbers).
So when I try to swipe the row, the EZSwipeController responds first and
hence, I am not able to edit the row.
Here is what is happening - http://recordit.co/SOJgdeYchP
Here is what should happen - http://recordit.co/EBPSbjH31q
How do I handle this problem? Is there a way where I can override the default swipe controller action when I try to edit the row?
Please help!
Attach the swipe gesture recognizer to a parent in the hierarchy.
If you're using a UITableViewController, replace it with a UIViewController with a UITableView inside it. Then just drag the gesture recognizer onto the view controller in Storyboard, and it'll attach to the UIViewController's Content View instead of the UITableView.
Though at the end of the day, this is inherently a flawed approach, since swiping to flip pages in an app is only ever viable if you don't have any elements on the pages that also have swipe gestures in them. If you do, even if you code a workaround to make the gesture recognizer for the element in the view controller (in this case, a table view cell) fire instead of the page flipping swipe gesture, that creates an inconsistent user experience.
My suggestion: don't use a table view for such a form altogether. On top of the aforementioned mechanical UX issue, from a user perception perspective, there's nothing indicating visually that this is a table view and not just a scroll view, so there's nothing indicating to the user that swipe actions (Delete) are available. Use a scroll view instead, and take a different approach to deleting (Delete buttons that are always visible, Delete buttons that are only visible after the user hits Edit somewhere, etc.).

peek and pop for specific image from tableview cell

I have a table that displays different images (usually between 1 and 4 per cell). The images are programmatically added and aligned via auto layout.
I'm trying to implement the force touch method peek and pop, so that a user can push down on any of the images and the peek and pop will work.
I tried several different things to get the specific image, but none seem to be working. I added a tap gesture recognizer to each of the images in the cell that sends the index of the picture to the tableviewcontroller via a delegate, but the force touch method was called before the tap gesture was. I also tried creating an nsinteger property for the cell that gets set each time any of the cells get the touched. But this also doesn't get called before the force touch method.
How should this be implemented?
Peek and pop is merely a way of previewing a view controller transition. So think about how you would implement a transition where you tap on the cell and present the image in a presented view controller. Now configure that transition in the storyboard. Now check the Peek & Pop checkbox!

iOS Different Views for Table View Cell items

I just started iOS development last week and I am creating a Table View based application. I having trouble understanding how to use storyboard.
I want each Table Cell to open a different ViewController.
Currently it is setup like this:
Then in the Component View Controller I use if/else statements to determine what content to load. The problem occurs when one of the views needed a TabBar.
How do I assign different View Controllers to each individual cell, rather than one "template" view and forced to add everything dynamically.
First off, I will say that it probably isn't the best idea to assign an individual view per cell. However, if it is what you wish to do, then so be it.
What you would do is create a segue from the table view to the new view by clicking on the table view icon and dragging a segue like so:
2.You would give that segue an identifier like "embedTweetsSegue" or something.
You can then check for the cell being touched and perform the segue programmatically using:
performSegueWithIdentifier("embedTweetsSegue", sender: self)

UIButton inside a UIScrollView

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.

Resources