iOS How to init a Binding value

운영 체제: macOS Ventura 13.0.1
사용 버전: Xcode 14.2, Swift, SwiftUI

iOS How to init a Binding value를 알아보겠습니다.


Binding을 사용해서 다른 변수로 넘겨주게 될 때, init을 어떻게 해야 하는지 알아봅시다.

14 번째 줄처럼, Binding으로 넘어오는 변수는 self._bindingTest로 받아줍니다. _(밑줄, underscore)을 넣어줘야 합니다.
그리고 24 번째 줄처럼 일반 String을 Binding<String>으로 변환 시키려면 .constant()를 사용합니다.





끝.


카테고리: iOS

댓글

이 블로그의 인기 게시물

Python OpenCV 빈 화면 만들기

Python urllib.parse.quote()

Python bytes.fromhex()

Android AVD Ram size change

Forensics .pyc 파일 .py로 복구하기

Android Minimum touch target size

KiCad 시작하기 7 (FreeRoute 사용하기 2)

Android Notification with Full Screen

C++ OpenCV 모폴로지 침식, 팽창

tensorflow tf.expand_dims()