How to create a Timeline view with draggable components in Swift? - swift

I would like to create a timeline in swift, like a timeline in classical music software.
What's the container (Collection Views, TableView, Scroll view etc..) looks like to best to design this?

NSCollectionView gives you the greatest flexibility for designing this, with the background cells rendered as supplementary views.

Related

Swift scrolling controller for list of buttons

I'm building a macOS app that requires a scrollable (and ideally, drag and reorderable) list of check box buttons. These buttons are going to be loaded in from a .plist file, so I need some control to load them into.
I'm really a c# programmer, and would just use a stackpanel or dockpanel or something of the like. Is there an equivalent in swift? Or do I need to write a custom control?
I have tried using various types of table views with check box cells, as well as rule views and other scrolling type views.
Edit:
Sorry, I should have linked to NSCollectionView and NSStackView for MacOS — it's obviously not part of UIKit. :)
//
Check out UICollectionView. Similar to UITableView (data source, delegate, UIScrollView subclass), but more flexible on how the layout looks and acts. It also supports reordering.
You could also use a UIStackView, but you would have to put it in a UIScrollView yourself and it doesn't easily support reordering.

iOS Making a custom table view with spaced out and custom cells

I am attempting to make a custom view that looks like the attached picture. The top two cell would be static while the bottom three would scroll if there are more than the screen can fit, and only scroll within that given area. I am wondering what the best approach is to making these types of custom views. I know how to make custom UItableviewcells and have custom content in them, but I am struggling with an overall strategy to make a custom UITableview that has certain cells be static and others scroll. Should I just implement a table view to be part of the screen in storyboards? Or are there better ways to do so?
I would do this by making the top two "cells" just be UILabels, and the bottom a table view where both the cells and the table view would have a clear background. The table view should be set to have no separators between the cells, and the cells should have a UILabel with a background cooler the same as the top UILabels.
This was the result:
I normally do not like to use story board much. And prefer SubClassing UIView. It might take more time to code at first but in a long run it is easier and very dynamic to control the UI programmatically.
In your problem I would make two static UIView(s). If the two view are similar the advantage of using UIView class is that you can use same class with different data model to generate multiple views. But if you use story board you need to copy past multiple times. Hence try to create UIViews class objects as much as possible.
And then the bottom one will be a simple table view. Do not think there is much you can do in this case. Do submit some codes you have done so that we can better refine it.

How to create grid table view in iphone

Hello I want to create a table view like as following image
There is any library is available. how can create like this.
Check this repository GridTableView. I used the same code to create 10 columns in iPad application. Let me know your thoughts.
I recommend to use UICollectionView and PSTCollectionView
or
You can use the UITableView for this and with your own custom cell which it is not complicated.
Note:
UICollectionView is only Available in iOS 6.0 and later.
The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts. Collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and many more. You can even change the layout of a collection view dynamically if you want.

How to create a horizontal scrollable list?

I am wondering what the best approach is for creating a horizontal list with custom buttons. I read there is no native control for that:
I am considering a UIView with a scroll view inside. On this scrollview I visualize my array of button objects.
Any thoughts?
Using a UIScrollView with paging and only horizontal scrolling should give you a good start.
Look at a PageControl example from the iPhone SDK.

How to realize the same effect like iPhone's homescreen

I want to add some custom buttons and realize the same effect like the iPhone's home screen. What I can think of is to calculate the position of each button and add them to the view. Are there any other ways to do this? e.g. add buttons to the tableview
Check TTLauncherView from Three20,
I realized the same view of the thumbnails in the photo app (which in principle differs only because of the background color and the rounded effect of the buttons) using a custom cell (with 4 UIButtons inside) in a normal tableview.
In my case, this is because I need to scroll up and down, in your specific case there should be a way to "lock" the table from scrolling. By the way, for this reason, it could be simpler to design the custom view in the interface builder, it is very quick to design such a view, and then create a custom controller to provide simple methods to assign icons and actions to the UIButtons dynamically.
You could also look at the Three20 libraries as already suggested, it is already implemented, but you app will easily be rejected by Apple if you do so.