-
Notifications
You must be signed in to change notification settings - Fork 297
Settings: tableview section separator #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
92876a9
to
c9a6d67
Compare
public let tableHeader: UIFont | ||
|
||
public init(tableHeader: UIFont) { | ||
self.tableHeader = tableHeader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason why we would want this class to be public
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I guess it's unnecessary
@objc static let identifier = String(describing: VLCSettingsTableHeaderView.self) | ||
@objc var headerLabel: UILabel! | ||
@objc var separator: UIView! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about initializing them directly here?
For example:
@objc var separator: UIView = {
let separator = UIView()
separator.backgroundColor = PresentationTheme.current.colors.separatorColor
separator.translatesAutoresizingMaskIntoConstraints = false
return separator
}()
This will make the init clearer by only having the addSubView()
calls and the constraints stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I always forget you can do this :D
override init(reuseIdentifier: String?) { | ||
super.init(reuseIdentifier: reuseIdentifier) | ||
|
||
constraints.forEach { $0.priority = UILayoutPriority(rawValue: 999) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better if we use .required - 1
here.
c9a6d67
to
c060f4b
Compare
import UIKit | ||
|
||
class VLCSettingsTableHeaderView: UITableViewHeaderFooterView { | ||
let headerHeight: CGFloat = 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to expose this outside of this class? If not we should consider "privatizing" it 😄
81024f3
to
38008ad
Compare
|
||
let tableHeader: UIFont | ||
|
||
init(tableHeader: UIFont) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tableHeaderFont
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section | ||
{ | ||
return nil; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be deleted it will fall back to viewForHeaderInSection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm without it, the header titles come out capitalized. I think this is because InAppSettings has a default titleForHeaderInSection
|
||
import UIKit | ||
|
||
class VLCSettingsTableHeaderView: UITableViewHeaderFooterView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you adjust this to the new class VLCSectionTableHeaderView?
38008ad
to
e936967
Compare
merged with 7ea7027 and following |
Checklist
bundle exec fastlane test
from the root directory to see all new and existing tests passbundle exec fastlane lint
to ensure the code style is validDescription
Added a separator in-between tableview sections.