Skip to content

Commit

Permalink
Centralize missing readme string (#1479)
Browse files Browse the repository at this point in the history
  • Loading branch information
laminesm committed Jan 4, 2023
1 parent d9527fe commit 7f0dd6b
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 16 deletions.
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
4 changes: 1 addition & 3 deletions ios/FluentUI.Demo/FluentUI.Demo/ReadmeViewController.swift
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

0 comments on commit 7f0dd6b

Please sign in to comment.