본문 바로가기

PROGRAMMING CODE/SWIFT68

[SwiftUI] Extra arguments at positions #11, #12 in call 1개의 뷰에 10개 이상의 뷰를 넣을 수 없음. 15개의 Text 뷰에서 1개의 Group, 7개의 Text로 만들어줘서 총 8개이기 때문에 가능한것 이 Group 또한 10개가 넘어가면 오류가 발생하니 주의! 2023. 8. 5.
[SwiftUI] ScrollView 사용법 스크롤뷰 command + 클릭해보면 Show Quick Help라는 유용한 기능이 있음! View를 상속받으며, 디폴드값은 .vertical로 이것은 아래위 스크롤이다. ScrollView(.horizontal)을 이용해 가로 스크롤또한 사용할 수 있다. 현재 사용한 코드는 가로와 세로 모두 스크롤이 가능 2023. 8. 5.
[Swift] apple tutorials https://developer.apple.com/tutorials/app-dev-training/decoding-structured-json Decoding structured JSON | Apple Developer Documentation In this tutorial, you’ll use Swift APIs to decode earthquake information that the USGS provides. The USGS encodes the earthquake observations in JSON format, which is a popular choice for providing data on the web. You’ll access child objects within a developer.. 2023. 8. 5.
[SwiftUI] 함수로 버튼뷰 리턴받기 (some View 개념) https://da-ye.tistory.com/189 [SwiftUI] 버튼을 함수로 리턴하기func buildButton(parameter : Parameter) -> Button버튼 함수의 형식 func buildButton() -> Button { return Button { } label: { Text("첫번째 버튼입니다.") } }이런식으로 label 내 요소가 존재한다면 안에 표시해주어야함da-ye.tistory.com위와 같이 형식만 알아보고 간단한 버튼은 리턴 받았었는데, 아래와 같이 코드를 짜니 오류가 와장창,,, 여러 스타일들이 추가돼서 그런것같다 func intBtn(_ index : Int, _ num : Int) -> Button { return Button { } label: {.. 2023. 6. 30.