2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

状態変数(@Binding)を初期化する際には_(アンダースコア)が必要らしい

Last updated at Posted at 2022-05-29

状態変数(@Binding)を初期化する際には_(アンダースコア)が必要らしい

TextArea.swift
struct TextArea: View {
    @Binding var text : String
    let placeholder : String
    
    init(placeholder : String , text: Binding<String>){
        self.placeholder = placeholder
        //変数名の前に_(アンダースコア)が必要
        self._text = text
        UITextView.appearance().backgroundColor = .clear
    }
}
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?