Skip to content
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

ReadmeViewController improvements #1479

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import UIKit
class BadgeFieldDemoController: DemoController {
override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

let badgeDataSources1 = [
BadgeViewDataSource(text: "Kat Larsson", style: .default),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class CardViewDemoController: DemoController {
override func viewDidLoad() {
super.viewDidLoad()

readmeString = "< Documentation will be added soon >"
container.alignment = .leading

let demoIcon = UIImage(named: "flag-24x24")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class IndeterminateProgressBarDemoController: DemoTableViewController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"
tableView.register(TableViewCell.self, forCellReuseIdentifier: TableViewCell.identifier)
tableView.register(BooleanCell.self, forCellReuseIdentifier: BooleanCell.identifier)
tableView.register(ActionsCell.self, forCellReuseIdentifier: ActionsCell.identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class LabelDemoController: DemoController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

addLabel(text: "Text Styles", style: .headline, colorStyle: .regular).textAlignment = .center
for style in TextStyle.allCases {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class OtherCellsDemoController: DemoController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

tableView = UITableView(frame: view.bounds, style: .grouped)
tableView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class PeoplePickerDemoController: DemoController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

asyncImageSwitch.addTarget(self, action: #selector(onAsyncImageSwitchValueChanged), for: .valueChanged)
setupView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ let searchDirectoryPersonas: [PersonaData] = [
class PersonaListViewDemoController: DemoController {
override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

let personaListView = PersonaListView()
personaListView.personaList = samplePersonas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import UIKit
class PillButtonDemoController: DemoController {
override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

for style in buttonStyles {
addTitle(text: "\(style.0) style")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class SearchBarDemoController: DemoController, SearchBarDelegate {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

let searchBarNoAutocorrect = buildSearchBar(autocorrectionType: .no, placeholderText: "no autocorrect")
let searchBarAutocorrect = buildSearchBar(autocorrectionType: .yes, placeholderText: "autocorrect")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ShimmerViewDemoController: DemoController {
override func viewDidLoad() {
super.viewDidLoad()

readmeString = "A shimmer let’s people know that information is loading and gives them an idea of the structure of the information.\n\nUse shimmers for loading states that take longer than one second but avoid them for long loading processes. They are indeterminate indicators, so they don’t communicate how much time is left before the process is done. Seeing a shimmer for too long could make people think something’s gone wrong."
readmeString = "A shimmer lets people know that information is loading and gives them an idea of the structure of the information.\n\nUse shimmers for loading states that take longer than one second but avoid them for long loading processes. They are indeterminate indicators, so they don’t communicate how much time is left before the process is done. Seeing a shimmer for too long could make people think something’s gone wrong."
let contentView = { () -> UIStackView in
let label1 = UILabel()
label1.text = "Label 1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class TableViewCellDemoController: DemoTableViewController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

tableView.register(TableViewCell.self, forCellReuseIdentifier: TableViewCell.identifier)
tableView.register(TableViewHeaderFooterView.self, forHeaderFooterViewReuseIdentifier: TableViewHeaderFooterView.identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class TableViewCellFileAccessoryViewDemoController: DemoTableViewController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

dateTimePicker.delegate = self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class TableViewHeaderFooterViewDemoController: DemoController {

override func viewDidLoad() {
super.viewDidLoad()
readmeString = "< Documentation will be added soon >"

container.heightAnchor.constraint(equalTo: scrollingContainer.heightAnchor).isActive = true
container.layoutMargins = .zero
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class ReadmeViewController: UIViewController {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

if let readmeString = readmeString {
readmeLabel.text = readmeString
}
readmeLabel.text = readmeString ?? "< Documentation will be added soon >"

let popoverHeight = readmeLabel.frame.height + Constants.topPadding
preferredContentSize = CGSize(width: Constants.popoverWidth, height: popoverHeight)
Expand Down