일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
- Alert
- 백준
- format형식
- ios
- UIStackView
- swiftUI
- UserDefaults
- segue
- 코딩테스트
- Java
- autolayout
- EventKit
- programmers
- snapkit
- NotificationCenter
- CoreLocation
- SWIFT
- image
- ios15
- alamofire
- AsyncImage
- SwiftUI_Preview_Provider
- Kotlin
- kakaomap
- pod install
- MapKit
- ViewModifier
- Appearance변경
- cocoapods
- android
- Today
- Total
목록분류 전체보기 (68)
감자주먹밥
이번에는 간단하게 변경한 UI 2가지를 정리하려고 한다.TableView 무한 스크롤의 경우 구현 한 적이 있었지만, 최신곡, 인기곡 등 그렇게 버거울 정도의 데이터가 한번에 들어오는게 아니여서 그냥 한번에 데이터를 불러와 보여줬었지만노래 검색의 경우 "사랑" 단어를 포함한 노래만 4만곡 이상을 넘어가는 것으로 기억한다. 이것 때문이라도 페이징으로 데이터를 불러와야 할 거 같아 수정했다.TextField+UIDatePicker는 최신곡 조회 기능에 날짜를 선택하기위해 사용했었는데, DatePicker에 연, 월 만 선택하는 걸 원했지만 당시에 왜 속성이 없지? 하면서 그냥 Date 전체를 선택할 수 있게 했던게 아쉬워서 수정하게 됐다.수정을 위해 좀 알아보던 중 datePickerMode에 yearAnd..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/zeVRW/btsHcataYAc/2Vw2GHCFovHpZAk8cCf83K/img.png)
iOS 강의를 다 듣고 바로 만들어서 배포해 본 앱이 있는데,, 이번에 다시 보니 정말 배웠던거 그대로 다 넣느라고 이상한게 많아서 수정하면서 정리를 하기로 했다.앱의 기능 중 맘에 드는 곡을 북마크 하면 따로 애창곡 리스트로 볼 수 있는 기능이 있는데, 당시에 UserDefaults를 알게되고 아! 이게 iOS에서 DB처럼 쓰는거구나! 하면서 그냥 사용했다.그러다 옛날 블로그 포스팅으로도 있지만 CoreData 존재를 알고나서 보니 멍청한 짓을 한 거 같아서 이것부터 수정하기로 했다.일단 둘의 차이점을 먼저 알아보자면UserDefaults는 App Setting 정보 같은 간단한 정보를 저장하기에 적합하고CoreData는 복잡하고 큰 데이터를 저장하기 적합하다.CoreData를 데이터베이스 자체로 알고..
https://leetcode.com/problems/reverse-vowels-of-a-string/solutions/3329717/swift-solution-beats-100-easy-to-understand/?envType=study-plan-v2&envId=leetcode-75 Swift solution [beats 100%] (easy to understand) - Reverse Vowels of a String - LeetCode View Nihad_s's solution of Reverse Vowels of a String on LeetCode, the world's largest programming community. leetcode.com "hello" 와 같은 문자열의 모음만 reve..
https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/description/?envType=study-plan-v2&envId=leetcode-75 Kids With the Greatest Number of Candies - LeetCode Can you solve this real interview question? Kids With the Greatest Number of Candies - There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith k..
프로그래머스 풀 때도 봤던 문제. https://leetcode.com/problems/greatest-common-divisor-of-strings/description/?envType=study-plan-v2&envId=leetcode-75 Greatest Common Divisor of Strings - LeetCode Can you solve this real interview question? Greatest Common Divisor of Strings - For two strings s and t, we say "t divides s" if and only if s = t + ... + t (i.e., t is concatenated with itself one or more times). ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Mft8q/btsjJbXjxwm/LKd1mXhzs0jM3VDv7crEk1/img.png)
CoreData는 UserDefaults와 비슷하다 생각할 수 있지만, UserDefaults는 간단한 데이터 정도의 저장이 적합하고, CoreData는 UserData, 큰 데이터를 저장하기 용이하다. 여기서 CloudKit까지 같이 사용해 준다면, GoodNote 어플처럼 따로 서버를 두지 않고 여러 기기의 앱 내에서 데이터를 동기화시킬 수 있다. key-value형식이나 파일, 또는 CoreData Model 형식과 비슷하게 저장할 수 있는데 GoodNote는 파일 형식으로 저장해서 사용하는 것 같다. SwiftData가 곧 나와 금방 잊혀질 것 같으니 미리 공부해 적용해 봤다. 구현 먼저 프로젝트 생성시에 Use CoreData, Host in CloudKit을 체크하여 생성한다. 체크하면 Per..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/TV6nJ/btshG63eW7G/B5oHOJZK8OHuphBdDwc1Uk/img.gif)
Diffable Data Source? Diffable DataSource는 WWDC 19에 발표되었고, IOS 13 이상 부터 사용가능하다. TableView, CollectionView의 DataSource에서 개선된 것임으로 둘 다 적용이 가능하다. 변경된 Data를 적용해야 할 때 그냥 reloadData를 써버리거나, performBatchUpdates로 애니메이션 까지 신경쓰며 갱신을 해 줬지만, Diffable DataSource를 사용하면 첫 설정에 UI에 대한 설정 말고는 데이터가 변할 때 마다 apply만 해 주면 알아서 애니메이션 까지 자연스럽게 적용할 수 있다. 적용하기 먼저 결과 화면 먼저 스토리 보드를 사용해 collectionView를 추가했다. Diffable DataSour..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/c5JVch/btsexekhdAD/ApX2eZ58rstEgrokelPkpK/img.png)
1. 프로젝트에 Firebase 추가 https://console.firebase.google.com/?hl=ko 로그인 - Google 계정 이메일 또는 휴대전화 accounts.google.com Firebase console에 들어가 프로젝트를 생성하고 설명을 따라가면 쉽게 프로젝트를 생성할 수 있다. GoogleService-Info.plist 를 프로젝트에 추가하고 2. Authentication에 사용할 로그인 제공업체 선택 새 제공업체 추가를 누르고 구글, 애플을 추가했다 3. 프로젝트에 애플 로그인 설정 먼저 프로젝트에 들어가 Target의 Signing&Capabillities 를 선택하면 Capaillity를 추가할 수 있는 버튼이 있다. 버튼을 누르고 Sign In with Apple..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/kEPEP/btsbglm7cu8/dB3kdcHvWE9PHZscdzUNgK/img.gif)
참고한 유튜브 자료 MVVM 아키텍처를 처음 공부했을 땐 RxSwift로 시작을 했었는데, Combine을 알고 나서 UIKit에서 Combine으로 MVVM을 할 수 있지 않을까 라는 생각에 찾아보고 시도해봤다. 유튜브 예제는 통신 예제에 버튼을 누르면 랜덤한 글이 나오게 하는 것이고, 내가 한 건 로그인 화면을 구현한 것이다. 프로젝트 세팅은 Storyboard로 진행했고 Combine을 제외한 라이브러리는 사용하지 않았다. 간단한 로그인 회원가입 화면을 만들고 MVVM을 적용해봤다. final class SignInViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var signInButton: UIButton! priva..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/yxZRv/btr8Lka6MGJ/84nLXmeUdrcHkoF8KBwunk/img.png)
https://developer.apple.com/documentation/swiftui/view-styles View styles | Apple Developer Documentation Apply built-in and custom appearances and behaviors to different types of views. developer.apple.com Label, Button 등의 View에 스타일을 지정하거나 커스텀 할 수 있게 하는 것이 ViewStyle이다. Label을 예로 들면,,, 기본으로 Label의 style에는 4가지 정도가 있는데, 사용자가 커스텀 해서 스타일을 만들 수 있다. Custom Style을 만들기 위해서는 LabelStyle 프로토콜을 채택한 구조체를 만들면..