iOS How to init a State value

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

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


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


14 번째 줄처럼 self._stateTest로 초기화를 시킵니다. _(밑줄, underscore)를 사용합니다. 일반 String을 State<String>(initialValue:)를 사용해서 State로 만듭니다.





끝.


카테고리: 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)

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

Android Notification with Full Screen

tensorflow tf.expand_dims()