- 프로토타입✨
R.swift
SwiftLint
Firebase
Then
SnapKit
Moya
RESTful API
RxCocoa
MVVM
- 이미지, 폰트 등 Resource를 초기화하는 방식의 형태로 사용했었다. 이번 프로젝트에서는 R.swift를 활용하여 리소스를 관리 및 적용함으로써 코드를 간소화할 수 있었다.
-
현업에서 자주 사용하고 있는 코딩 컨벤션 라이브러리인 SwiftLint를 학습 및 적용
disabled_rules: - line_length - trailing_whitespace - force_cast - force_unwrapping excluded: - Pods - Packages - usKet_HobbyFriend/Resource/R.generated.swift analyzer_rules: - unused_declaration - unused_import opt_in_rules: - empty_count - empty_string
-
유저간의 요청 / 수락 / 기타 알림을 위해 Firebase Cloud Messaging을 사용
Appdelegate
-
UNUserNotificationCenter를 이용해 알림 등록
import Firebase @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() UNUserNotificationCenter.current().delegate = self Messaging.messaging().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { _, _ in } application.registerForRemoteNotifications() ··· }
-
extension Appdelegate : MessagingDelegate,UNUserNotificationCenterDelegate 채택
-
Messaging 함수 -> FCM 토큰을 UserDefaults로 관리
extension AppDelegate: MessagingDelegate { func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) { lazy var signup = Helper() guard let fcmToken = fcmToken else { signup.registerUserData(userDataType: .FCMtoken, variable: "None") return } signup.registerUserData(userDataType: .FCMtoken, variable: fcmToken) } func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { completionHandler(UIBackgroundFetchResult.newData) } } extension AppDelegate: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([ .banner, .badge, .sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { completionHandler() } }
-
-
- URLSession부터 Alamofire 그리고 이번 프로젝트에서는 Moya를 사용해 RESTful API를 구현
- 회원가입 플로우 이후 홈 지점부터 구현해야하는 Endpoint, Codable 모델 등이 늘어나 모듈화 및 가독성을 위해 Moya를 채택
- Moya 적용기 🏋🏻♀️
온보딩 + 회원가입 | 홈화면 |
---|---|
![]() |
![]() |
취미 선택 및 탐색 | 채팅 | 내 정보 |
---|---|---|
![]() |
![]() |
![]() |
[1] UICollectionView의 Cell을 왼쪽 정렬하기
[2] SnapKit updateConstraint 적용
[3] 유저의 매칭상태를 확인하기 위한 API 반복호출
[4] 셀안의 버튼에 이벤트주기
[5] NavigationController의 SetViewController