Conversation
| public var tintColor: UIColor? | ||
| /// The default spacing to use when laying out content in the view. | ||
| public var layoutMargins: UIEdgeInsets? | ||
| /// The radius to use when drawing rounded corners for the layer’s background. |
There was a problem hiding this comment.
what is this spacing? 😬
alinebee
left a comment
There was a problem hiding this comment.
🤔Maybe mark all these docs files as autogen files in .gitattributes so that github will collapse them by default.
| import Foundation | ||
| import UIKit | ||
|
|
||
| /// The actions property exposed on the CellConfigType represents possible events that will be executed based on the users interaction with that particular cell. Of note are the `selectionAction` and `previewingViewControllerAction`. The `selectionAction` is executed when the user taps on that particular cell. The main use case for this is present a new detail view controller or a modal (but is not constrained to these actions, these are just the common use cases). The `previewingViewControllerAction` is responsible for returning an instance of a UIViewController that will be shown when a user 3D-touches on a cell. |
There was a problem hiding this comment.
This comment is a duplicate of the comment for CellActions, it does not document CellStyle.
Also line breaks are nice 🙈
Also missing apostrophe: user's interaction
There was a problem hiding this comment.
Ah I forgot to delete that, I was just testing how it rendered
| /// The actions property exposed on the CellConfigType represents possible events that will be executed based on the users interaction with that particular cell. Of note are the `selectionAction` and `previewingViewControllerAction`. The `selectionAction` is executed when the user taps on that particular cell. The main use case for this is present a new detail view controller or a modal (but is not constrained to these actions, these are just the common use cases). The `previewingViewControllerAction` is responsible for returning an instance of a UIViewController that will be shown when a user 3D-touches on a cell. | ||
| public struct CellStyle { | ||
| public static var selectionColor: UIColor? = nil // TODO: make this not a static like this | ||
| /// The style to apply to the bottom separator in the cell. |
There was a problem hiding this comment.
For all these separator properties I would say:
The style of separator line to display along the [top/bottom] of the cell. If `nil`, the containing `TableSection` may override the [top/bottom] separator based on its own `SeparatorStyle`.
There was a problem hiding this comment.
I'll leave TableSection to handle that in their docs tho
| /// | ||
| /// Supported by UITableView only. | ||
| public var topSeparator: Separator.Style? | ||
| /// The color of separator rows in the cell. |
There was a problem hiding this comment.
Clarification: lines, not rows (rows can be confused with the cells themselves.)
| /// | ||
| /// Supported by UITableView only. | ||
| public var accessoryType: UITableViewCellAccessoryType = .none | ||
| /// The view's selection color. |
There was a problem hiding this comment.
Suggest:
The cell's background color while selected.
If `nil`, the cell's regular `backgroundColor` or `backgroundView` will be shown instead.
You could also move this property below backgroundColor.
| public var accessoryType: UITableViewCellAccessoryType = .none | ||
| /// The view's selection color. | ||
| public var selectionColor: UIColor? = CellStyle.selectionColor | ||
| /// The view's background color. |
There was a problem hiding this comment.
Suggest:
The background color to show behind the cell's content. Only used if `backgroundView` is `nil`.
| public var selectionColor: UIColor? = CellStyle.selectionColor | ||
| /// The view's background color. | ||
| public var backgroundColor: UIColor? | ||
| /// The view that is displayed behind the cell’s other content. |
There was a problem hiding this comment.
Suggest:
An optional view to display behind the cell's content. Overrides `backgroundColor` if specified.
| /// The actions property exposed on the CellConfigType represents possible events that will be executed based on the users interaction with that particular cell. Of note are the `selectionAction` and `previewingViewControllerAction`. The `selectionAction` is executed when the user taps on that particular cell. The main use case for this is present a new detail view controller or a modal (but is not constrained to these actions, these are just the common use cases). The `previewingViewControllerAction` is responsible for returning an instance of a UIViewController that will be shown when a user 3D-touches on a cell. | ||
| public struct CellActions { | ||
| /// The possible states a cell can be when a selection action is performed on it. | ||
| public enum SelectionState { |
There was a problem hiding this comment.
This comment does not reflect the purpose of the enum. Suggest:
Returned by `SelectionAction` to indicate whether the cell should be left selected or deselected after the user taps on it.
| public var tintColor: UIColor? | ||
| /// The default spacing to use when laying out content in the view. | ||
| public var layoutMargins: UIEdgeInsets? | ||
| /// The radius to use when drawing rounded corners for the layer’s background. |
There was a problem hiding this comment.
Nice copypasta from the Apple docs 😁 but our cornerRadius doesn't just affect the background; masksToBounds causes the radius to also clip everything within the cell.
There was a problem hiding this comment.
Did that for all the "iOS" properties, background views, colour, etc
PRs welcome 😉 |
Added documentation for CellStyle. Now that we have support for
jazzydocs, we should automate its generation every time we make changes 543d510The "meat" of this PR is on the first 2 commits, the 3rd one is generated documentation.