UICollectionView 在實(shí)際開(kāi)發(fā)中需要在模型Model里定義一個(gè)BOO值,來(lái)標(biāo)記是否選中,根據(jù)選中狀態(tài)來(lái)切換選中狀態(tài)
如@property(nonatomic,assign) BOOL selected;
模擬數(shù)據(jù):

在cellForItemAtIndexPath 里給cell 的model賦值 ?cell.model = model;
多選:

單選:

UICollectionView 在實(shí)際開(kāi)發(fā)中需要在模型Model里定義一個(gè)BOO值,來(lái)標(biāo)記是否選中,根據(jù)選中狀態(tài)來(lái)切換選中狀態(tài)
如@property(nonatomic,assign) BOOL selected;
模擬數(shù)據(jù):
在cellForItemAtIndexPath 里給cell 的model賦值 ?cell.model = model;
多選:
單選: