Question

I have one storyboard project in that i added PSTCollectionview classes and all files .Then i created one class for my viewcontroller "allbooks.h,.m in "PSUICollectionviewcontroller_" and iam not able to add this class on my viewcontroller ??? please

GMMAllBooksGrid.h

#import <UIKit/UIKit.h>

@interface GMMAllBooksGrid : PSUICollectionViewController
@end
Was it helpful?

Solution

You can use the PSTCollectionView in the same way as UICollectionView. I will post my code may help you.

CollectionViewController.h

#import <UIKit/UIKit.h>
#import "PSTCollectionView.h"


@interface CollectionViewController : UIViewController <PSUICollectionViewDataSource,PSUICollectionViewDelegate,PSUICollectionViewDelegateFlowLayout>

@property(nonatomic,retain) PSUICollectionView *collectionView;
@end  

CollectionViewController.m

-(void)loadView
{
[super loadView];
self.view.backgroundColor = [UIColor whiteColor];
PSUICollectionViewFlowLayout *layout = [[PSUICollectionViewFlowLayout alloc] init];

// Configure layout attributes globally
layout.itemSize = CGSizeMake(150, 150);

self.collectionView = [[[PSUICollectionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds)) collectionViewLayout:layout]autorelease];
[self.collectionView setDelegate:self];
[self.collectionView setDataSource:self];
[self.collectionView setAutoresizingMask:UIViewAutoresizingFlexibleHeight |UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin];
[self.collectionView setBackgroundColor:[UIColor clearColor]];

// Register Cell and supplimentary views
[self.collectionView registerClass:[PSUICollectionViewCell class] forCellWithReuseIdentifier:CELL_ID];



[self.view addSubview:_collectionView];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top