Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added implementation in PSTCollectionViewFlowLayout for:

- (void)encodeWithCoder:(NSCoder *)coder
Writes out the same keys that are used in initFromCoder.  This fixes an issue where if the flow layout was serialized and then deserialized it wouldn't
contain the original values.
  • Loading branch information...
commit 544a3ca653bda841bc2ceb2c963c4df64e8f35ec 1 parent 7ce86e1
jeff96 authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 PSTCollectionView/PSTCollectionViewFlowLayout.m
View
13 PSTCollectionView/PSTCollectionViewFlowLayout.m
@@ -113,6 +113,19 @@ - (id)initWithCoder:(NSCoder *)decoder {
return self;
}
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [super encodeWithCoder:coder];
+
+ [coder encodeCGSize:self.itemSize forKey:@"UIItemSize"];
+ [coder encodeFloat:self.minimumInteritemSpacing forKey:@"UIInteritemSpacing"];
+ [coder encodeFloat:self.minimumLineSpacing forKey:@"UILineSpacing"];
+ [coder encodeCGSize:self.footerReferenceSize forKey:@"UIFooterReferenceSize"];
+ [coder encodeCGSize:self.headerReferenceSize forKey:@"UIHeaderReferenceSize"];
+ [coder encodeUIEdgeInsets:self.sectionInset forKey:@"UISectionInset"];
+ [coder encodeInteger:self.scrollDirection forKey:@"UIScrollDirection"];
+}
+
///////////////////////////////////////////////////////////////////////////////////////////
#pragma mark - PSTCollectionViewLayout
Please sign in to comment.
Something went wrong with that request. Please try again.