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

Update deprecated Label inits in demo app #1917

Merged
merged 2 commits into from
Oct 18, 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
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
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