Open
Conversation
Static/Row.swift
Outdated
|
|
||
| public init(text: String? = nil, detailText: String? = nil, selection: Selection? = nil, | ||
| image: UIImage? = nil, accessory: Accessory = .None, cellClass: CellType.Type? = nil, context: Context? = nil, editActions: [EditAction] = [], UUID: String = NSUUID().UUIDString) { | ||
| image: UIImage? = nil, accessory: Accessory = .None, cellClass: CellType.Type? = nil, context: Context? = nil, editActions: [EditAction] = [], copyAction: CopyAction? = nil, UUID: String = NSUUID().UUIDString) { |
Contributor
There was a problem hiding this comment.
What do you think about reverting this whitespace change at the beginning of the line? Agreed that this init takes in a lot of parameters and could use some better clarity, but it might be best to scope that out to a different PR. 😄
Contributor
|
TIL about those other I'd love to have this more generic than only supporting Perhaps something like: enum RowAction {
case Copy(Row -> Void)
case Paste(Row -> Void)
}I've honestly not used this table view API enough to know use-cases! Would love to learn more. |
* commit '8a05589ea367f568542a536ad0bfe7d4731ddded': Update readme with Swift version compatibility table Update test target to Swift 2.3 Update to recommended build settings Migrate to Swift 2.3 Update podspec to 1.1.1 Add gitignore
946a03d to
321e997
Compare
# Conflicts: # Example/CustomTableViewCell.swift # Example/ViewController.swift # Example/WindowController.swift # Static.podspec # Static.xcodeproj/project.pbxproj # Static/ButtonCell.swift # Static/Cell.swift # Static/DataSource.swift # Static/Row.swift # Static/Section.swift # Static/SubtitleCell.swift # Static/TableViewController.swift # Static/Value1Cell.swift # Static/Value2Cell.swift
dmiluski
reviewed
Dec 14, 2017
| public func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath?, withSender sender: Any?) -> Bool { | ||
| guard let indexPath = indexPath else { return false } | ||
| public func tableView(_ tableView: UITableView, canPerformAction action: Selector, forRowAt indexPath: IndexPath, withSender sender: Any?) -> Bool { | ||
| return action == #selector(UIResponder.copy(_:)) && (row(at: indexPath)?.canCopy ?? false) |
Contributor
There was a problem hiding this comment.
Does this need to be tied to a specific selector case?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80