Skip to content

Commit

Permalink
Update deprecated Label inits in demo app (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
huwilkes authored Oct 18, 2023
1 parent b091719 commit 056ecab
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ios/FluentUI.Demo/FluentUI.Demo/DemoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DemoController: UIViewController {
}

func addTitle(text: String) {
let titleLabel = Label(style: .body1Strong)
let titleLabel = Label(textStyle: .body1Strong)
titleLabel.text = text
titleLabel.textAlignment = .center
titleLabel.accessibilityTraits.insert(.header)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FluentUI
import UIKit

class DateTimePickerDemoController: DemoController {
private let dateLabel = Label(style: .body1Strong)
private let dateLabel = Label(textStyle: .body1Strong)
private let dateTimePicker = DateTimePicker()

private let datePickerTypeSelector: UISegmentedControl = {
Expand Down Expand Up @@ -166,7 +166,7 @@ class DateTimePickerDemoController: DemoController {
container.alignment = .center
container.distribution = .equalSpacing

let label = Label(style: .body1Strong, colorStyle: .regular)
let label = Label(textStyle: .body1Strong, colorStyle: .regular)
label.text = "Date picker type"
label.numberOfLines = 0
container.addArrangedSubview(label)
Expand All @@ -178,10 +178,10 @@ class DateTimePickerDemoController: DemoController {
}

func createCustomCalendarConfigurationUI() -> UIStackView {
let customCalendarConfigurationTitleLabel = Label(style: .body1Strong, colorStyle: .regular)
let customCalendarConfigurationTitleLabel = Label(textStyle: .body1Strong, colorStyle: .regular)
customCalendarConfigurationTitleLabel.text = "Custom calendar configuration"

let customCalendarConfigurationBodyLabel = Label(style: .caption1, colorStyle: .regular)
let customCalendarConfigurationBodyLabel = Label(textStyle: .caption1, colorStyle: .regular)
customCalendarConfigurationBodyLabel.text = "First weekday: Monday\nReference start date: Today\nReference end date: One month from today"
customCalendarConfigurationBodyLabel.numberOfLines = 0

Expand All @@ -206,7 +206,7 @@ class DateTimePickerDemoController: DemoController {
validationRow.alignment = .center
validationRow.distribution = .equalSpacing

let validationLabel = Label(style: .body1Strong, colorStyle: .regular)
let validationLabel = Label(textStyle: .body1Strong, colorStyle: .regular)
validationLabel.text = "Validate for date in future"

validationRow.addArrangedSubview(validationLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class NavigationControllerDemoController: DemoController {
}

private func presentSideDrawer(presentingGesture: UIPanGestureRecognizer? = nil) {
let meControl = Label(style: .title2, colorStyle: .regular)
let meControl = Label(textStyle: .title2, colorStyle: .regular)
meControl.text = "Me Control goes here"
meControl.textAlignment = .center

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TooltipDemoController: DemoController {
topContainer.addArrangedSubview(topleftButton)
topContainer.addArrangedSubview(topRightButton)

let middleLabel = Label(style: .body1Strong, colorStyle: .regular)
let middleLabel = Label(textStyle: .body1Strong, colorStyle: .regular)
middleLabel.text = "Press corner buttons to show offset tooltips"
middleLabel.numberOfLines = 0
middleLabel.textAlignment = .center
Expand Down
4 changes: 2 additions & 2 deletions ios/FluentUI.Demo/FluentUI.Demo/TableViewCellSampleData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class TableViewCellSampleData: TableViewSampleData {
]

static var customAccessoryView: UIView {
let label = Label(style: .body1, colorStyle: .secondary)
let label = Label(textStyle: .body1, colorStyle: .secondary)
label.text = "PowerPoint Presentation"
label.sizeToFit()
label.numberOfLines = 0
Expand Down Expand Up @@ -171,7 +171,7 @@ class TableViewCellSampleData: TableViewSampleData {
stackView.distribution = .fill
stackView.axis = .vertical

let label = Label(style: .caption1)
let label = Label(textStyle: .caption1)
label.textColor = stackView.fluentTheme.color(.foreground3)
label.text = text
stackView.addArrangedSubview(label)
Expand Down
2 changes: 1 addition & 1 deletion ios/docs/Controls/Label.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The design tokens determining the font size and weight represent Apple's fundame
### UIKit
```Swift
// Label with tokenized style/color
let label = Label(style: style, colorStyle: colorStyle)
let label = Label(textStyle: style, colorStyle: colorStyle)
label.text = text
label.numberOfLines = 0

Expand Down

0 comments on commit 056ecab

Please sign in to comment.