Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

code style

  • Loading branch information...
commit f23163f937d458475a95564e797b33a81612e3c1 1 parent fa6aea6
@steipete authored
View
8 PSTCollectionView/PSTCollectionView.m
@@ -88,6 +88,7 @@ - (id)initWithFrame:(CGRect)frame collectionViewLayout:(PSTCollectionViewLayout
- (id)initWithCoder:(NSCoder *)inCoder {
if ((self = [super initWithCoder:inCoder])) {
+
PSTCollectionViewCommonSetup(self);
// add observer for nib deserialization.
_nibObserverToken = [[NSNotificationCenter defaultCenter] addObserverForName:PSTCollectionViewLayoutAwokeFromNib object:nil queue:nil usingBlock:^(NSNotification *note) { _nibLayout = note.object; }];
@@ -97,10 +98,9 @@ - (id)initWithCoder:(NSCoder *)inCoder {
- (void)awakeFromNib {
[super awakeFromNib];
-
- NSString *collectionViewClassString = [self valueForKeyPath:@"collectionViewClassString"];
- if (collectionViewClassString) {
- self.collectionViewLayout = [NSClassFromString(collectionViewClassString) new];
+
+ if (self.collectionViewClassString) {
+ self.collectionViewLayout = [NSClassFromString(self.collectionViewClassString) new];
}
// check if NIB deserialization found a layout.
View
7 PSTCollectionView/PSTCollectionViewCell.m
@@ -30,6 +30,12 @@ - (id)initWithFrame:(CGRect)frame {
return self;
}
+- (id)initWithCoder:(NSCoder *)aDecoder {
+ if((self = [super initWithCoder:aDecoder])) {
+ }
+ return self;
+}
+
- (void)awakeFromNib {
self.reuseIdentifier = [self valueForKeyPath:@"reuseIdentifier"];
}
@@ -56,6 +62,7 @@ - (void)applyLayoutAttributes:(PSTCollectionViewLayoutAttributes *)layoutAttribu
- (void)willTransitionFromLayout:(PSTCollectionViewLayout *)oldLayout toLayout:(PSTCollectionViewLayout *)newLayout {
_reusableViewFlags.inUpdateAnimation = YES;
}
+
- (void)didTransitionFromLayout:(PSTCollectionViewLayout *)oldLayout toLayout:(PSTCollectionViewLayout *)newLayout {
_reusableViewFlags.inUpdateAnimation = NO;
}
View
10 PSTCollectionView/PSTCollectionViewLayout.m
@@ -110,20 +110,17 @@ - (BOOL)isCell {
return self.representedElementCategory == PSTCollectionViewItemTypeCell;
}
-- (void)setSize:(CGSize)size
-{
+- (void)setSize:(CGSize)size {
_size = size;
_frame = (CGRect){_frame.origin, _size};
}
-- (void)setCenter:(CGPoint)center
-{
+- (void)setCenter:(CGPoint)center {
_center = center;
_frame = (CGRect){{_center.x - _frame.size.width / 2, _center.y - _frame.size.height / 2}, _frame.size};
}
-- (void)setFrame:(CGRect)frame
-{
+- (void)setFrame:(CGRect)frame {
_frame = frame;
_size = _frame.size;
_center = (CGPoint){CGRectGetMidX(_frame), CGRectGetMidY(_frame)};
@@ -162,6 +159,7 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
}
return signature;
}
+
- (void)forwardInvocation:(NSInvocation *)invocation {
NSString *selString = NSStringFromSelector([invocation selector]);
if ([selString hasPrefix:@"_"]) {
Please sign in to comment.
Something went wrong with that request. Please try again.