uitableview - Table layout / swift - iOS -
i'm trying re-create view in ios using swift.
i saw example on site: http://www.binpress.com/app/ios-data-grid-table-view/586
unfortunately not know language objective-c.
can me giving me advice on implementation?
you can use custom cell or prototype cell , use basic tableview delegate methods. work you.
your basic method below:
func tableview(tableview: uitableview!, numberofrowsinsection section: int) -> int { return self.items.count; } func tableview(tableview: uitableview!, cellforrowatindexpath indexpath: nsindexpath!) -> uitableviewcell! { var simpletableidentifier:nsstring="viewcontroller1" var cell:viewcontroller1?=tableview.dequeuereusablecellwithidentifier(simpletableidentifier) as? viewcontroller1 if (cell == nil) { var nib:nsarray=nsbundle.mainbundle().loadnibnamed("viewcontroller1", owner: self, options: nil) cell = nib.objectatindex(0) as? viewcontroller1 } cell!.label1.text = items.objectatindex(indexpath.row) as? nsstring return cell }
use same ui , labels suits single row , repeat according record.
Comments
Post a Comment