본문 바로가기
반응형

1 - iOS33

[iOS/Swift] Xcode CocoaPods Install 코코아팟 설치 방법 CocoaPods 를 사용하는 방법 터미널에서 cocoapods 를 설치해준다. sudo gem install cocoapods 터미널에서 코코아팟을 사용하려는 프로젝트 폴더에 들어가서 pod init을 해준다. pod init Podfile 을 수정하기 위해 vi로 파일을 열어준다. vi Podfile https://github.com/Alamofire/Alamofire GitHub - Alamofire/Alamofire: Elegant HTTP Networking in Swift Elegant HTTP Networking in Swift. Contribute to Alamofire/Alamofire development by creating an account on GitHub. github.com .. 2022. 4. 17.
[iOS/Swift] SwiftUI TextEditor background color SwiftUI 에서 TextEditor의 background 색을 없애는 방법 TextEditor의 기본 background 색은 하얀색이다. 이를 투명하게 만드려면 아래와 같이 작성해주면 된다. 2022. 4. 12.
[iOS/Swift] Lottie 추가하기 SwiftUI에서 Lottie 를 추가하는 방법 https://lottiefiles.com/ Free Lottie Animation Files, Tools & Plugins - LottieFiles The world’s largest online platform for the world’s smallest animation format for designers, developers, and more. Access Lottie animation tools and plugins for Android, iOS, and Web. lottiefiles.com Lottie 에서 JSON 형식의 움직이는 animation file을 얻을 수 있다. https://lottiefiles.com/popular Free .. 2022. 4. 12.
[iOS/Swift] 왼쪽으로 Swipe하여 list item 삭제하기 List 속 ForEach에 .onDelete() 를 붙여주면 된다. ForEach 내부 항목이 아니라 ForEach 쪽에 붙여야 오류가 안난다는 점... delete 함수에서는 삭제한 내용을 서버에 업데이트하고, 뷰에서 보일 list 에서도 제거한다. 2022. 4. 11.
[iOS/Swift] Drag and drop으로 순서 변경 SwiftUI에서 제공되는 List와 .onMove() 를 사용하면 간단하게 drag and drop으로 아이템 순서를 변경할 수 있다. 버튼을 눌러 Edit mode로 전환한 경우 순서를 변경할 수 있도록 해두었다. List 내부 뷰 항목에 .onMove() 를 붙여준다. ForEach 이면 ForEach 에 붙여주면 된다. 그리고 List 에는 .environment() 를 붙여준다. move 함수에서는, 이동되었을때 뷰에 보일 list에서 순서를 바꿔주고, 바뀐 순서를 저장해주기 위해 priority를 다시 설정해주었다. 2022. 4. 11.
[iOS/Swift] SwiftUI foreground notification https://velog.io/@wimes/SwiftUI%EC%97%90%EC%84%9C-LocalNotification-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0-4sk60gjlbf SwiftUI에서 LocalNotification 구현하기 참고1 참고2 참고3 View 구성 View는 심플하게 아래와 같이 코딩해줍니다. notification을 setting하는 간단한 버튼하나를 만들 것 입니다. ContentView.swift LocalNotification 그리고 notification을 관리하는 velog.io 2022. 4. 5.
반응형