Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
woin2ee committed Jan 19, 2024
2 parents 3ea39f3 + a8d25c2 commit f963d10
Show file tree
Hide file tree
Showing 81 changed files with 2,345 additions and 721 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/create_new_release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Create new release

on:
workflow_dispatch
push:
# branches:
# - main
Expand All @@ -12,13 +11,12 @@ jobs:
create_new_release:
name: Create new release
runs-on: ubuntu-latest
env:
CURRENT_TAG: ${{ github.ref_name }}
permissions:
contents: write
steps:
- run: echo "Release for tag ${CURRENT_TAG}"
- uses: actions/checkout@v3
- name: Create Release
uses: ncipollo/[email protected]
with:
bodyFile: "Changelog/${CURRENT_TAG}.md"
bodyFile: "Changelog/${{ github.ref_name }}.md"
5 changes: 5 additions & 0 deletions Changelog/1.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Features
- Add local push notification for daily reminder

## Enhancement
- Enhance app stability
53 changes: 53 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ func targets() -> [Target] {
.external(name: ExternalDependencyName.rxUtilityDynamic),
.external(name: ExternalDependencyName.swinject),
.external(name: ExternalDependencyName.swinjectExtension),
.external(name: ExternalDependencyName.then),
],
hasTests: true,
additionalTestDependencies: [
.target(name: "DataDriverTesting"),
.target(name: "TestsSupport"),
.external(name: ExternalDependencyName.rxBlocking),
],
appendSchemeTo: &schemes
Expand All @@ -39,6 +41,11 @@ func targets() -> [Target] {
],
appendSchemeTo: &disposedSchemes
)
+ Target.module(
name: "FoundationExtension",
hasTests: true,
appendSchemeTo: &schemes
)
+ Target.module(
name: "Utility",
scripts: [
Expand Down Expand Up @@ -193,6 +200,7 @@ func targets() -> [Target] {
dependencies: [
.target(name: "Domain"),
.target(name: "iOSSupport"),
.target(name: "FoundationExtension"),
.external(name: ExternalDependencyName.rxSwift),
.external(name: ExternalDependencyName.rxCocoa),
.external(name: ExternalDependencyName.rxUtilityDynamic),
Expand Down Expand Up @@ -237,6 +245,17 @@ func targets() -> [Target] {
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "UserSettingsExample",
product: .app,
infoPlist: .file(path: "Resources/InfoPlist/InfoExample.plist"),
sourcesPrefix: "iOSScenes",
dependencies: [
.target(name: "UserSettings"),
.target(name: "DomainTesting"),
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "LanguageSetting",
sourcesPrefix: "iOSScenes",
Expand All @@ -262,6 +281,37 @@ func targets() -> [Target] {
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "PushNotificationSettings",
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: "PushNotificationSettingsExample",
product: .app,
infoPlist: .file(path: "Resources/InfoPlist/InfoExample.plist"),
sourcesPrefix: "iOSScenes",
dependencies: [
.target(name: "PushNotificationSettings"),
.target(name: "DomainTesting"),
],
appendSchemeTo: &schemes
)
+ Target.module(
name: "iPhoneDriver",
dependencies: [
Expand All @@ -272,6 +322,7 @@ func targets() -> [Target] {
.target(name: "WordDetail"),
.target(name: "UserSettings"),
.target(name: "LanguageSetting"),
.target(name: "PushNotificationSettings"),
.external(name: ExternalDependencyName.swinject),
.external(name: ExternalDependencyName.swinjectDIContainer),
.external(name: ExternalDependencyName.sfSafeSymbols),
Expand Down Expand Up @@ -315,6 +366,7 @@ func targets() -> [Target] {
+ Target.module(
name: "TestsSupport",
dependencies: [
.target(name: "Domain"),
.external(name: ExternalDependencyName.rxSwift),
.external(name: ExternalDependencyName.rxTest),
],
Expand Down Expand Up @@ -398,6 +450,7 @@ let project: Project = .init(
"TestPlans/",
"Scripts/",
".gitignore",
"Project.swift",
],
resourceSynthesizers: []
)
6 changes: 5 additions & 1 deletion QA.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Version
1.0.0 (build version: 13)
1.3.0

##Common
- Localization 적용 확인

##WordCheking

Expand All @@ -26,3 +29,4 @@

- Source language / Translation language 변경 정상 적용
- 구글 드라이브 로그인 여부에 따라 로그아웃 버튼 표시
- 매일 알림 켜고 시간 설정한 뒤 홈화면에서 알림 제대로 오는지 확인
2 changes: 2 additions & 0 deletions Resources/Domain/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ spanish = "Spanish";
italian = "Italian";
german = "German";
russian = "Russian";

daily_reminder = "Daily Reminder";
2 changes: 2 additions & 0 deletions Resources/Domain/Localization/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ spanish = "스페인어";
italian = "이탈리아어";
german = "독일어";
russian = "러시아어";

daily_reminder = "매일 알림";
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ google_drive_download = "Download data from Google Drive";
google_drive_download_successfully = "Successfully downloading from Google Drive";

google_drive_logout = "Google Drive Logout";
signed_out_of_google_drive = "Signed out of Google Drive.";
signed_out_of_google_drive_successfully = "Signed out of Google Drive successfully";

synchronize_to_google_drive = "Synchronize to Google Drive.";

please_check_your_network_connection = "Please check your network connection.";

daily_reminder = "Daily Reminder";
time = "Time";
notifications = "Notifications";
allow_notifications_is_required = "Allow notifications is required.";
dailyReminderFooter = "Sends a daily push notification at the time you set.";
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ google_drive_download = "구글 드라이브에서 데이터 다운로드";
google_drive_download_successfully = "구글 드라이브에서 다운로드 성공";

google_drive_logout = "구글 드라이브 로그아웃";
signed_out_of_google_drive = "구글 드라이브에서 로그아웃되었습니다.";
signed_out_of_google_drive_successfully = "구글 드라이브에서 로그아웃되었습니다.";

synchronize_to_google_drive = "구글 드라이브에 동기화 합니다.";

please_check_your_network_connection = "네트워크 연결 상태를 확인해 주세요.";

daily_reminder = "매일 알림";
time = "시간";
notifications = "알림";
allow_notifications_is_required = "알림 허용이 필요합니다.";
dailyReminderFooter = "설정한 시각에 매일 푸시 알림을 보냅니다.";
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ final class UserSettingsRepository: UserSettingsRepositoryProtocol {
}
}

func updateLatestDailyReminderTime(_ time: DateComponents) throws {
let result = userDefaults.setCodable(time, forKey: UserDefaultsKey.dailyReminderTime)
try result.get()
}

func getLatestDailyReminderTime() throws -> DateComponents {
let result = userDefaults.object(DateComponents.self, forKey: UserDefaultsKey.dailyReminderTime)
return try result.get()
}

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

case translationTargetLocale

case dailyReminderTime

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

Expand Down
15 changes: 15 additions & 0 deletions Sources/DataDriverTesting/UserSettingsRepositoryFake.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ import RxSwift
enum UserSettingsRepositoryError: Error {

case notSavedUserSettings
case notSavedLatestDailyReminderTime

}

public final class UserSettingsRepositoryFake: UserSettingsRepositoryProtocol {

public var _userSettings: UserSettings?

public var _latestDailyReminderTime: DateComponents?

public init() {}

public func saveUserSettings(_ userSettings: Domain.UserSettings) -> RxSwift.Single<Void> {
Expand All @@ -42,4 +45,16 @@ public final class UserSettingsRepositoryFake: UserSettingsRepositoryProtocol {
}
}

public func updateLatestDailyReminderTime(_ time: DateComponents) throws {
_latestDailyReminderTime = time
}

public func getLatestDailyReminderTime() throws -> DateComponents {
guard let latestDailyReminderTime = _latestDailyReminderTime else {
throw UserSettingsRepositoryError.notSavedLatestDailyReminderTime
}

return latestDailyReminderTime
}

}
9 changes: 8 additions & 1 deletion Sources/Domain/DI/UserSettingsUseCaseAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@

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)

return UserSettingsUseCase.init(
userSettingsRepository: userSettingsRepository,
notificationCenter: UNUserNotificationCenter.current()
)
}
.inObjectScope(.container)
}

}

extension UNUserNotificationCenter: UserNotificationCenter {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ public protocol UserSettingsRepositoryProtocol {

func getUserSettings() -> Single<UserSettings>

func updateLatestDailyReminderTime(_ time: DateComponents) throws

func getLatestDailyReminderTime() throws -> DateComponents

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,35 @@
import Foundation
import RxSwift
import RxRelay
import UserNotifications

public protocol UserSettingsUseCaseProtocol {

var currentUserSettingsRelay: BehaviorRelay<UserSettings?> { get }

func updateTranslationLocale(source sourceLocale: TranslationLanguage, target targetLocale: TranslationLanguage) -> Single<Void>

var currentTranslationLocale: Single<(source: TranslationLanguage, target: TranslationLanguage)> { get }
func getCurrentTranslationLocale() -> Single<(source: TranslationLanguage, target: TranslationLanguage)>

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>

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

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

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

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

var currentUserSettings: Single<UserSettings> { get }
/// 마지막으로 설정한 매일 알림의 시간을 반환합니다.
func getLatestDailyReminderTime() throws -> DateComponents

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public protocol WordRxUseCaseProtocol {

func markCurrentWordAsMemorized(uuid: UUID) -> Single<Void>

var currentUnmemorizedWord: Word? { get }
func getCurrentUnmemorizedWord() -> Word?

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public protocol WordUseCaseProtocol {

func markCurrentWordAsMemorized(uuid: UUID)

var currentUnmemorizedWord: Word? { get }
func getCurrentUnmemorizedWord() -> Word?

}
2 changes: 2 additions & 0 deletions Sources/Domain/Localization/DomainString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ struct DomainString {
static let german = NSLocalizedString("german", bundle: Bundle.module, comment: "")
static let russian = NSLocalizedString("russian", bundle: Bundle.module, comment: "")

static let daily_reminder = NSLocalizedString("daily_reminder", bundle: Bundle.module, comment: "")

}
Loading

0 comments on commit f963d10

Please sign in to comment.