Creating an extensible iOS view - ios

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

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 :)

How To Create Animated Onboarding on iOS

I'm creating an app that will have a quick onboarding at the beginning with some pretty simple scroll through animations and finish with a button to basically "GO" into the app's content.
I'm looking for suggestions as for how to most effectively and efficiently develop this, here's some things that it needs:
there should be paging so that it locks onto about 4 different positions throughout the onboarding.
the animations progress should be dependent on the scroll view's position (I'm guessing the x value of the content offset)
there needs to be views that stay on screen through multiple pages and some that move on screen and off screen throughout the onboard, it can not just be one picture moving on then off
there needs to be a button that pops up on the last page
I have a good understanding of Scroll Views, Page Views, and Page Controls. I also just bought Core Animator (the app) if anyone can suggest how implement that.
The way that I'm thinking of doing it is basically creating a Scroll View with paging that is empty and just use it to control animations with its content offset. Is there a faster way to do this or maybe a open source library that would work better? I'm only proficient in Swift currently :?
Thanks for any suggestions! This my first app and I'm very excited to hear your suggestions
I would look at UIPageViewController as its setup to do the scrolling by page for you, although you have control over what kind of animation it uses. You are responsible for feeding it view controllers to display using this method:
setViewControllers(_:direction:animated:completion:)
here is the link to the apple documentation UIPageViewController docs
I created a scrolling credits screen for one of my company's apps, FaceDancer, that would be a decent starting point for what you are after. The app is free. You can download it to check it out at this link: FaceDancer. The credits screen is off the info button on the main screen.
It's not hard to use UIView animations to simply animate a series of views. I think that might be easier than working with a scroll view.
I can give you some guidance if you think it would be helpful.

Implement Pull to Refresh feature in Core Plot

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.

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").

iOS UI development: approach to building document "selector" screen

I'm looking to build a document "selector" screen, similar to Pages and Numbers on the iPad/iPhone:
I come from a WPF background and have some iOS experience. That being said, I'm looking for a good approach to building something like the tile-based interface Apple uses for opening documents in Pages.
I'm not concerned with the Folder animation.
What is the best way to approach building just the tile interface? I'd imagine I'd build some sort of view that sits within a UIScrollView - but it's the nature of that subview that I'm a little confused about. Does iOS have any wrap-panel or grid-like controls I could load a set of tiles (i.e., documents) into?
What do you guys think?
I don't know of any third-party classes to handle this for you, but there might be some out there.
The basic structure will be a UIScrollView containing a set of views, each representing one cell on the grid. You set the scroll view's contentSize based on the total number of tiles. Then you create tile views on demand, and place them inside the scroll view.
The scroll view's delegate object will be responsible for monitoring the scroll position, putting down tile views as they become visible, and (optionally) removing tile views that move out of view. This is basically how UITableView works: there are only about six or so instances of UITableViewCell at any given time, they are recycled as you scroll up and down the view. (Imagine a train where somebody at the back end is pulling out the rails and passing them forward to somebody in the front, putting them down in front of the train. As far as the train knows, the rails go on for miles.)
If you wind up having to place all the views yourself, take some time to learn the CGRect family of methods, including CGRectDivide. They will be useful in laying out the views and also in computing what's visible and what's not.
There are a few third party classes/libraries you can get to produce this functionality, AQGridView comes to mind. But there are no default easy classes for this.
If I was to develop this type of implementation, I would subclass UITableViewController. Expand it to have columns. Then subclass a UITableViewCell to display the image. That way all the container code and everything would already be there, and all you have to do is customize it to f it your needs.

Resources