목록ChatGPT (2)
슈뢰딩거의 고등어
개인 프로젝트 도중, User 와 Post 에 사용할 모델을 만들어야 했다. 일단 Post 는 별 생각 없이 구조체로 만들었는데, 클래스로 만들어도 되지않나? 라는 생각이 문득 들어서 챗지피티에게 물어봤다. The choice between using a structure (struct) or a class (class) depends on the specific requirements and characteristics of your application. Here are some factors to consider: Mutability: Structures are value types, meaning they are typically immutable. When you create a new inst..
요즘 연습 겸 따라 만들고 있는 앱이 있는데 그 앱에서 사용자의 위치를 얻어서 사용하는 기능이 있더라 그 기능을 만들기 위해 위치정보를 얻어올수 있는 코드를 작성해보았다. 간단하게 챗지피티에게 LoationView 와 LocationManager 를 만들게 하고 일부 수정한 뒤 실행해보았다. [코드] 더보기 // // LocationView.swift // Navigation // // Created by jhmin on 2023/04/08. // import SwiftUI struct LocationView: View { @StateObject private var locationManager = LocationManager() var body: some View { VStack { if let loc..