From 8ca5f82951491e642ecd151770e09f4a1aef7ca4 Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Mon, 25 Dec 2017 19:11:58 -0500 Subject: [PATCH 1/2] [ASCellNode] Adds mapping for UITableViewCell focusStyle --- CHANGELOG.md | 1 + Source/ASCellNode.h | 6 ++++++ Source/ASCellNode.mm | 1 + Source/ASTableView.mm | 4 ++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c83558f..a75e82212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) - [ASNetworkImageNode] Deprecates .URLs in favor of .URL [Garrett Moon](https://github.com/garrettmoon) [#699](https://github.com/TextureGroup/Texture/pull/699) - [iOS11] Update project settings and fix errors [Eke](https://github.com/Eke) [#676](https://github.com/TextureGroup/Texture/pull/676) - [ASCollectionView] Improve performance and behavior of rotation / bounds changes. [Scott Goodson](https://github.com/appleguy) [#431](https://github.com/TextureGroup/Texture/pull/431) diff --git a/Source/ASCellNode.h b/Source/ASCellNode.h index 2c911f17a..b846e549d 100644 --- a/Source/ASCellNode.h +++ b/Source/ASCellNode.h @@ -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. diff --git a/Source/ASCellNode.mm b/Source/ASCellNode.mm index 400be0796..7cf3d0d65 100644 --- a/Source/ASCellNode.mm +++ b/Source/ASCellNode.mm @@ -58,6 +58,7 @@ - (instancetype)init // Use UITableViewCell defaults _selectionStyle = UITableViewCellSelectionStyleDefault; + _focusStyle = UITableViewCellFocusStyleDefault; self.clipsToBounds = YES; return self; diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 4d9d01f81..9d5801593 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -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) From 50c2f1b2b55912b3ceee9b0fce24457286507fb2 Mon Sep 17 00:00:00 2001 From: Alex Hill Date: Mon, 25 Dec 2017 19:14:37 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c49f393..405edec80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +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) +- [ASCellNode] Adds mapping for UITableViewCell focusStyle [Alex Hill](https://github.com/alexhillc) [#727](https://github.com/TextureGroup/Texture/pull/727) - [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) - [ASCollectionView] Add missing flags for ASCollectionDelegate [Ilya Zheleznikov](https://github.com/ilyailya) [#718](https://github.com/TextureGroup/Texture/pull/718) - [ASNetworkImageNode] Deprecates .URLs in favor of .URL [Garrett Moon](https://github.com/garrettmoon) [#699](https://github.com/TextureGroup/Texture/pull/699)