Skip to content

Commit

Permalink
Merge pull request #1 from maxhyunm/step4_max
Browse files Browse the repository at this point in the history
Step4 max
  • Loading branch information
maxhyunm authored Oct 21, 2023
2 parents 45af789 + fc50531 commit c0b082e
Show file tree
Hide file tree
Showing 57 changed files with 2,998 additions and 157 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ xcuserdata/
*.moved-aside
*.xccheckout
*.xcscmblueprint
Key.plist

## Obj-C/Swift specific
*.hmap
Expand Down
9 changes: 9 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
disabled_rules:
- trailing_whitespace

excluded:
- Pods
- Diary/App/AppDelegate.swift
- Diary/App/SceneDelegate.swift
- Diary/Model/Diary+CoreDataClass.swift
- Diary/Model/Diary+CoreDataProperties.swift
276 changes: 259 additions & 17 deletions Diary.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions Diary.xcodeproj/xcshareddata/xcschemes/Diary.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C739AE20284DF28600741E8F"
BuildableName = "Diary.app"
BlueprintName = "Diary"
ReferencedContainer = "container:Diary.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = "en"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C739AE20284DF28600741E8F"
BuildableName = "Diary.app"
BlueprintName = "Diary"
ReferencedContainer = "container:Diary.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C739AE20284DF28600741E8F"
BuildableName = "Diary.app"
BlueprintName = "Diary"
ReferencedContainer = "container:Diary.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 10 additions & 0 deletions Diary.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Diary.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
31 changes: 31 additions & 0 deletions Diary/App/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Diary - AppDelegate.swift
// Created by yagom.
// Copyright © yagom. All rights reserved.
// Last modified by Maxhyunm, Hamg.

import UIKit
import CoreData

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}

25 changes: 16 additions & 9 deletions Diary/SceneDelegate.swift → Diary/App/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
//
// Diary - SceneDelegate.swift
// Created by yagom.
// Created by yagom.
// Copyright © yagom. All rights reserved.
//
// Last modified by Maxhyunm, Hamg.

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

let diaryManager = DiaryManager<Diary>()

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
guard let windowScene = (scene as? UIWindowScene) else { return }

window = UIWindow(windowScene: windowScene)
let diaryListViewController = DiaryListViewController()
diaryListViewController.diaryManager = diaryManager
let navigationController = UINavigationController(rootViewController: diaryListViewController)
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
}

func sceneDidDisconnect(_ scene: UIScene) {
Expand Down Expand Up @@ -46,9 +50,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// to restore the scene back to its current state.

// Save changes in the application's managed object context when the application transitions to the background.
(UIApplication.shared.delegate as? AppDelegate)?.saveContext()
do {
try diaryManager.saveContext()
} catch {
fatalError(CoreDataError.saveFailure.message)
}
}


}

80 changes: 0 additions & 80 deletions Diary/AppDelegate.swift

This file was deleted.

12 changes: 12 additions & 0 deletions Diary/Assets.xcassets/sample.dataset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"data" : [
{
"filename" : "sample.json",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit c0b082e

Please sign in to comment.