Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

온보딩 - 로그인 디자인 & 기능 완성 #90

Closed
Binary file modified Encrypted/Secrets/GoogleService-Info.plist.encrypted
Binary file not shown.
Binary file modified Encrypted/XCConfig/App/DEV.xcconfig.encrypted
Binary file not shown.
2 changes: 1 addition & 1 deletion Encrypted/XCConfig/App/PROD.xcconfig.encrypted
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�d��BJؠ���LH�8�v2c�����mH �"?^F1Xn�o^� |�т�2x>�SFgtmz \���Ԍ����uQ&uD�0�p>y�����|/�N&UcŞ�;RV��$�H�K����X6W]�nu.����i}�D�ş?��~Jod >�w���R
�d��BJؠ���LH�8�v2c�����mH �"?^F1Xn�o^� |�т�2x>�SFgtmz \���Ԍ����uQ&=O��pV��fa�zuc)�!����wW�0+SXl>7{�mD@���Z�]��增�o�_{�Z���Ex�6 l}�5`������W����.?��h��o>Hˈ4��: SѢ����C^7L�
Expand Down
17 changes: 15 additions & 2 deletions Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,24 @@ public extension Project {
"CFBundleURLTypes": [
[
"CFBundleTypeRole": "Editor",
"CFBundleURLSchemes": ["keyme"]
"CFBundleURLSchemes": [
"keyme",
"kakao$(KAKAO_API_KEY)"
]
]
],
"API_BASE_URL": "$(API_BASE_URL)",
"UIUserInterfaceStyle": "Light"
"KAKAO_API_KEY": "$(KAKAO_API_KEY)",
"UIUserInterfaceStyle": "Light",
"NSAppTransportSecurity": [
"NSExceptionDomains": [
"api.keyme.space": [
"NSIncludesSubdomains": true,
"NSExceptionMinimumTLSVersion": "TLSv1.2",
],
]
],
"LSApplicationQueriesSchemes": ["kakaokompassauth", "kakaolink"]
]

static let baseUrlInfoPlist: [String: InfoPlist.Value] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public class HapticManager {
generator.impactOccurred()
}

/// 붕
public func boong() {
let generator = UIImpactFeedbackGenerator(style: .soft)
generator.prepare()
generator.impactOccurred()
}

/// 패턴 재생(패턴은 추후 협의 후 개발해서 추가)
public func playHapticPattern() {
do {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// TextFieldPlaceholder.swift
// Core
//
// Created by 이영빈 on 2023/08/31.
// Copyright © 2023 team.humanwave. All rights reserved.
//

import SwiftUI

public extension View {
func placeholder<Content: View>(
when shouldShow: Bool,
alignment: Alignment = .leading,
@ViewBuilder placeholder: () -> Content
) -> some View {
ZStack(alignment: alignment) {
placeholder().opacity(shouldShow ? 1 : 0)
self
}
}
}
2 changes: 1 addition & 1 deletion Projects/DSKit/Sources/Lottie/KeymeLottie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public struct KeymeLottieView: UIViewRepresentable {

lottieView.translatesAutoresizingMaskIntoConstraints = false
lottieView.loopMode = loopMode
lottieView.contentMode = .scaleToFill
lottieView.contentMode = .scaleAspectFill
lottieView.play(completion: { finished in
if finished {
completion?()
Expand Down
8 changes: 4 additions & 4 deletions Projects/Features/Sources/Home/KeymeTestHomeFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import ComposableArchitecture
import Domain
import Network

struct KeymeTestsHomeFeature: Reducer {
public struct KeymeTestsHomeFeature: Reducer {
@Dependency(\.keymeAPIManager) private var network

// 테스트를 아직 풀지 않았거나, 풀었거나 2가지 케이스만 존재
struct State: Equatable {
public struct State: Equatable {
@PresentationState var testStartViewState: KeymeTestsStartFeature.State?
var view: View

Expand All @@ -28,15 +28,15 @@ struct KeymeTestsHomeFeature: Reducer {
}
}

enum Action {
public enum Action {
case fetchDailyTests
case showTestStartView(testData: KeymeTestsModel)
case startTest(PresentationAction<KeymeTestsStartFeature.Action>)

enum View {}
}

var body: some ReducerOf<Self> {
public var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case .fetchDailyTests:
Expand Down
6 changes: 5 additions & 1 deletion Projects/Features/Sources/Home/KeymeTestHomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ struct KeymeTestsHomeView: View {

init(store: StoreOf<KeymeTestsHomeFeature>) {
self.store = store
store.send(.fetchDailyTests)
}

var body: some View {
Expand All @@ -41,6 +40,11 @@ struct KeymeTestsHomeView: View {
// 결과 화면 표시도 생각

}
.onAppear {
if viewStore.dailyTestId == nil {
viewStore.send(.fetchDailyTests)
}
}
}
}
}
Expand Down
21 changes: 15 additions & 6 deletions Projects/Features/Sources/MainPage/MainPageFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,32 @@ import ComposableArchitecture

public struct MainPageFeature: Reducer {
public struct State: Equatable {
let userId: Int
let nickname: String
var home: KeymeTestsHomeFeature.State
var myPage: MyPageFeature.State

public init(userId: Int, nickname: String) {
self.userId = userId
self.nickname = nickname
self.home = .init(nickname: nickname)
self.myPage = .init(userId: userId, nickname: nickname)
}
}

public enum Action {
case logout
case changeNickname(String)
case home(KeymeTestsHomeFeature.Action)
case myPage(MyPageFeature.Action)
}

public var body: some Reducer<State, Action> {
Reduce { _, _ in
return .none
}

Scope(state: \.home, action: /Action.home) {
KeymeTestsHomeFeature()
}

Scope(state: \.myPage, action: /Action.myPage) {
MyPageFeature()
}

}
}
33 changes: 11 additions & 22 deletions Projects/Features/Sources/MainPage/MainPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,19 @@ struct KeymeMainView: View {
}

var body: some View {
WithViewStore(store, observe: { $0 }) { viewStore in
WithViewStore(store, observe: { $0 }) { _ in
TabView(selection: $selectedTab) {
KeymeTestsHomeView(store: Store(
initialState: KeymeTestsHomeFeature.State(
nickname: viewStore.nickname)
) {
KeymeTestsHomeFeature()
})
.tabItem {
homeTabImage
}
.tag(Tab.home)
KeymeTestsHomeView(store: store.scope(state: \.home, action: MainPageFeature.Action.home))
.tabItem {
homeTabImage
}
.tag(Tab.home)

MyPageView(store: Store(
initialState: MyPageFeature.State(
userId: viewStore.state.userId,
nickname: viewStore.state.nickname)
) {
MyPageFeature()
})
.tabItem {
myPageTabImage
}
.tag(Tab.myPage)
MyPageView(store: store.scope(state: \.myPage, action: MainPageFeature.Action.myPage))
.tabItem {
myPageTabImage
}
.tag(Tab.myPage)
}
.introspect(.tabView, on: .iOS(.v16, .v17)) { tabViewController in
let tabBar = tabViewController.tabBar
Expand Down
24 changes: 12 additions & 12 deletions Projects/Features/Sources/MyPage/MyPageFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@ import Foundation
import SwiftUI
import Network

struct Coordinate {
var x: Double
var y: Double
var r: Double
var color: Color
}

struct MyPageFeature: Reducer {
public struct MyPageFeature: Reducer {
@Dependency(\.keymeAPIManager) private var network

struct State: Equatable {
public struct State: Equatable {
var similarCircleDataList: [CircleData] = []
var differentCircleDataList: [CircleData] = []
var view: View
Expand All @@ -45,14 +38,14 @@ struct MyPageFeature: Reducer {
}
}

enum Action: Equatable {
public enum Action: Equatable {
case saveCircle([CircleData], MatchRate)
case showCircle(MyPageSegment)
case requestCircle(MatchRate)
case view(View)
case scoreListAction(ScoreListFeature.Action)

enum View: Equatable {
public enum View: Equatable {
case markViewAsShown
case circleTapped
case circleDismissed
Expand Down Expand Up @@ -138,9 +131,16 @@ struct MyPageFeature: Reducer {
}
}

extension MyPageFeature {
public extension MyPageFeature {
enum MatchRate {
case top5
case low5
}

struct Coordinate {
var x: Double
var y: Double
var r: Double
var color: Color
}
}
11 changes: 6 additions & 5 deletions Projects/Features/Sources/MyPage/MyPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ struct MyPageView: View {

init(store: StoreOf<MyPageFeature>) {
self.store = store

store.send(.requestCircle(.top5))
store.send(.requestCircle(.low5))

store.send(.view(.selectSegement(.similar)))
}

public var body: some View {
Expand Down Expand Up @@ -90,5 +85,11 @@ struct MyPageView: View {
}
}
}
.onAppear {
store.send(.requestCircle(.top5))
store.send(.requestCircle(.low5))

store.send(.view(.selectSegement(.similar)))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ComposableArchitecture
import Domain
import Network

struct ScoreListFeature: Reducer {
public struct ScoreListFeature: Reducer {
@Dependency(\.keymeAPIManager) private var network

public struct State: Equatable {
Expand Down
4 changes: 2 additions & 2 deletions Projects/Features/Sources/Onboarding/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public struct OnboardingView: View {
Color.clear
.contentShape(Circle())
.onTapGesture {
HapticManager.shared.tongtong()
HapticManager.shared.boong()
viewStore.send(.startButtonDidTap)
}
}
Expand All @@ -116,7 +116,7 @@ public struct OnboardingView: View {
.foregroundColor(.black)
}
.onTapGesture {
HapticManager.shared.tok()
HapticManager.shared.boong()
viewStore.send(.nextButtonDidTap)
}
.padding(Padding.insets(leading: 16, trailing: 16))
Expand Down
15 changes: 9 additions & 6 deletions Projects/Features/Sources/Registration/RegisterFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,26 @@ public struct RegistrationFeature: Reducer {
case registerProfileImageResponse(thumbnailURL: URL, originalImageURL: URL)

case finishRegister(nickname: String, thumbnailURL: URL?, originalImageURL: URL?)
case finishRegisterResponse(id: Int, friendCode: String)
case finishRegisterResponse(MemberUpdateDTO)
}

public var body: some Reducer<State, Action> {
Reduce { state, action in
switch action {
case .debouncedNicknameUpdate(let nicknameString):
guard !nicknameString.isEmpty else {
return .none
}

state.nicknameTextFieldString = nicknameString
state.isNicknameAvailable = nil

return .run { send in
try await withTaskCancellation(
id: CancelID.debouncedNicknameUpdate,
cancelInFlight: true
) {
try await self.clock.sleep(for: .seconds(0.7))
try await self.clock.sleep(for: .seconds(0.3))

await send(.checkDuplicatedNickname(nicknameString))
}
Expand Down Expand Up @@ -112,10 +118,7 @@ public struct RegistrationFeature: Reducer {
profileThumbnail: originalImageURL?.absoluteString)),
object: MemberUpdateDTO.self)

await send(
.finishRegisterResponse(
id: result.data.id,
friendCode: result.data.friendCode ?? "")) // TODO: 나중에 non-null 값 필요
await send(.finishRegisterResponse(result))
}

case .finishRegisterResponse:
Expand Down
Loading