목록언어/iOS (31)
Machineboy空

아이폰 2대를 가지고 A는 iBeacon으로 사용하고, B는 그 비콘을 탐지하는 기기로 사용하고 싶다.A에는 전파 느낌의 UI를 띄우고, B에는 A와의 실시간 거리 상태를 표시해보겠다.시도한 방법 1: CoreBlueTooth 사용튜토리얼https://www.youtube.com/watch?v=WFl4tnNWXP0 테스트 코드우선 Info.plist에 Privacy-Bluetooth Always Usage Description 을 추가해 준다.import SwiftUIimport CoreBluetoothstruct BeaconScanner: View { @StateObject private var beaconScannerClass = BeaconScannerClass() var body: s..

현재 걷고 있는지, 정지해있는지를 파악하고 싶다. 피크민 꽃 심기 모드 중에 운전을 하거나, 버스를 타면 운전중은 아닌지 물어보는 알림이 뜨는데,캡쳐를 해두지 못해 햄버거 피크민을 첨부한다.아무튼 기기의 움직임을 감지하는 기능을 구현하고자 한다.시도한 방법 1: CoreMotion - CMMotionActivity를 이용 CoreMotion 라이브러리 안에 CMMotionActivity라는 타입이 있는데, 기기의 움직임 분류해 주는 듯하다. 테스트코드import CoreMotionimport SwiftUIstruct CoreMotionView: View { @StateObject private var motionManager = CoreMotionManager() var body: s..

Beacon이란?근거리 통신 기술. 가까운 범위 안에 있는 사용자의 위치를 찾아, 메시지 전송, 모바일 결제 등을 가능하게 해주는 스마트폰 근거리 통신 기술로 저전력 블루투스(BLE, Bluetooth Low Energy)를 활용한 '모바일 위치 기반 서비스'작동 원리비콘은 신호를 전송하는 방법에 따라 사운드기반의 저주파 비콘, LED 비콘, WiFi 비콘,블루투스 비콘 등이 있다. 우리가 살펴볼 iBeacon은 블루투스 비콘에 해당한다. 비콘 단말기가 부착된 범위 내에 스마트폰을 가진 사람이 들어오면, 단말기는 특정 ID값을 내보낸다. 그러면 스마트폰 단말기로부터 받은 ID값을 인식하여 서버로 전달하게 된다. ID를 가지고 있는 서버는 위치를 확인하게 되고 해당위치에 설정된 이벤트나 서비스 정보를 스마..

ARGeoAnchorhttps://developer.apple.com/documentation/arkit/argeotrackingconfiguration ARGeoTrackingConfiguration | Apple Developer DocumentationA configuration that tracks locations with GPS, map data, and a device's compass.developer.apple.com 절망스럽게도 supported Area 명단에 Korea는 없다..나 애플에 일조할 수 있는 건가..?https://developer.apple.com/documentation/arkit/arsession/recording_and_replaying_ar_session_dat..
Saving world mapuserDefault를 사용해서 AnchorEntity가 아닌 ARKit의 ARAnchor를 저장하고 껐다 켰을 때 불러올 것이다. // 오류가 있는지.. 작동을 안함 어쩌다 한번 작동된다 나중에 다시 오리!import Foundationimport ARKitimport RealityKitclass Coordinator: NSObject, ARSessionDelegate { let vm: ViewModel var arView: ARView? init(vm: ViewModel) { self.vm = vm } @objc func onTap(_ recognizer: UITapGestureRecognizer) { ..

거리 측정sim_distance() 사용 UI와 연동import Foundationimport RealityKitimport SwiftUIclass Coordinator { var arView: ARView? var startAnchor:AnchorEntity? var endAnchor:AnchorEntity? lazy var measurementButton: UIButton = { let button = UIButton(configuration: .filled()) button.setTitle("0.00", for: .normal) button.translatesAutoresizingMaskIntoConstraints = false ..

PhysicsBodyComponent, generateCollisionShapesfunc makeUIView(context: Context) -> ARView { let arView = ARView(frame: .zero) /// 땅에 콜라이더 설치 let planeAnchorEntity = AnchorEntity(plane: .horizontal) let plane = ModelEntity(mesh: MeshResource.generatePlane(width: 1, height: 1), materials: [SimpleMaterial(color: .orange, isMetallic: true)]) ..

https://developer.apple.com/documentation/arkit/arcoachingoverlayview ARCoachingOverlayView | Apple Developer DocumentationA view that displays standardized onboarding instructions to direct users toward a specific goal.developer.apple.comimport SwiftUIimport RealityKitimport ARKitstruct ContentView : View { var body: some View { return ARViewContainer().edgesIgnoringSafeArea(.all) ..