LoginSignup
0
0

SwiftUI 本変更

Posted at

Screenshot 2023-12-19 at 10.25.17 AM.png
ほんを変更しました。
しばらく急いで前の簡単な部分を調べて通り過ぎるつもりです。

image.png

var num:Int {
    2*5
    }
print(num)
>> 10

IMG_2448.jpeg

Computedプロパティ

値の取得のみが
image.png

Click Modifier specification

Screenshot 2023-12-17 at 12.19.29 PM.png

Xcode15.0でbugかないか分からないですけど
既存のdragAndDrop とか clickInspecter などがかなり変更されるとか削除されました

Screenshot 2023-12-17 at 5.27.21 PM.png

ドット

.font(.title) 

実はこれかっこの
複数の余白を指定する
.padding([.top,.leading]

Screenshot 2023-12-17 at 9.01.36 PM.png
Screenshot 2023-12-17 at 9.02.16 PM.png

scaledFitはAspectRatio()を代替できます。
Screenshot 2023-12-17 at 10.11.22 PM.png
Screenshot 2023-12-17 at 10.13.43 PM.png

.foregroundColor(.blue) // color.blueが省略されること
.fill(Color.blue) // ここでは省略できません![Screenshot 2023-12-18 at 10.41.08 AM.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3513806/ec61d841-2869-8f0b-1355-875c74c42a23.png)

Screenshot 2023-12-18 at 12.35.31 AM.png
Screenshot 2023-12-18 at 12.38.41 AM.png

Screenshot 2023-12-18 at 12.53.12 AM.png
Screenshot 2023-12-18 at 12.58.45 AM.png
Screenshot 2023-12-18 at 9.30.50 AM.png
Screenshot 2023-12-18 at 9.46.34 AM.png
Screenshot 2023-12-18 at 10.07.49 AM.png
Screenshot 2023-12-18 at 10.23.06 AM.png
Screenshot 2023-12-18 at 10.41.08 AM.png
Screenshot 2023-12-18 at 11.15.55 AM.png
Screenshot 2023-12-18 at 11.48.41 AM.png
Screenshot 2023-12-18 at 2.14.31 PM.png

foregroundColor(_:content:).

It's worth noting that in Swift, there is a convention to use underscores (_) for the first parameter of a function to allow a cleaner syntax when calling the function. This is why you often see functions in SwiftUI with an underscore for the first parameter,

Screenshot 2023-12-18 at 2.34.45 PM.png
Screenshot 2023-12-18 at 3.21.33 PM.png
Screenshot 2023-12-18 at 3.42.10 PM.png
Screenshot 2023-12-18 at 4.21.52 PM.png
Screenshot 2023-12-18 at 4.55.01 PM.png
Screenshot 2023-12-18 at 5.35.46 PM.png

SFシンボルを活用する

Screenshot 2023-12-18 at 5.17.51 PM.png
Screenshot 2023-12-18 at 5.37.16 PM.png
Screenshot 2023-12-18 at 5.46.37 PM.png
階層レンダリングモードはsymbolRenderingMode(.hierachical)で指定されます。

Screenshot 2023-12-18 at 6.00.43 PM.png
Screenshot 2023-12-18 at 6.07.06 PM.png

Screenshot 2023-12-19 at 9.30.08 AM.png

Screenshot 2023-12-19 at 10.00.59 AM.png

Screenshot 2023-12-19 at 10.07.55 AM.png

0
0
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
0