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 Tutorial2.md #130

Merged
merged 4 commits into from
Aug 4, 2020
Merged
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
28 changes: 14 additions & 14 deletions Documentation/Tutorials/Tutorial2.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ struct ReceiptElement: ProxyElement {
label.color = .darkGray

let inset = Inset(
wrapping: label,
uniformInset: 24.0)
uniformInset: 24.0,
wrapping: label)

var scrollView = ScrollView(wrapping: inset)
scrollView.contentSize = .fittingHeight // Stretches content to fill width, but sizes height to fit
Expand Down Expand Up @@ -201,14 +201,14 @@ struct LineItemElement: ProxyElement {

row.horizontalUnderflow = .spaceEvenly

var titleLabel = Label(text: title)
let titleLabel = Label(text: title)
row.add(child: titleLabel)

let formatter = NumberFormatter()
formatter.numberStyle = .currency
let formattedPrice = formatter.string(from: NSNumber(value: price)) ?? ""

var priceLabel = Label(text: formattedPrice)
let priceLabel = Label(text: formattedPrice)
row.add(child: priceLabel)

}
Expand Down Expand Up @@ -273,8 +273,8 @@ struct ReceiptElement: ProxyElement {
}

let inset = Inset(
wrapping: column,
uniformInset: 24.0)
uniformInset: 24.0,
wrapping: column)

var scrollView = ScrollView(wrapping: inset)
scrollView.contentSize = .fittingHeight
Expand Down Expand Up @@ -316,8 +316,8 @@ struct ReceiptElement: ProxyElement {
}

let inset = Inset(
wrapping: column,
uniformInset: 24.0)
uniformInset: 24.0,
wrapping: column)

var scrollView = ScrollView(wrapping: inset)
scrollView.contentSize = .fittingHeight
Expand Down Expand Up @@ -374,8 +374,8 @@ struct ReceiptElement: ProxyElement {
}

let inset = Inset(
wrapping: column,
uniformInset: 24.0)
uniformInset: 24.0,
wrapping: column)

var scrollView = ScrollView(wrapping: inset)
scrollView.contentSize = .fittingHeight
Expand All @@ -399,8 +399,8 @@ import BlueprintUICommonControls
struct RuleElement: ProxyElement {
var elementRepresentation: Element {
return ConstrainedSize(
wrapping: Box(backgroundColor: .black),
height: .absolute(1.0))
height: .absolute(1.0),
wrapping: Box(backgroundColor: .black))
}
}
```
Expand Down Expand Up @@ -568,8 +568,8 @@ struct ReceiptElement: ProxyElement {
}

let inset = Inset(
wrapping: column,
uniformInset: 24.0)
uniformInset: 24.0,
wrapping: column)

var scrollView = ScrollView(wrapping: inset)
scrollView.contentSize = .fittingHeight
Expand Down