Skip to content

사진 촬영 시 GuidePhoto에 메타데이터 저장 기능 구현 #23

Description

@thisisdana49

✅ 작업 내용
• CustomCameraViewController 또는 해당 ViewModel에서 사진 촬영 완료 시점 확인
• PHPhotoLibrary.shared().performChanges 블록 내부에서 저장된 PHAsset의 localIdentifier 추출
• 현재 선택된 guideId와 함께 GuidePhoto 객체 생성
• Realm에 저장 (비동기 or 메인 스레드 처리 방식 명시)
• 에러 발생 시 사용자에게 Alert 등 UI 대응 준비

🧠 유의사항
• PHAsset 접근은 권한이 허용된 상태에서만 가능해야 함
• localIdentifier는 저장 직후 바로 PHAsset.fetchAssets(withLocalIdentifiers:)로 조회 가능
• Realm 쓰기 트랜잭션 내에서 GuidePhoto(createdAt: Date(), ...) 저장
• 동일한 guideId + assetLocalIdentifier 조합이 중복 저장되지 않도록 할 수 있음 (선택 사항)
• 추후 사진 삭제 기능과 연계되므로, 저장 시 ID 기준 정렬이나 관리 방식 고려

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions