Implement Pull to Refresh feature in Core Plot - ios

Hi I want to implement the pull to refresh feature in CP so that I can reload data by using this gesture. I did some research that the apple built in gesture features rely on tableview or scrollview. Is it possible to make use of the Gesture Recognizers that have been built in the Core Plot library? Or is there any ready made methods within the CP? I saw some people put their CP within a scrollview but I guess that will make the performance worse?

You can configure a graph to bounce back if the user pulls the plot past the global plot range (set allowsMomentum to YES on the plot space). However, this doesn't give you enough control of the bounce to pause it and display the spinner that is normally displayed during the refresh. You're better off embedding the graph in another view that handles the pull-to-refresh action.

Related

Sidemenu and tableview customization

I am working on a project and with the hopes of developing my skills and providing open source package in iOS. I came across a unique interface that really got my attention which comes from a great app and there are two main things I would want to work on.
Pull to add and release to add.
This feature I know was built with a table view but how it was implemented remains unknown to me
Side navigation which contains time selection. The time overlays the tableview in this part
I would be glad if anyone could gimmie tips on how to go about this things or open source libraries that one can reference.
The application is Sorted you can check it out on the App Store
Look up on the following topics,
UIPanGestureRecognizer (this is to recognize the pull down)
CGAffineTransform (to rotate the text field)
Movement/Transformation of the elements could be done by changing the constraint values and calling UIView's layoutIfNeeded inside an UIView animation block
You can make the keyboard appear by making the text field first responder
If you are interested in building rest of the features 'Sorted' has. They you may check https://cocoapods.org/pods/FoldingCell for some inspiration :)

Creating an extensible iOS view

I am trying to create an application that lets user(s) create or update an org chart. Specifically any node can be extended in any direction. I am new to UI development and so am stuck as to which view to use. Is a UIScrollView sufficient for this? The functionalities I want to code in are -
Able to scroll in any direction.
Able to zoom in and zoom out to see different levels of the chart.
Able to save the position and zoom level that user is in so that I can start there the next time the app is opened (of course this is not as important).
It did not look like core-plot would give me this option. May be I am wrong.
Yes UIScrollView has methods to handle these functionalities and you can save your zoom level and scroll position in NSUserDefaults so you can access data later.
https://developer.apple.com/reference/uikit/uiscrollview

iOS how would I implement a scroll view based overlay that can display arbitrary views at x,y coordinates

I'm working with a 3rd party maps vendor and would like to create an overlay for this map to display arbitrary content. I already have callout pins created, but am looking to expand that with truly any kind of content I want to put over the map.
From what I understand, this could be done by using a scroll view and tiling, but it has been a very long time since I worked with that. Are there any projects I can take a look at to understand how to create a scroll view with tiled/reusable subviews?
Here's how I see it working - I receive a JSON from web service, it contains a class of an item I want to display and a position. The overlay instantiates appropriate views and adds them over the map, potentially reusing and managing appearance/disappearance of components as the user scrolls the map.
Maybe there are already some mechanism built into iOS to handle overlays for arbitrary content?

Pagination for line chart in iOS sdk?

I am using core plot to draw line chart which is showing weekly details of user.
Now what I want is, to swipe next week of graph like scroll view paging functionality (we can also see it on iPhone home screen)
Please refer below image for more details.
Please share any solution or any logic to implement above task.
You can implement this by placing your graph view inside UIScrollView and allowing horizontal scroll. You also may want to enable UIScrollView's pagination feature to achieve "iPhone home screen"-like effect that you're describing.
This part is pretty straightforward, but you may find this StackOverflow answer useful.
However, your performance may suffer if your graph doesn't have reasonable horizontal bounds — i.e if width of your graph is too big to render at one time. You need to test this specifically with your set of data.
If this is indeed the case, one solution is to create separate "reusable" graph views for each week (like reusable UITableViewCells) and render them on-the-fly when user scrolls to the left or to the right. In other words, only render current, next & previous weeks' graphs and update this each time the user flips the page.
P.S. This doesn't relate to your question directly, but you may also want to take a look at JBChartView by Jawbone. I prefer JBChartView over Core Plot because it's really well-written library for creating graphs that you can dig into and customise however you want (unlike from Core Plot which is basically "a black box").

How can I make a simple pull to refresh control without any libraries?

I'm using Core Animation to make a moon-orbiting-earth animation, and I would like to use this as an activity indicator of sorts in a pull-to-refresh controller on a UITableView.
The problem is, I cannot make a custom activity indicator with Core Animation- only sequences of images are allowed. Since I cannot use a subclassed/modified UIActivityIndicatorView, I can't use Apple's UIRefreshControl (pull to refresh) and thus I need to make my own.
I am aware that UITableView has a header property that I would likely be using, but I am not sure how I could load the view with the header upscreen, make an elastic effect, and monitor/change the table position programmatically from my callback.

Resources