Skip to content

Commit

Permalink
feat: Insert Photo Menu Item 추가 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellyheetov committed Jun 10, 2021
1 parent 1f373f8 commit 7a06e63
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion iOS/issue-tracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
children = (
10D4257F2670912800AE119C /* issue-tracker.entitlements */,
10BCA8A7266F3C0000DBBA61 /* Font */,
10D4258326709D3300AE119C /* Extension */,
10CE4D99266EFB5700FBD593 /* AppDelegate.swift */,
10CE4D9B266EFB5700FBD593 /* SceneDelegate.swift */,
10CE4D9D266EFB5700FBD593 /* ViewController.swift */,
Expand All @@ -119,7 +120,6 @@
10CE4DA2266EFB5700FBD593 /* Assets.xcassets */,
10CE4DA4266EFB5700FBD593 /* LaunchScreen.storyboard */,
10CE4DA7266EFB5700FBD593 /* Info.plist */,
10D4258326709D3300AE119C /* Extension */,
10D4258026709CB000AE119C /* IssueList */,
10BCA8A3266F38D700DBBA61 /* Login */,
);
Expand Down
3 changes: 2 additions & 1 deletion iOS/issue-tracker/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<constraint firstAttribute="height" constant="44" id="NHX-2w-MUj"/>
</constraints>
</stackView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="pa6-0w-fC8">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="pa6-0w-fC8">
<rect key="frame" x="0.0" y="686" width="414" height="176"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
Expand All @@ -187,6 +187,7 @@
</view>
<connections>
<outlet property="additionalInfoTable" destination="pa6-0w-fC8" id="ZUg-Nt-XKH"/>
<outlet property="textContent" destination="kSq-iB-zDu" id="005-ad-Ppi"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Hbs-zq-eec" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
Expand Down
4 changes: 4 additions & 0 deletions iOS/issue-tracker/IssueList/AdditionalTableDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ class AdditionalTableDelegate: NSObject, UITableViewDelegate {
header.textLabel?.textColor = UIColor.black
header.textLabel?.font = UIFont.boldSystemFont(ofSize: 20)
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class AdditionalTableViewDataSource: NSObject, UITableViewDataSource {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: AdditionalTableViewCell.reuseIdentifier, for: indexPath) as? AdditionalTableViewCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: AdditionalTableViewCell.reuseIdentifier,
for: indexPath) as? AdditionalTableViewCell
else {
return UITableViewCell()
}
Expand Down
17 changes: 15 additions & 2 deletions iOS/issue-tracker/IssueList/IssueEditViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@

import UIKit

class IssueEditViewController: UIViewController, UITableViewDelegate {
class IssueEditViewController: UIViewController {

@IBOutlet weak var additionalInfoTable: UITableView!
@IBOutlet weak var textContent: UITextView!

private var tableDelegate = AdditionalTableDelegate()
private var tableDataSource = AdditionalTableViewDataSource()

override func viewDidLoad() {
super.viewDidLoad()

self.additionalInfoTable.delegate = tableDelegate
self.additionalInfoTable.dataSource = tableDataSource
self.textContent.delegate = self

registerNib()
configureTable()
}

private func registerNib(){

additionalInfoTable.register(UINib(nibName: AdditionalTableViewCell.nibName, bundle: nil),
forCellReuseIdentifier: AdditionalTableViewCell.reuseIdentifier)

Expand All @@ -35,4 +37,15 @@ class IssueEditViewController: UIViewController, UITableViewDelegate {
self.additionalInfoTable.tableFooterView = UIView()
}

@objc
func insertPhoto(){

}
}
extension IssueEditViewController: UITextViewDelegate {

func textViewDidBeginEditing(_ textView: UITextView) {
let menuItem = UIMenuItem(title: "Insert Photo", action: #selector(insertPhoto))
UIMenuController.shared.menuItems = [menuItem]
}
}

0 comments on commit 7a06e63

Please sign in to comment.