Skip to content

Documented CellStyle#90

Merged
raulriera merged 3 commits intomasterfrom
more-docs
May 16, 2018
Merged

Documented CellStyle#90
raulriera merged 3 commits intomasterfrom
more-docs

Conversation

@raulriera
Copy link
Copy Markdown
Contributor

@raulriera raulriera commented May 15, 2018

Added documentation for CellStyle. Now that we have support for jazzy docs, we should automate its generation every time we make changes 543d510

The "meat" of this PR is on the first 2 commits, the 3rd one is generated documentation.

@raulriera raulriera requested review from alinebee and krbarnes May 15, 2018 20:15
Comment thread FunctionalTableData/CellStyle.swift Outdated
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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this spacing? 😬

Copy link
Copy Markdown
Contributor

@alinebee alinebee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔Maybe mark all these docs files as autogen files in .gitattributes so that github will collapse them by default.

Comment thread FunctionalTableData/CellStyle.swift Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave TableSection to handle that in their docs tho

Comment thread FunctionalTableData/CellStyle.swift Outdated
///
/// Supported by UITableView only.
public var topSeparator: Separator.Style?
/// The color of separator rows in the cell.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread FunctionalTableData/CellStyle.swift Outdated
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.
Copy link
Copy Markdown
Contributor

@alinebee alinebee May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

@raulriera raulriera May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that for all the "iOS" properties, background views, colour, etc

@raulriera
Copy link
Copy Markdown
Contributor Author

🤔Maybe mark all these docs files as autogen files in .gitattributes so that github will collapse them by default.

PRs welcome 😉

@raulriera raulriera merged commit 5af436c into master May 16, 2018
@raulriera raulriera deleted the more-docs branch May 16, 2018 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants