0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SwiftUI boldのModifierが冗長だった件について

Last updated at Posted at 2024-06-06

背景

今までTextに対して、.font(.system(size: ))のModifierを付与しているときも.bold()のModifierを付与していました。
なんとなくFigmaのPluginsの SwiftUI Inspector使った時に、
.font(.system(size: 14, weight: .bold))を提案されました。

1行で済むのか…

これは盲点でした。

Before

Text("Hello World")
    .bold()
    .font(.system(size: 16))

After

Text("Hello World")
    .font(.system(size: 16, weight: .bold))

Figma の SwiftUI Inspector

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?