Skip to content

Commit

Permalink
[ASCellNode] focusStyle mapping (#727)
Browse files Browse the repository at this point in the history
* [ASCellNode] Adds mapping for UITableViewCell focusStyle

* Update CHANGELOG.md
  • Loading branch information
alexhillc authored and maicki committed Jan 31, 2018
1 parent ea54727 commit 0bb5355
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## master
* Add your own contributions to the next release on the line below this with your name.
- [ASCellNode] Adds mapping for UITableViewCell focusStyle [Alex Hill](https://github.com/alexhillc) [#727](https://github.com/TextureGroup/Texture/pull/727)
- [ASNetworkImageNode] Fix capturing self in the block while loading image in ASNetworkImageNode. [Denis Mororozov](https://github.com/morozkin) [#777](https://github.com/TextureGroup/Texture/pull/777)
- [ASTraitCollection] Add new properties of UITraitCollection to ASTraitCollection. [Yevgen Pogribnyi](https://github.com/ypogribnyi)
- [ASRectMap] Replace implementation of ASRectTable with a simpler one based on unordered_map.[Scott Goodson](https://github.com/appleguy) [#719](https://github.com/TextureGroup/Texture/pull/719)
Expand Down
6 changes: 6 additions & 0 deletions Source/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
*/
@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;

/* @abstract The focus style when a cell is focused
* @default UITableViewCellFocusStyleDefault
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
*/
@property (nonatomic) UITableViewCellFocusStyle focusStyle;

/* @abstract The view used as the background of the cell when it is selected.
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
* ASCollectionView uses these properties when configuring UICollectionViewCells that host ASCellNodes.
Expand Down
1 change: 1 addition & 0 deletions Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ - (instancetype)init

// Use UITableViewCell defaults
_selectionStyle = UITableViewCellSelectionStyleDefault;
_focusStyle = UITableViewCellFocusStyleDefault;
self.clipsToBounds = YES;

return self;
Expand Down
4 changes: 2 additions & 2 deletions Source/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ - (void)setElement:(ASCollectionElement *)element

if (node) {
self.backgroundColor = node.backgroundColor;
self.selectionStyle = node.selectionStyle;
self.selectedBackgroundView = node.selectedBackgroundView;
self.separatorInset = node.separatorInset;
self.selectionStyle = node.selectionStyle;
self.selectionStyle = node.selectionStyle;
self.focusStyle = node.focusStyle;
self.accessoryType = node.accessoryType;

// the following ensures that we clip the entire cell to it's bounds if node.clipsToBounds is set (the default)
Expand Down

0 comments on commit 0bb5355

Please sign in to comment.