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

일기장 [STEP 2] Mary, Whales #134

Open
wants to merge 26 commits into
base: ic_9_whale
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fecc10b
:sparkles: Feat: Core Data 모델 생성 및 CRUD 구현
MaryJo-github Sep 5, 2023
971a07b
✨ Feat: 새 일기 추가 화면에서 자동으로 키보드 보여주는 기능 추가
WhalesJin Sep 5, 2023
03b05c1
✨ Feat: 일기 편집 화면에서 키보드가 숨김/해제 되도록 TapGesture 추가
WhalesJin Sep 5, 2023
eee7407
:sparkles: Feat: 일기 자동 저장 구현
MaryJo-github Sep 6, 2023
a200cfa
Revert ":sparkles: Feat: 일기 자동 저장 구현"
MaryJo-github Sep 6, 2023
5248c7b
:sparkles: Feat: 일기 자동 저장 구현
MaryJo-github Sep 6, 2023
5f79326
♻️ Refactor: CoreData에 저장된 DiaryContent 불러오기
WhalesJin Sep 6, 2023
ef67611
✨ Feat: 일기 편집 화면에 더보기 버튼 및 액션 시트 추가
WhalesJin Sep 6, 2023
fbc2d86
:recycle: Refactor: DiaryManager struct -> class 변경
MaryJo-github Sep 7, 2023
a180043
:sparkles: Feat: ActivityView 및 CheckDeleteAlert 구현 및 적용
MaryJo-github Sep 7, 2023
1fb5d7d
:recycle: Refactor: presentActivityView 메서드를 PresentableActivityView …
MaryJo-github Sep 8, 2023
0dcaad6
📝 Docs: Update README.md
WhalesJin Sep 8, 2023
1c89149
:recycle: Refactor: 일기장 내용이 비어있으면 저장하지 않도록 수정
MaryJo-github Sep 12, 2023
45db402
:sparkles: Feat: cell swipe시 공유 및 삭제 기능 추가
MaryJo-github Sep 12, 2023
936d211
✨ Feat: 문자열 로컬라이저 적용
WhalesJin Sep 12, 2023
a45087f
🐛 Fix: 빈 텍스트뷰 클릭 후 입력 시 데이터 저장 안되는 오류 수정
WhalesJin Sep 12, 2023
1ec8d4a
:adhesive_bandage: Chore: tableView 상수로 변경 및 configure 메서드 병합
MaryJo-github Sep 14, 2023
7eb44ef
:recycle: Refactor: String extension localized 프로퍼티 추가
MaryJo-github Sep 14, 2023
95dd5d9
:adhesive_bandage: Chore: 네이밍 수정
MaryJo-github Sep 15, 2023
8928097
✨ Feat: Logger 타입 생성해서 DiaryViewController에 주입
WhalesJin Sep 15, 2023
d838492
:recycle: Refactor: TableViewCell의 AutoLayout 변경
MaryJo-github Sep 15, 2023
cfecbc7
♻️ Refactor: if 문을 guard 문으로 로직 수정
WhalesJin Sep 15, 2023
c9e4490
:recycle: Refactor: ContainerManager를 DiaryManager에 병합
MaryJo-github Sep 16, 2023
dfc8a85
✨ Feat: 데이터 저장 및 삭제 실패시 Alert 띄우기
WhalesJin Sep 16, 2023
a3fae63
:sparkles: Feat: DiaryEditable 프로토콜 생성 및 DiaryManager에서 채택
MaryJo-github Sep 16, 2023
3883a95
♻️ Refactor: weak self 추가
MaryJo-github Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Diary+CoreDataClass.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Diary+CoreDataClass.swift
// Diary
//
// Created by Mary & Whales on 2023/09/05.
//
//

import Foundation
import CoreData

@objc(Diary)
public class Diary: NSManagedObject {

}
27 changes: 27 additions & 0 deletions Diary+CoreDataProperties.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Diary+CoreDataProperties.swift
// Diary
//
// Created by Mary & Whales on 2023/09/05.
//
//

import Foundation
import CoreData

extension Diary {

@nonobjc public class func fetchRequest() -> NSFetchRequest<Diary> {
return NSFetchRequest<Diary>(entityName: "Diary")
}

@NSManaged public var title: String
@NSManaged public var body: String
@NSManaged public var timeInterval: Double
@NSManaged public var id: UUID

}

extension Diary: Identifiable {

}
24 changes: 24 additions & 0 deletions Diary.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
3C3C08902AA3AB6C00C8D4CF /* UIViewController+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C3C088F2AA3AB6C00C8D4CF /* UIViewController+.swift */; };
3C3C08EE2AA6055500C8D4CF /* Collection+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C3C08ED2AA6055500C8D4CF /* Collection+.swift */; };
3C3C08F02AA6241D00C8D4CF /* DateFormatter+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C3C08EF2AA6241D00C8D4CF /* DateFormatter+.swift */; };
3C6B0B772AB427C30011E59D /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C6B0B762AB427C30011E59D /* Logger.swift */; };
3CCA1E772A9DBF56008683C3 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = 3CCA1E762A9DBF56008683C3 /* .swiftlint.yml */; };
3CCA1E792A9F08C8008683C3 /* DiaryContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCA1E782A9F08C8008683C3 /* DiaryContent.swift */; };
444E73F82AAAFA940079BEE5 /* ActivityViewPresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 444E73F72AAAFA940079BEE5 /* ActivityViewPresentable.swift */; };
4495F2EF2A9CCF62007D5278 /* DiaryTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4495F2EE2A9CCF62007D5278 /* DiaryTableViewCell.swift */; };
44A761BA2A9F100900C10AE2 /* DecodingManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A761B92A9F100900C10AE2 /* DecodingManager.swift */; };
44A761BD2A9F142B00C10AE2 /* DataError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A761BC2A9F142B00C10AE2 /* DataError.swift */; };
44A761BF2A9F163600C10AE2 /* DiaryManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A761BE2A9F163600C10AE2 /* DiaryManager.swift */; };
44A761C12A9F7A6100C10AE2 /* EditingDiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A761C02A9F7A6100C10AE2 /* EditingDiaryViewController.swift */; };
44A762012AA5F96700C10AE2 /* UITableViewCell+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A762002AA5F96700C10AE2 /* UITableViewCell+.swift */; };
44A762032AA6031800C10AE2 /* ReuseIdentifiable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A762022AA6031800C10AE2 /* ReuseIdentifiable.swift */; };
44A7622D2AA710F000C10AE2 /* Diary+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A7622B2AA710F000C10AE2 /* Diary+CoreDataClass.swift */; };
44A7622E2AA710F000C10AE2 /* Diary+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A7622C2AA710F000C10AE2 /* Diary+CoreDataProperties.swift */; };
44DC00332AB36F6000AF3C0E /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44DC00322AB36F6000AF3C0E /* String+.swift */; };
44DC00572AB630E900AF3C0E /* DiaryEditable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44DC00562AB630E900AF3C0E /* DiaryEditable.swift */; };
C739AE25284DF28600741E8F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE24284DF28600741E8F /* AppDelegate.swift */; };
C739AE27284DF28600741E8F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE26284DF28600741E8F /* SceneDelegate.swift */; };
C739AE29284DF28600741E8F /* DiaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C739AE28284DF28600741E8F /* DiaryViewController.swift */; };
Expand All @@ -34,15 +40,21 @@
3C3C088F2AA3AB6C00C8D4CF /* UIViewController+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+.swift"; sourceTree = "<group>"; };
3C3C08ED2AA6055500C8D4CF /* Collection+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Collection+.swift"; sourceTree = "<group>"; };
3C3C08EF2AA6241D00C8D4CF /* DateFormatter+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+.swift"; sourceTree = "<group>"; };
3C6B0B762AB427C30011E59D /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
3CCA1E762A9DBF56008683C3 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = "<group>"; };
3CCA1E782A9F08C8008683C3 /* DiaryContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryContent.swift; sourceTree = "<group>"; };
444E73F72AAAFA940079BEE5 /* ActivityViewPresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityViewPresentable.swift; sourceTree = "<group>"; };
4495F2EE2A9CCF62007D5278 /* DiaryTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryTableViewCell.swift; sourceTree = "<group>"; };
44A761B92A9F100900C10AE2 /* DecodingManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecodingManager.swift; sourceTree = "<group>"; };
44A761BC2A9F142B00C10AE2 /* DataError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataError.swift; sourceTree = "<group>"; };
44A761BE2A9F163600C10AE2 /* DiaryManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryManager.swift; sourceTree = "<group>"; };
44A761C02A9F7A6100C10AE2 /* EditingDiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditingDiaryViewController.swift; sourceTree = "<group>"; };
44A762002AA5F96700C10AE2 /* UITableViewCell+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableViewCell+.swift"; sourceTree = "<group>"; };
44A762022AA6031800C10AE2 /* ReuseIdentifiable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReuseIdentifiable.swift; sourceTree = "<group>"; };
44A7622B2AA710F000C10AE2 /* Diary+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Diary+CoreDataClass.swift"; sourceTree = "<group>"; };
44A7622C2AA710F000C10AE2 /* Diary+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Diary+CoreDataProperties.swift"; sourceTree = "<group>"; };
44DC00322AB36F6000AF3C0E /* String+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = "<group>"; };
44DC00562AB630E900AF3C0E /* DiaryEditable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryEditable.swift; sourceTree = "<group>"; };
C739AE21284DF28600741E8F /* Diary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Diary.app; sourceTree = BUILT_PRODUCTS_DIR; };
C739AE24284DF28600741E8F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C739AE26284DF28600741E8F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -71,6 +83,7 @@
3C3C08EF2AA6241D00C8D4CF /* DateFormatter+.swift */,
3C3C088F2AA3AB6C00C8D4CF /* UIViewController+.swift */,
44A762002AA5F96700C10AE2 /* UITableViewCell+.swift */,
44DC00322AB36F6000AF3C0E /* String+.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand All @@ -89,6 +102,9 @@
children = (
44A761B92A9F100900C10AE2 /* DecodingManager.swift */,
44A762022AA6031800C10AE2 /* ReuseIdentifiable.swift */,
444E73F72AAAFA940079BEE5 /* ActivityViewPresentable.swift */,
3C6B0B762AB427C30011E59D /* Logger.swift */,
44DC00562AB630E900AF3C0E /* DiaryEditable.swift */,
);
path = Utility;
sourceTree = "<group>";
Expand Down Expand Up @@ -141,6 +157,8 @@
C739AE18284DF28600741E8F = {
isa = PBXGroup;
children = (
44A7622B2AA710F000C10AE2 /* Diary+CoreDataClass.swift */,
44A7622C2AA710F000C10AE2 /* Diary+CoreDataProperties.swift */,
3C3C086B2AA1DD8D00C8D4CF /* Localizable.strings */,
3CCA1E762A9DBF56008683C3 /* .swiftlint.yml */,
C739AE23284DF28600741E8F /* Diary */,
Expand Down Expand Up @@ -268,7 +286,10 @@
buildActionMask = 2147483647;
files = (
44A761BA2A9F100900C10AE2 /* DecodingManager.swift in Sources */,
44A7622D2AA710F000C10AE2 /* Diary+CoreDataClass.swift in Sources */,
44DC00332AB36F6000AF3C0E /* String+.swift in Sources */,
44A762032AA6031800C10AE2 /* ReuseIdentifiable.swift in Sources */,
3C6B0B772AB427C30011E59D /* Logger.swift in Sources */,
C739AE29284DF28600741E8F /* DiaryViewController.swift in Sources */,
4495F2EF2A9CCF62007D5278 /* DiaryTableViewCell.swift in Sources */,
C739AE25284DF28600741E8F /* AppDelegate.swift in Sources */,
Expand All @@ -277,8 +298,11 @@
C739AE27284DF28600741E8F /* SceneDelegate.swift in Sources */,
44A761BD2A9F142B00C10AE2 /* DataError.swift in Sources */,
44A762012AA5F96700C10AE2 /* UITableViewCell+.swift in Sources */,
444E73F82AAAFA940079BEE5 /* ActivityViewPresentable.swift in Sources */,
3C3C08902AA3AB6C00C8D4CF /* UIViewController+.swift in Sources */,
44A7622E2AA710F000C10AE2 /* Diary+CoreDataProperties.swift in Sources */,
3C3C08F02AA6241D00C8D4CF /* DateFormatter+.swift in Sources */,
44DC00572AB630E900AF3C0E /* DiaryEditable.swift in Sources */,
C739AE2F284DF28600741E8F /* Diary.xcdatamodeld in Sources */,
44A761C12A9F7A6100C10AE2 /* EditingDiaryViewController.swift in Sources */,
3CCA1E792A9F08C8008683C3 /* DiaryContent.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion Diary/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
guard let diaryManager = try? DiaryManager() else { return }

let rootViewController = DiaryViewController()
let rootViewController = DiaryViewController(diaryManager: diaryManager)
let navigationController = UINavigationController(rootViewController: rootViewController)

window = UIWindow(windowScene: windowScene)
Expand Down
110 changes: 84 additions & 26 deletions Diary/Controller/DiaryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
import UIKit

final class DiaryViewController: UIViewController {
private var diaryManager: DiaryManager
private let diaryManager: DiaryEditable
private let logger: Logger

private var tableView: UITableView = {
private let tableView: UITableView = {
let tableView = UITableView()
tableView.translatesAutoresizingMaskIntoConstraints = false

return tableView
}()

init(diaryManager: DiaryManager = DiaryManager()) {
init(diaryManager: DiaryEditable, logger: Logger = Logger()) {
self.diaryManager = diaryManager
self.logger = logger

super.init(nibName: nil, bundle: nil)
}
Expand All @@ -28,19 +30,24 @@ final class DiaryViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

configureView()
configureUI()
configureTableView()
setUpConstraints()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

fetchDiaryContents()
refreshDiaries()
tableView.reloadData()
}

private func configureView() {
private func configureUI() {
view.backgroundColor = .systemBackground
view.addSubview(tableView)

configureNavigationItem()
setupConstraints()
}

private func configureNavigationItem() {
Expand All @@ -49,7 +56,7 @@ final class DiaryViewController: UIViewController {
action: #selector(tappedAddDiaryButton))

navigationItem.rightBarButtonItem = addDiaryBarButtonItem
navigationItem.title = String(localized: "title")
navigationItem.title = "title".localized
}

@objc private func tappedAddDiaryButton() {
Expand All @@ -59,7 +66,9 @@ final class DiaryViewController: UIViewController {
}

private func showEditingDiaryViewController(with diaryContent: DiaryContent) {
let editingDiaryViewController = EditingDiaryViewController(with: diaryContent)
let editingDiaryViewController = EditingDiaryViewController(diaryManager: diaryManager,
logger: logger,
with: diaryContent)

show(editingDiaryViewController, sender: self)
}
Expand All @@ -70,28 +79,19 @@ final class DiaryViewController: UIViewController {
tableView.register(DiaryTableViewCell.self, forCellReuseIdentifier: DiaryTableViewCell.reuseIdentifier)
}

private func setUpConstraints() {
private func setupConstraints() {
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
tableView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
tableView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
])
}

private func fetchDiaryContents() {
do {
try diaryManager.fetchDiaryContents(name: "sample")
} catch {
print(error.localizedDescription)
presentAlertWith(title: "데이터 불러오기 실패", message: "앱을 다시 실행해주십시오.", actionConfigs: ("확인", .default, nil))
}
}
}

extension DiaryViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return diaryManager.diaryContents?.count ?? .zero
return diaryManager.diaryContents.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
Expand All @@ -103,8 +103,7 @@ extension DiaryViewController: UITableViewDataSource {
return UITableViewCell()
}

guard let diaryContents = diaryManager.diaryContents,
let diaryContent = diaryContents[safe: indexPath.row]
guard let diaryContent = diaryManager.diaryContents[safe: indexPath.row]
else {
return UITableViewCell()
}
Expand All @@ -115,15 +114,74 @@ extension DiaryViewController: UITableViewDataSource {
}
}

extension DiaryViewController: UITableViewDelegate {
extension DiaryViewController: UITableViewDelegate, ActivityViewPresentable {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let diaryContents = diaryManager.diaryContents,
let diaryContent = diaryContents[safe: indexPath.row]
guard let diaryContent = diaryManager.diaryContents[safe: indexPath.row]
else {
return
}

showEditingDiaryViewController(with: diaryContent)
havilog marked this conversation as resolved.
Show resolved Hide resolved
tableView.deselectRow(at: indexPath, animated: true)
}

func tableView(_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
guard let diaryContent = diaryManager.diaryContents[safe: indexPath.row]
else {
return nil
}

let share = UIContextualAction(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

escaping하는 closure에서 self를 잡을 때 메모리가 어떻게 되는지, 어떤 점을 주의해야하고 사용해야하는지 설명해주세요~

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기본적으로 클로저 내부에서 self를 사용하는 경우 클로저는 self에 대한 강한 참조를 유지합니다. 그리고 만약 클로저 내부에서 self의 프로퍼티에 저장하는 것과 같이 self가 클로저에 대한 강한 참조를 유지하는 경우, self와 클로저 간 순환 참조가 발생하게 됩니다.
순환 참조가 발생하게되면 각 인스턴스가 할당 해제되는 것을 방지하여 앱에서 메모리 누수를 유발하기 때문에 주의하고 사용해야합니다.

style: .normal,
title: "share".localized
) { [weak self] (_, _, success: @escaping (Bool) -> Void) in

let diaryContentItem = diaryContent.title + diaryContent.body

self?.presentActivityView(shareItem: diaryContentItem)
success(true)
}

let delete = UIContextualAction(
style: .destructive,
title: "delete".localized
) { [weak self] (_, _, success: @escaping (Bool) -> Void) in

self?.presentCheckDeleteAlert { [weak self] _ in
self?.deleteDiary(id: diaryContent.id)
tableView.deleteRows(at: [indexPath], with: .fade)
}

success(true)
}

return UISwipeActionsConfiguration(actions: [delete, share])
}
}

extension DiaryViewController {
private func refreshDiaries() {
do {
try diaryManager.refresh()
} catch {
logger.osLog(error.localizedDescription)
presentAlert(title: "failedFetchDataAlertTitle".localized,
message: "failedFetchDataAlertMessage".localized,
preferredStyle: .alert,
actionConfigs: ("failedFetchDataAlertAction".localized, .default, nil))
}
}

private func deleteDiary(id: UUID) {
do {
try diaryManager.delete(id: id)
} catch {
logger.osLog(error.localizedDescription)
presentAlert(title: "failedDeleteDataAlertTitle".localized,
message: "failedDeleteDataAlertMessage".localized,
preferredStyle: .alert,
actionConfigs: ("failedDeleteDataAlertAction".localized, .default, nil))
}
}
}
Loading