How to create grid table view in iphone - 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.

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.

What's the difference between a UIStackView And A UICollectionView in Xcode 7?

What's the difference between a UIHorizontalStackView and a Collection View(Also Vertical stackview)?
Can't a collectionView be horizontal and vertical? Why would people use both?
What does a UIStackView do that a Collection View can't?
Yes, a collection view using a flow layout or a custom layout can be vertical or horizontal. When using a flow layout it's pretty easy to configure a single column of items which are all set to their intrinsic content size.
The stack view is basically a trim and specialised version of that. It takes away the flexibility of the collection layout and in return gives you a streamlined interface.
Depending on your use case you may not need the complexity of a collection view. There are also some nice little features, like if you had a list of options to display but some aren't appropriate in all cases then you can just hide the ones that aren't and the stack view will deal with it. Hiding items in a collection view requires a good deal more configuration.
Stack views also form a very lightweight option for container views created entirely within interface builder and with no requirement for code. In this way the stack view is replacing a lot of your auto layout constraints by using the intrinsic content sizes of the subviews it manages to flow the layout. You can also very effectively nest stack views to form most tabular type layouts.
Collection views have cells and work with data presentation. Stack views are a way to layout views within a container. Stack views do not have a way to work with the data as collection views do with delegates. Collection view is data centered and stack views are layout focused.
UICollectionView is like a grid, UIStackView is only for 1 dimension: vertical or horizontal.
UICollectionView is like UITableView, but it supports more than single-column 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.
vs
The UIStackView class provides a streamlined interface for laying out
a collection of views in either a column or a row
For me, With StackView, you benefit the "AutoLayout" feature, for example: you put 4 views in the Stack, this component will decide how those views will be presented on the screen, depending on their size.
Collection views are much more complicated UI elements, requiring a DataSource object, and a layout etc.
Stack Views seem to be a replacement for tricks where you had to apply multiple constraints to several elements to do (say) a stack of buttons, or arrange labels and text fields for a form.
Stack Views also don't have a delegate, and have no mechanism for selecting items or anything like that.
If you asking yourself why this 2 options are there, which looks like very similar - sometimes you'll create a custom Cell (tableview or collectionview) and will add a another tableview or a collectionview as a subview - then you will love to know how UIStackView works....

Customizing all table views in app using iOS 5

Perhaps I'm searching for the wrong keywords, but I'm surprised there wasn't already a similar question. If there is, please let me know and I'll delete this question.
What's the best way to customize all table views in an app targeted for iOS 5 or later?
UIAppearance has proved to be very useful for customizing all navigation bars, tab bars, and the like throughout an app. Is there a similar way to customize table view and table view cells?
So far I've been programmatically configuring each table view separately. This might not be the best idea as I plan to have different themes the user can select. I've been thinking about creating a separate class that returns the appropriate image for the table view (or cell) based on the theme the user has selected. Would this be a suitable approach (if there's nowhere to easily customize all the table views)?
The most used way to customise table views is through defining table cells in the nib files:
http://www.galloway.me.uk/tutorials/custom-uitableviewcell/
or storyboards:
custom uitableviewcells in storyboard
I haven't do any tweaks by appearance class yet, but it may be helpful. If you want to to this programatically, use the decorator pattern to ease your and further user's life in joining produced code into the project:
http://sourcemaking.com/design_patterns/decorator
I hope this is helpful

Is "setting" UI implemented by table view in iphone/touch/ipad?

I want my app's setting UI feel consistent with iphone's internal setting UI. It looks like it's implemented by a table view with sections to group the setting items together. Am I correct?
refer to: http://i.stack.imgur.com/XNVyO.png
Is it implemented by a table view with hard coded cells and sections or is it build by interface builder? If it is built by IB, how to design the sections?
thanks
-Leo
you might want to look at something like InAppSettingsKit, an open source framework that duplicates the settings app feel in your application.
if you want to create it yourself you'd just set the ui table view style to UITableViewStyleGrouped
Read up about how UITableView Work, You will need a UITableViewDataSource.
The datasource tells the table how many sections and cells there are in the table view.
Then the UITableViewDelegate will handle any selecte rows:
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/TableView/TableView.html

Customize the position of group in UITableView

Is it possible to customize the position of groups in a UITableViewController? For example, drawing the groups horizontally or customize the space inside two groups.
Thanks.
If you are targeting iOS 6+, UICollectionView implements the features you are looking for. It can do a horizontal layout out of the box and UICollectionViewLayout allows you to customize everything about the display and positioning of items. If targeting iOS 4.3+, there is a third-party implementation of it called PSTCollectionView.
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.