목록Swift (208)
HIT해

https://developer.apple.com/documentation/scenekit/scnview/2867336-defaultcameracontroller defaultCameraController | Apple Developer DocumentationThere's never been a better time to develop for Apple platforms.developer.apple.com 카메라 제어 허용더보기var allowsCameraControl: Bool A Boolean value that determines whether the user can manipulate the current point of view that is used to render the scene. 사..

https://developer.apple.com/documentation/scenekit/scnlight SCNLight | Apple Developer DocumentationA light source that can be attached to a node to illuminate the scene.developer.apple.com 예시사진 위 사진과 같이 모델 아랫 부분에 그림자가 생성되게 만들어야한다. 기존 조명중 특정한 조명에 그림자가 지게 설정해주면 된다고 한다! castsShadow를 활용해서 만들어보자. https://stackoverflow.com/questions/59818131/scenekit-and-arkit-soft-shadows-or-blurred-shadows SceneKit..

전체 소스 코드import ComposableArchitectureimport SwiftUIprivate let readMe = """ This screen demonstrates how changes to application state can drive animations. Because the \ `Store` processes actions sent to it synchronously you can typically perform animations in the \ Composable Architecture just as you would in regular SwiftUI. To animate the changes made to state when an action is sent to th..

precondition란?Swift에서 특정 조건이 반드시 참이어야 하는 상황에서 사용하는 함수다.주로 디버깅과 안전한 코드 작성을 위해 사용되며, 프로그램이 예상하지 못한 상태로 진행되지 않도록 한다.precondition은 런타임에 조건을 확인하고, 조건이 거짓일 경우 프로그램을 종료시키며, 주로 논리적 오류를 확인하는 데 사용된다. precondition의 기본 개념func precondition(_ condition: @autoclosure () -> Bool,_ message: @autoclosure () -> String = "",file: StaticString = #file, line: UInt = #line)condition : Bool 값을 반환하는 조건식, 이 조건이 false 일 ..

backtick이란?` Swift에서 백틱을 활용하면 변수 이름으로 지정 못하는 것들을 이름으로 지정할 수 있다. 사용 예시var var = "흰둥이" // 오류var `var` = "흰둥이"

https://github.com/pointfreeco/swift-composable-architecture?tab=readme-ov-file#examples GitHub - pointfreeco/swift-composable-architecture: A library for building applications in a consistent and understandable way,A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind. - pointfreeco/swift-composable-architecturegithub.com 해..

CustomStringConvertible이란?Swift 표준 라이브러리에서 제공하는 프로토콜로, 객체를 사용자 정의 문자열로 표현할 수 있게 해준다.이 프로토콜을 채택한 타입은 description이라는 문자열 속성을 구현하여 해당 객체의 맞춤형 설명을 제공한다. CustomStringConvertible의 기본 개념CustomStringConvertible은 하나의 요구사항만 가지고 이싿.description이라는 읽기 전용 속성을 구현하는 것이다. 이 속성은 객체를 설명하는 문자열을 반환합니다.protocol CustomStringConvertible { var description: String { get }} CustomStringConvertible 사용 예제struct Person:..

https://developer.apple.com/documentation/scenekit/scnnode SCNNode | Apple Developer DocumentationA structural element of a scene graph, representing a position and transform in a 3D coordinate space, to which you can attach geometry, lights, cameras, or other displayable content.developer.apple.com 기존 모델에 다른 모델의 특정 노드를 불러와보자! 기존 3D 모델이다 현재 상태로도 굉장히 귀엽지만 엑세서리를 모델에서 원하는 노드를 불러와서 합쳐줄 것이다. 추가하려는 모델..