ios - NSCollectionView Swift -
i have ios app uses uicollectionview
. creating app mac trying use nscollectionview
not sure should start. trying add code below not seem available. going wrong? thanks
func collectionview(collectionview: uicollectionview, numberofitemsinsection section: int) -> int { return 30 } func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell { let cell = collectionview.dequeuereusablecellwithreuseidentifier("cell", forindexpath: indexpath) projectscellcollectionviewcell cell.textlabel.text = "\(indexpath.section):\(indexpath.row)" return cell }
thanks.
i have followed quick start guide , stuck @ part:
-(void)insertobject:(personmodel *)p inpersonmodelarrayatindex:(nsuinteger)index { [personmodelarray insertobject:p atindex:index]; } -(void)removeobjectfrompersonmodelarrayatindex:(nsuinteger)index { [personmodelarray removeobjectatindex:index]; } -(void)setpersonmodelarray:(nsmutablearray *)a { personmodelarray = a; } -(nsarray*)personmodelarray { return personmodelarray; }
i not seem able add these viewcontroller.swift
file. suggestions?
ios uses uikit ui elements, while mac uses appkit. there big differences between these, because ios mobile touch-based interface , mac desktop keyboard/mouse interfaces. shared between ios , mac foundation. if there's equivalent mac can replace ui
ns
find class you're looking for. code won't work because there no uicollectionview
on mac.
however, seem have noticed, there nscollectionview
, apple provide quick start guide for.
Comments
Post a Comment