Skip to content

Commit

Permalink
feat: segmentControl 추가 (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellyheetov committed Jun 24, 2021
1 parent e45df7a commit 89de267
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 3 additions & 0 deletions iOS/issue-tracker/IssueList/IssueCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class IssueCoordinator: NSObject, Coordinator {
let issueEditVC = UIStoryboard(name: StoryBoardName.IssueEdit.description, bundle: nil)
.instantiateViewController(withIdentifier: IssueEditViewController.reuseIdentifier) as! IssueEditViewController

let segmentController = UISegmentedControl(items: IssueEditViewController.Segment.titles)
segmentController.selectedSegmentIndex = IssueEditViewController.Segment.markdown.status
issueEditVC.navigationItem.titleView = segmentController
navigationController.pushViewController(issueEditVC, animated: true)
}

Expand Down
11 changes: 11 additions & 0 deletions iOS/issue-tracker/NewIssue/IssueEditViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ class IssueEditViewController: UIViewController, ReuseIdentity {
private var tableDelegate = AdditionalTableDelegate()
private var tableDataSource = AdditionalTableViewDataSource()

enum Segment: Int {
case markdown
case preview

var status: Int {
return self.rawValue
}
static var titles: [String] {
return ["마크다운", "미리보기"]
}
}
private lazy var photoPicker = ImagePicker(presentationController: self, delegate: self)

override func viewDidLoad() {
Expand Down

0 comments on commit 89de267

Please sign in to comment.