forked from Lia316/issue-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨New Issue 저장 전까지 구현(Lia316#106, Lia316#134)
이슈 목록창에서 '+' 버튼 클릭시 새로운 이슈를 작성할 수 있는 View Controller로 이동하며 마크다운 형식으로 작성할시 Preview를 통해 확인 할 수 있다. 텍스트 뷰를 길게 탭할시 'Insert Photo'를 지원하며 성공적으로 업로드 되면 바로 마크다운 형식으로 텍스트뷰에 삽입된다
- Loading branch information
Showing
17 changed files
with
663 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ios/IssueTracker/IssueTracker/IssueList/Utility/Filterable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// Filterable.swift | ||
// IssueTracker | ||
// | ||
// Created by 지북 on 2021/06/18. | ||
// | ||
|
||
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
ios/IssueTracker/IssueTracker/NewIssue/Model/FilterItem.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// FilterItem.swift | ||
// IssueTracker | ||
// | ||
// Created by 지북 on 2021/06/21. | ||
// | ||
|
||
import Foundation | ||
|
||
struct FilterItem: Decodable { | ||
let id: Int | ||
let name: String | ||
} |
18 changes: 18 additions & 0 deletions
18
ios/IssueTracker/IssueTracker/NewIssue/Model/ImageFile.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// ImageFile.swift | ||
// IssueTracker | ||
// | ||
// Created by 지북 on 2021/06/21. | ||
// | ||
|
||
import Foundation | ||
|
||
struct ImageFile: Decodable { | ||
let id: Int | ||
let name: String | ||
let path: String | ||
|
||
func markdownImagePath() -> String { | ||
return "![\(name)](https://issue-tracker-swagger.herokuapp.com\(path))" | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
ios/IssueTracker/IssueTracker/NewIssue/UseCase/FetchFilterSectionsUseCase.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// FetchFilterSectionsUseCase.swift | ||
// IssueTracker | ||
// | ||
// Created by 지북 on 2021/06/21. | ||
// | ||
|
||
import UIKit | ||
import Combine | ||
|
||
protocol FetchFilterSectionsUseCase { | ||
func excute(completion: @escaping (Result<FilteringSection, NetworkError>) -> Void) | ||
} | ||
|
||
|
||
final class DefaultFetchFilterSectionsUseCase: FetchFilterSectionsUseCase { | ||
|
||
private var networkManager: NetworkManageable | ||
private var cancelBag = Set<AnyCancellable>() | ||
|
||
init(_ networkManager: NetworkManageable) { | ||
self.networkManager = networkManager | ||
} | ||
|
||
func excute(completion: @escaping (Result<FilteringSection, NetworkError>) -> Void) { | ||
|
||
networkManager.get(path: "/labels", type: [FilterItem].self) | ||
.receive(on: DispatchQueue.main) | ||
.sink { error in | ||
switch error { | ||
case .failure(let error): completion(.failure(error)) | ||
case .finished: break | ||
} | ||
} receiveValue: { items in | ||
let section = FilteringSection.init(name: "Label", items: items) | ||
completion(.success(section)) | ||
}.store(in: &cancelBag) | ||
|
||
networkManager.get(path: "/milestones", type: [FilterItem].self) | ||
.receive(on: DispatchQueue.main) | ||
.sink { error in | ||
switch error { | ||
case .failure(let error): completion(.failure(error)) | ||
case .finished: break | ||
} | ||
} receiveValue: { items in | ||
let section = FilteringSection.init(name: "Milestone", items: items) | ||
completion(.success(section)) | ||
}.store(in: &cancelBag) | ||
|
||
networkManager.get(path: "/users", type: [FilterItem].self) | ||
.receive(on: DispatchQueue.main) | ||
.sink { error in | ||
switch error { | ||
case .failure(let error): completion(.failure(error)) | ||
case .finished: break | ||
} | ||
} receiveValue: { items in | ||
let section = FilteringSection.init(name: "Assignee", items: items) | ||
completion(.success(section)) | ||
}.store(in: &cancelBag) | ||
} | ||
|
||
} |
Oops, something went wrong.