I have an iOS app that uses a UICollectionView
. I am now creating the app for Mac so I am trying to use NSCollectionView
however I am not sure where I should start.
I am trying to add the code below but it does not seem to be available. Where am I 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) as ProjectsCellCollectionViewCell
cell.textLabel.text = "\(indexPath.section):\(indexPath.row)"
return cell
}
Thanks.
I have followed the Quick Start Guide and I am stuck at this 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 do not seem to be able to add these to my ViewController.swift
file.
Any suggestions?