ios charts don't register touching and never show markers - ios

I have a list of charts in a tableview (each cell is a chart view) and I'm trying to add a custom marker (tried with balloonmarker) so that when the user taps on one of the data points a marker should pop up and show additional info about this point. My tableview cell is ChartViewDelegate and I implemented chartValueSelected method in it so that this thing could work but the problem is that most of the taps don't register at all. Basically the app doesn't recognize which view the user is tapping on, so I have to scroll up and down until it recognizes that I'm selecting a specific view. These cells take up the whole screen so I can't understand why it has such a hard time determining the view I'm tapping.

Related

Modify WatchKit Table View to prevent pushing interface out of view

I am developing a stopwatch app for Apple Watch similar to the one that is preinstalled on the Apple Watch by default. I want to have a lap table similar to the preinstalled one that can scroll but doesn't push the control buttons outside of the user's view. Right now after I lap enough times, the stopwatch controls no longer be become accessible to the user without scrolling down. Is there any way to make the WatchKit Table view scroll in place by turning the digital crown and display say 3 entries at once without pushing the rest of the UI below the screen?
Currently in watchKit the tableViews scroll all the way out of the screen if they don't fit in. What you can do is
1) have the fourth tableView cell as a disclosure indicatory like this "V" while hiding the cell prior to the recent 3 and when this is clicked load the rest of the cells and have an extra cell to display "^" when all the cells are display . Clicking this will hide them back to the recent 3.
2) Navigate from the fourth cell to a new Interfacce controller displaying all lap data.

Implementing custom callout button for "About"/ "Info"

Im extremely new to iOS and i have a requirement where in table view, each cell displays list of stores near by and also an info button at the end which shows the timings of the stores. Info accessory button like this and my requirement is to display callout alert as below on tap of that button.
Do I need to create custom view of small size and display that view every time when user taps on that? Please advice how to achieve this in Swift.

Implement iOS home screen folder

I have a collectionView with each cell showing an image. I want to implement a drag and drop. This will solve two purpose.
Rearrange cells.
When a image is dragged into other, it forms a collection (think of it as a group containing two or more images).
This behavior is inline with the home screen folder where app icon can be grouped into folders.
Please suggest how I can implement this.
This isn't trivial but it is not impossible either.
Reordering is simpler, and you can take advantage of UICollectionView's methods:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/#//apple_ref/doc/uid/TP40012177-CH1-SW67
Reordering Items Interactively
Collection views allow you to move
items around based on user interactions. Normally, the order of items
in a collection view is defined by your data source. If you support
the ability for users to reorder items, you can configure a gesture
recognizer to track the user’s interactions with a collection view
item and update that item’s position.
To begin the interactive repositioning of an item, call the
beginInteractiveMovementForItemAtIndexPath: method of the collection
view. While your gesture recognizer is tracking touch events, call the
updateInteractiveMovementTargetPosition: method to report changes in
the touch location. When you are done tracking the gesture, call the
endInteractiveMovement or cancelInteractiveMovement method to conclude
the interactions and update the collection view.
During user interactions, the collection view invalidates its layout
dynamically to reflect the current position of the item. If you do
nothing, the default layout behavior repositions the items for you,
but you can customize the layout animations if you want. When
interactions finish, updates its data source object with the new
location of the item.
The UICollectionViewController class provides a default gesture
recognizer that you can use to rearrange items in its managed
collection view. To install this gesture recognizer, set the
installsStandardGestureForInteractiveMovement property of the
collection view controller to YES.
To implement the "grouping" behavior, you need to define your cell in such a way that it can determine whether it is a single item and should just display itself, or if it consists of multiple items, in which case it should be able to pop up a view to act as a tray, possibly its own view controller to handle taps independently. This part is going to be hard as you'll need to implement reordering again, and dragging out, etc.
You might want to search Github and others to see if anyone has implemented a "Springboard" type of app that can get you started.

Changing the selected marker Google Maps iOS

I have multiple markers in my google map. Each containing different information. When the user click on the marker a small view appears containing all the information. I have put up a swipe gesture on the view. What i want to achieve is that when user swipes from left to right the next marker appears in the center of the map.
**
I just need to know some logic or example. what should i implement on
swipe handler that changes the marker.
**
Gracias
Note that the swipe from left to right gesture might interfere (both programmatically as from a user's point of view) with the normal behaviour of this gesture on a map - scrolling it.
That said, you'll have to keep an NS(Mutable)Array of markers somewhere (there is no property on GMSMapView which gives you all markers). Upon detecting the gesture, find the index of the mapView.selectedMarker in the array, retrieve the next one and update mapView.selectedMarker. The map might automatically scroll to the marker, but if not, you can do this with setCamera:.

UITableView tap and hold + drag and drop

I wanted to find out how to do the following:
I have a UItableView, which enters edit mode when the user taps and holds one of the rows
Once it enters edit mode I need the cell to remain selected and give the effect of popping out, under the users finger.
The user should be able to drag the popped out cell and reposition it to another row, without lifting the finger.
What I already have in place:
I have a long tap gesture recognizer and I set the table into editing in the long tap gesture recognizer selector.
However in order to drag the cell I currently require to raise the finger and re tap to drag the cell , which is not what I want.
Any help would be appreciated.
At current moment there is a workaround (not easy enough): https://stackoverflow.com/a/7501076/326017 .
And I have found code snippet here: https://github.com/FlorianMielke/FMMoveTableView
"FMMoveTable is an UITableView subclass that provides moving rows by simply tap and hold an appropriate row without switching the table to it's edit mode" - from description
The article Reordering a UITableViewCell from any touch point discusses this exact scenario.
Essentially you do the following:
Find the UITableViewCellReorderControl (a private class).
Expand it so it spans the entire cell.
Hide it.
The user will now be able to drag the cell from anywhere.
Another solution, Cookbook: Moving Table View Cells with a Long Press Gesture, achieves the same effect by doing the following:
Add a long press gesture recognizer on the table view.
Create a snapshot of the cell when the cell is dragged.
As the cell is dragged, move the snapshot around, and call the -[UITableView moveRowAtIndexPath:toIndexPath:].
When the gesture ends, hide the cell snapshot.

Resources