ios - How to create CollectionView global object Which can be accessible from any controller? -


how create collectionview global object can accessible controller? want create uicollectionview can accessible view controller, , display collectionview on same controller called.

you can use singleton:

@interface collectionviewsingleton : uicollectionview  + (id)shared;  @end  @implementation collectionviewsingleton  + (id)shared {     static collectionviewsingleton *shared = nil;     static dispatch_once_t oncetoken;     dispatch_once(&oncetoken, ^{         shared = [[self alloc] init];     });     return shared; }  @end 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -