This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '0.9.x' into feature-0.11
- Loading branch information
Showing
16 changed files
with
191 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// This file is part of Akane | ||
// | ||
// Created by Pascal Drouilly on 16/09/15. | ||
// For the full copyright and license information, please view the LICENSE | ||
// file that was distributed with this source code | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <UIKit/UIKit.h> | ||
#import "UICollectionReusableView+AKNReusableView.h" | ||
|
||
@protocol AKNViewComponent; | ||
|
||
@interface AKNCollectionReusableView : UICollectionReusableView | ||
|
||
@property(nonatomic, strong)IBOutlet UIView<AKNViewComponent> *itemView; | ||
|
||
+ (instancetype)reusableViewWithItemView:(UIView<AKNViewComponent> *)itemView; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// This file is part of Akane | ||
// | ||
// Created by Pascal Drouilly on 16/09/15. | ||
// For the full copyright and license information, please view the LICENSE | ||
// file that was distributed with this source code | ||
// | ||
|
||
#import "AKNCollectionReusableView.h" | ||
#import "AKNViewModel.h" | ||
#import "AKNViewComponent.h" | ||
|
||
@implementation AKNCollectionReusableView | ||
|
||
@synthesize itemView = _itemView; | ||
|
||
+ (instancetype)reusableViewWithItemView:(UIView<AKNViewComponent> *)itemView { | ||
return [[self alloc] initWithCellWithItemView:itemView]; | ||
} | ||
|
||
- (instancetype)initWithCellWithItemView:(UIView<AKNViewComponent> *)itemView { | ||
if (!(self = [super init])) { | ||
return nil; | ||
} | ||
|
||
self.itemView = itemView; | ||
|
||
return self; | ||
} | ||
|
||
- (void)setItemView:(UIView<AKNViewComponent> *)itemView { | ||
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(itemView); | ||
|
||
if (itemView == _itemView) { | ||
return; | ||
} | ||
|
||
[_itemView removeFromSuperview]; | ||
_itemView = itemView; | ||
itemView.translatesAutoresizingMaskIntoConstraints = NO; | ||
|
||
[self addSubview:itemView]; | ||
|
||
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[itemView]|" | ||
options:0 | ||
metrics:0 | ||
views:viewsDictionary]]; | ||
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[itemView]|" | ||
options:0 | ||
metrics:0 | ||
views:viewsDictionary]]; | ||
} | ||
|
||
@end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Akane/View/Collection/UIKit/UICollectionReusableView+AKNReusableView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// This file is part of Akane | ||
// | ||
// Created by Pascal Drouilly on 16/09/15. | ||
// For the full copyright and license information, please view the LICENSE | ||
// file that was distributed with this source code | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <UIKit/UIKit.h> | ||
#import "AKNReusableView.h" | ||
|
||
@interface UICollectionReusableView (AKNReusableView) <AKNReusableView> | ||
|
||
@end |
Oops, something went wrong.