Skip to content

Commit 24c779a

Browse files
committed
[#4] refactor: editCardView Notification 로직 추가
1 parent b8cbf93 commit 24c779a

File tree

10 files changed

+120
-8
lines changed

10 files changed

+120
-8
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "6F41D59E27FAE04A00EA3FA8"
18+
BuildableName = "TodoList.app"
19+
BlueprintName = "TodoList"
20+
ReferencedContainer = "container:TodoList.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
<BuildableProductRunnable
44+
runnableDebuggingMode = "0">
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "6F41D59E27FAE04A00EA3FA8"
48+
BuildableName = "TodoList.app"
49+
BlueprintName = "TodoList"
50+
ReferencedContainer = "container:TodoList.xcodeproj">
51+
</BuildableReference>
52+
</BuildableProductRunnable>
53+
<AdditionalOptions>
54+
<AdditionalOption
55+
key = "NSZombieEnabled"
56+
value = "YES"
57+
isEnabled = "YES">
58+
</AdditionalOption>
59+
</AdditionalOptions>
60+
</LaunchAction>
61+
<ProfileAction
62+
buildConfiguration = "Release"
63+
shouldUseLaunchSchemeArgsEnv = "YES"
64+
savedToolIdentifier = ""
65+
useCustomWorkingDirectory = "NO"
66+
debugDocumentVersioning = "YES">
67+
<BuildableProductRunnable
68+
runnableDebuggingMode = "0">
69+
<BuildableReference
70+
BuildableIdentifier = "primary"
71+
BlueprintIdentifier = "6F41D59E27FAE04A00EA3FA8"
72+
BuildableName = "TodoList.app"
73+
BlueprintName = "TodoList"
74+
ReferencedContainer = "container:TodoList.xcodeproj">
75+
</BuildableReference>
76+
</BuildableProductRunnable>
77+
</ProfileAction>
78+
<AnalyzeAction
79+
buildConfiguration = "Debug">
80+
</AnalyzeAction>
81+
<ArchiveAction
82+
buildConfiguration = "Release"
83+
revealArchiveInOrganizer = "YES">
84+
</ArchiveAction>
85+
</Scheme>

iOS/TodoList/Base.lproj/Main.storyboard

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="70t-Qa-EDn">
9191
<rect key="frame" x="396" y="329" width="401" height="176"/>
9292
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
93-
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
9493
</view>
9594
</subviews>
9695
<viewLayoutGuide key="safeArea" id="uec-tf-4EG"/>
@@ -102,7 +101,7 @@
102101
</viewController>
103102
<placeholder placeholderIdentifier="IBFirstResponder" id="4zZ-Fi-tA0" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
104103
</objects>
105-
<point key="canvasLocation" x="1501" y="137"/>
104+
<point key="canvasLocation" x="138" y="812"/>
106105
</scene>
107106
<!--Action Board View Controller-->
108107
<scene sceneID="xEt-ac-OLo">

iOS/TodoList/Util/NameSpace.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ struct NameSpace {
1919
extension Notification.Name {
2020
static let actionFlowButtonTapped: Notification.Name = Notification.Name("actionFlowButtonTapped")
2121
static let actionFlowCloseButtonTapped: Notification.Name = Notification.Name("actionFlowCloseButtonTapped")
22-
22+
static let addTaskButtonTapped: Notification.Name = Notification.Name("addTaskButtonTapped")
23+
static let editButtonTapped: Notification.Name = Notification.Name("editButtonTapped")
24+
static let cancelButtonTapped: Notification.Name = Notification.Name("cancelButtonTapped")
2325
}

iOS/TodoList/View/ActionBoardView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ class ActionBoardView: UIView {
2929
}
3030

3131
private func addObserver() {
32-
NotificationCenter.default.addObserver(self, selector: #selector(toggle), name: Notification.Name.actionFlowButtonTapped, object: nil)
33-
NotificationCenter.default.addObserver(self, selector: #selector(toggle), name: Notification.Name.actionFlowCloseButtonTapped, object: nil)
32+
NotificationCenter.default.addObserver(forName: .actionFlowButtonTapped, object: nil, queue: .main, using: {_ in
33+
self.toggle()
34+
})
35+
NotificationCenter.default.addObserver(forName: .actionFlowCloseButtonTapped, object: nil, queue: .main, using: {_ in
36+
self.toggle()
37+
})
3438
}
3539

3640
}

iOS/TodoList/View/EditCardView.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ class EditCardView: UIView {
88
@IBOutlet private weak var editButton: UIButton!
99
@IBOutlet private weak var cancelButton: UIButton!
1010

11+
override init(frame: CGRect) {
12+
super.init(frame: frame)
13+
}
14+
15+
required init?(coder: NSCoder) {
16+
super.init(coder: coder)
17+
}
18+
1119
@IBAction func editButtonTapped(_ sender: UIButton) {
20+
NotificationCenter.default.post(name: .editButtonTapped, object: nil)
1221
}
1322
@IBAction func cancelButtonTapped(_ sender: UIButton) {
23+
NotificationCenter.default.post(name: .cancelButtonTapped, object: nil)
1424
}
1525
}

iOS/TodoList/View/TaskCardListView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class TaskCardListView: UIView {
2222
}
2323

2424
@IBAction func addTaskButtonTapped(_ sender: UIButton) {
25+
NotificationCenter.default.post(name: .addTaskButtonTapped, object: nil)
2526
}
2627
}
2728

iOS/TodoList/ViewController/ActionBoardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ActionBoardViewController: UIViewController {
1717
}
1818

1919
@IBAction func closeButtonTapped(_ sender: UIButton) {
20-
NotificationCenter.default.post(name: Notification.Name.actionFlowCloseButtonTapped, object: nil)
20+
NotificationCenter.default.post(name: .actionFlowCloseButtonTapped, object: nil)
2121
}
2222
}
2323

iOS/TodoList/ViewController/EditCardViewController.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,12 @@ class EditCardViewController: UIViewController {
77
super.viewDidLoad()
88
guard let editCardView = Bundle.main.loadNibNamed(NameSpace.nib.editCardView, owner: nil, options: nil)?.first as? EditCardView else { return }
99
self.centerView.addSubview(editCardView)
10+
11+
NotificationCenter.default.addObserver(forName: .cancelButtonTapped, object: nil, queue: .main, using: {_ in
12+
self.dismiss(animated: false)
13+
})
14+
NotificationCenter.default.addObserver(forName: .editButtonTapped, object: nil, queue: .main, using: {_ in
15+
self.dismiss(animated: false)
16+
})
1017
}
1118
}

iOS/TodoList/ViewController/MyTaskViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ class MyTaskViewController: UIViewController {
1616
resizeConstant()
1717
actionBoard.moveView()
1818
setupChildViewContoller()
19+
20+
NotificationCenter.default.addObserver(forName: .addTaskButtonTapped, object: nil, queue: .main) { _ in
21+
self.editCardButtonTapped()
22+
}
1923
}
2024

2125
@IBAction func actionFlowButtonTapped(_ sender: UIButton) {
22-
NotificationCenter.default.post(name: Notification.Name.actionFlowButtonTapped, object: nil)
26+
NotificationCenter.default.post(name: .actionFlowButtonTapped, object: nil)
2327
}
2428

2529
private func setupChildViewContoller() {

iOS/TodoList/Xib/TaskCardListView.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<constraints>
6868
<constraint firstItem="oul-8H-180" firstAttribute="top" secondItem="0sR-f9-J2x" secondAttribute="bottom" constant="16" id="3Rd-xM-NnS"/>
6969
<constraint firstItem="oul-8H-180" firstAttribute="top" secondItem="HBY-PI-YWR" secondAttribute="bottom" constant="16" id="9zK-fz-0zb"/>
70-
<constraint firstItem="oul-8H-180" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="GB3-eJ-T5F"/>
70+
<constraint firstItem="oul-8H-180" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="44" id="GB3-eJ-T5F"/>
7171
<constraint firstItem="ez7-ve-Lzi" firstAttribute="firstBaseline" secondItem="HBY-PI-YWR" secondAttribute="firstBaseline" id="TvG-ST-ALh"/>
7272
<constraint firstItem="0sR-f9-J2x" firstAttribute="leading" secondItem="oul-8H-180" secondAttribute="leading" constant="8" id="Zro-Bf-ahz"/>
7373
<constraint firstItem="HBY-PI-YWR" firstAttribute="leading" secondItem="0sR-f9-J2x" secondAttribute="trailing" constant="8" id="abj-xj-EgP"/>

0 commit comments

Comments
 (0)