Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
woin2ee committed Jan 30, 2024
2 parents 75302da + 5c29423 commit 3898e07
Show file tree
Hide file tree
Showing 111 changed files with 1,765 additions and 874 deletions.
12 changes: 6 additions & 6 deletions .package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/google-api-objectivec-client-for-rest.git",
"state" : {
"revision" : "40930b2c3add6234b8be1a780c08cf88b6a7a1f7",
"version" : "3.2.0"
"revision" : "bcb0439b37d16d39da6f62139d4009d09e7aef14",
"version" : "3.4.0"
}
},
{
Expand Down Expand Up @@ -50,17 +50,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "c569bec4d04da84030d94f376437bc4efda3686b",
"version" : "13.23.1"
"revision" : "a5e87a39cffdcc591f3203c11cfca68100d0b9a6",
"version" : "13.26.0"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift.git",
"state" : {
"revision" : "fd199ce07edb4db69e862f74151b95602aad3b43",
"version" : "10.44.0"
"revision" : "eafdd3720a8cc750bdd38bf776082d2c8cf743fc",
"version" : "10.46.0"
}
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions Changelog/1.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Enhancement
- Added haptic to the change to next word event, change to previous word event.
- Enhanced app usability.
21 changes: 21 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,26 @@ func targets() -> [Target] {
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "GeneralSettings",
sourcesPrefix: "iOSScenes",
resourceOptions: [.additional("Resources/iOSSupport/**")],
dependencies: [
.target(name: "iOSSupport"),
.external(name: ExternalDependencyName.rxSwift),
.external(name: ExternalDependencyName.rxCocoa),
.external(name: ExternalDependencyName.rxUtilityDynamic),
.external(name: ExternalDependencyName.reactorKit),
.external(name: ExternalDependencyName.swinject),
.external(name: ExternalDependencyName.swinjectExtension),
],
hasTests: true,
additionalTestDependencies: [
.target(name: "DomainTesting"),
.external(name: ExternalDependencyName.rxBlocking),
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "iPhoneDriver",
dependencies: [
Expand All @@ -324,6 +344,7 @@ func targets() -> [Target] {
.target(name: "UserSettings"),
.target(name: "LanguageSetting"),
.target(name: "PushNotificationSettings"),
.target(name: "GeneralSettings"),
.external(name: ExternalDependencyName.swinject),
.external(name: ExternalDependencyName.swinjectDIContainer),
.external(name: ExternalDependencyName.sfSafeSymbols),
Expand Down
3 changes: 2 additions & 1 deletion QA.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Version
1.4.0
1.5.0

##Common
- Localization 적용 확인
Expand Down Expand Up @@ -31,3 +31,4 @@
- 구글 드라이브 로그인 여부에 따라 로그아웃 버튼 표시
- 매일 알림 켜고 시간 설정한 뒤 홈화면에서 알림 제대로 오는지 확인
- 매일 알림 설정 후 단어 추가/삭제/드라이브 다운로드 에 따라 알림 메세지에 단어 갯수 정상 표시 확인
- Haptic 설정 켜고 끔에따라 적용되는지 확인
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ time = "Time";
notifications = "Notifications";
allow_notifications_is_required = "Allow notifications is required.";
dailyReminderFooter = "Sends a daily push notification at the time you set.";

general = "General";
haptics = "Haptics";
hapticsSettingsFooterTextWhenHapticsIsOn = "Enable haptics for interactions.";
hapticsSettingsFooterTextWhenHapticsIsOff = "Disable haptics for interactions";
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ time = "시간";
notifications = "알림";
allow_notifications_is_required = "알림 허용이 필요합니다.";
dailyReminderFooter = "설정한 시각에 매일 푸시 알림을 보냅니다.";

general = "일반";
haptics = "진동";
hapticsSettingsFooterTextWhenHapticsIsOn = "상호 작용에 대한 진동을 사용합니다.";
hapticsSettingsFooterTextWhenHapticsIsOff = "상호 작용에 대한 진동을 사용하지 않습니다.";
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,24 @@ final class UserSettingsRepository: UserSettingsRepositoryProtocol {
userDefaults.rx.setCodable(
userSettings.translationTargetLocale,
forKey: UserDefaultsKey.translationTargetLocale
)
),
userDefaults.rx.setValue(userSettings.hapticsIsOn, forKey: UserDefaultsKey.hapticsIsOn)
)
.mapToVoid()
}

func getUserSettings() -> RxSwift.Single<Domain.UserSettings> {
return Single.zip(
userDefaults.rx.object(TranslationLanguage.self, forKey: UserDefaultsKey.translationSourceLocale),
userDefaults.rx.object(TranslationLanguage.self, forKey: UserDefaultsKey.translationTargetLocale)
userDefaults.rx.object(TranslationLanguage.self, forKey: UserDefaultsKey.translationTargetLocale),
userDefaults.rx.bool(forKey: UserDefaultsKey.hapticsIsOn)
)
.map { sourceLocale, targetLocale -> Domain.UserSettings in
return .init(translationSourceLocale: sourceLocale, translationTargetLocale: targetLocale)
.map { sourceLocale, targetLocale, hapticsIsOn -> Domain.UserSettings in
return .init(
translationSourceLocale: sourceLocale,
translationTargetLocale: targetLocale,
hapticsIsOn: hapticsIsOn
)
}
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/DataDriver/UserDefaults/UserDefaultsKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ enum UserDefaultsKey: UserDefaultsKeyProtocol, CaseIterable {

case dailyReminderTime

case hapticsIsOn

/// 테스트용 Key 입니다.
case test

Expand Down
2 changes: 1 addition & 1 deletion Sources/Domain/DI/DomainAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public final class DomainAssembly: Assembly {
public func assemble(container: Container) {
let assemblies: [Assembly] = [
WordUseCaseAssembly(),
WordRxUseCaseAssembly(),
UserSettingsUseCaseAssembly(),
ExternalStoreUseCaseAssembly(),
NotificationsUseCaseAssembly(),
]

assemblies.forEach { assembly in
Expand Down
2 changes: 1 addition & 1 deletion Sources/Domain/DI/ExternalStoreUseCaseAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ExternalStoreUseCaseAssembly: Assembly {
wordRepository: wordRepository,
googleDriveRepository: googleDriveRepository,
unmemorizedWordListRepository: unmemorizedWordListRepository,
userSettingsUseCase: resolver.resolve()
notificationsUseCase: resolver.resolve()
)
}
.inObjectScope(.container)
Expand Down
27 changes: 27 additions & 0 deletions Sources/Domain/DI/NotificationsUseCaseAssembly.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// NotificationsUseCaseAssembly.swift
// Domain
//
// Created by Jaewon Yun on 1/24/24.
// Copyright © 2024 woin2ee. All rights reserved.
//

import Foundation
import Swinject
import SwinjectExtension
import UserNotifications

final class NotificationsUseCaseAssembly: Assembly {

func assemble(container: Container) {
container.register(NotificationsUseCaseProtocol.self) { resolver in
return NotificationsUseCase.init(
notificationRepository: UNUserNotificationCenter.current(),
wordRepository: resolver.resolve(),
userSettingsRepository: resolver.resolve()
)
}
.inObjectScope(.container)
}

}
9 changes: 1 addition & 8 deletions Sources/Domain/DI/UserSettingsUseCaseAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@

import Swinject
import SwinjectExtension
import UserNotifications

final class UserSettingsUseCaseAssembly: Assembly {

func assemble(container: Container) {
container.register(UserSettingsUseCaseProtocol.self) { resolver in
let userSettingsRepository: UserSettingsRepositoryProtocol = resolver.resolve()

return UserSettingsUseCase.init(
userSettingsRepository: userSettingsRepository,
notificationRepository: UNUserNotificationCenter.current(),
wordRepository: resolver.resolve()
)
return UserSettingsUseCase.init(userSettingsRepository: resolver.resolve())
}
.inObjectScope(.container)
}
Expand Down
24 changes: 0 additions & 24 deletions Sources/Domain/DI/WordRxUseCaseAssembly.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/Domain/DI/WordUseCaseAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class WordUseCaseAssembly: Assembly {
return WordUseCase.init(
wordRepository: wordRepository,
unmemorizedWordListRepository: unmemorizedWordListRepository,
userSettingsUseCase: resolver.resolve()
notificationsUseCase: resolver.resolve()
)
}
.inObjectScope(.container)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ import RxSwift

public protocol ExternalStoreUseCaseProtocol {

/// 외부 저장소에 로그인합니다.
func signInWithAuthorization(presenting: PresentingConfiguration) -> RxSwift.Single<Void>

/// 외부 저장소에서 로그아웃합니다.
func signOut()

var hasSigned: Bool { get }

/// 외부 저장소에 업로드합니다.
/// - Parameter presenting: 외부 서비스에 로그인이 되어있지 않을 때 로그인 화면을 제시하는데 사용되는 구성
func upload(presenting: PresentingConfiguration?) -> Observable<ProgressStatus>

/// 외부 저장소에서 다운로드합니다.
/// - Parameter presenting: 외부 서비스에 로그인이 되어있지 않을 때 로그인 화면을 제시하는데 사용되는 구성
func download(presenting: PresentingConfiguration?) -> Observable<ProgressStatus>

/// 이전에 로그인했던 사용자 복구를 시도합니다.
func restoreSignIn() -> Observable<Void>

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// NotificationsUseCaseProtocol.swift
// Domain
//
// Created by Jaewon Yun on 1/24/24.
// Copyright © 2024 woin2ee. All rights reserved.
//

import Foundation
import RxSwift
import UserNotifications

public protocol NotificationsUseCaseProtocol {

/// Requests the user’s authorization to allow local and remote notifications for your app.
func requestNotificationAuthorization(with options: UNAuthorizationOptions) -> Single<Bool>

/// Retrieves the notification authorization status for your app.
///
/// 이 함수가 반환하는 Single 시퀀스는 error 를 방출하지 않습니다.
func getNotificationAuthorizationStatus() -> Single<UNAuthorizationStatus>

/// 지정한 시각에 매일 알림을 설정합니다.
func setDailyReminder(at time: DateComponents) -> Single<Void>

/// 현재 단어 갯수를 적용하여 알림 내용을 다시 설정합니다.
///
/// 매일 알림이 설정되어 있지 않거나 정상적으로 알림을 다시 설정하지 못했을 경우 Error 를 방출합니다.
func resetDailyReminder() -> Completable

/// 설정된 매일 알림을 삭제합니다.
func removeDailyReminder()

/// 설정되어 있는 매일 알림을 방출하는 시퀀스를 반환합니다.
/// - Returns: 설정된 매일 알림이 있는 경우 알림 객체를 반환합니다. 설정된 매일 알림이 없거나 알림이 꺼져있는 경우 `error` 이벤트를 방출합니다.
func getDailyReminder() -> Single<UNNotificationRequest>

/// 마지막으로 설정한 매일 알림의 시간을 반환합니다.
func getLatestDailyReminderTime() throws -> DateComponents

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

import Foundation
import RxSwift
import RxRelay
import UserNotifications

public protocol UserSettingsUseCaseProtocol {

Expand All @@ -19,30 +17,8 @@ public protocol UserSettingsUseCaseProtocol {

func getCurrentUserSettings() -> Single<UserSettings>

/// Requests the user’s authorization to allow local and remote notifications for your app.
func requestNotificationAuthorization(with options: UNAuthorizationOptions) -> Single<Bool>
func onHaptics() -> Single<Void>

/// Retrieves the notification authorization status for your app.
///
/// 이 함수가 반환하는 Single 시퀀스는 error 를 방출하지 않습니다.
func getNotificationAuthorizationStatus() -> Single<UNAuthorizationStatus>

/// 지정한 시각에 매일 알림을 설정합니다.
func setDailyReminder(at time: DateComponents) -> Single<Void>

/// 현재 단어 갯수를 적용하여 알림 내용을 다시 설정합니다.
///
/// 매일 알림이 설정되어 있지 않거나 정상적으로 알림을 다시 설정하지 못했을 경우 Error 를 방출합니다.
func resetDailyReminder() -> Completable

/// 설정된 매일 알림을 삭제합니다.
func removeDailyReminder()

/// 설정되어 있는 매일 알림을 방출하는 시퀀스를 반환합니다.
/// - Returns: 설정된 매일 알림이 있는 경우 알림 객체를 반환합니다. 설정된 매일 알림이 없거나 알림이 꺼져있는 경우 `error` 이벤트를 방출합니다.
func getDailyReminder() -> Single<UNNotificationRequest>

/// 마지막으로 설정한 매일 알림의 시간을 반환합니다.
func getLatestDailyReminderTime() throws -> DateComponents
func offHaptics() -> Single<Void>

}
37 changes: 0 additions & 37 deletions Sources/Domain/Interfaces/UseCases/WordRxUseCaseProtocol.swift

This file was deleted.

Loading

0 comments on commit 3898e07

Please sign in to comment.