-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #586 from wakmusic/583-refacory-dependency-on-sear…
…ch-feature 🔀 :: (#583) 검색 탭의 의존성 관계를 재정의 합니다.
- Loading branch information
Showing
34 changed files
with
641 additions
and
267 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
5 changes: 5 additions & 0 deletions
5
Projects/Features/SearchFeature/Interface/Factory/ListSearchResultFactory.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,5 @@ | ||
import UIKit | ||
|
||
public protocol ListSearchResultFactory { | ||
func makeView(_ text: String) -> UIViewController | ||
} |
3 changes: 1 addition & 2 deletions
3
...terface/Factory/SearchResultFactory.swift → ...ace/Factory/SongSearchResultFactory.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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import Foundation | ||
import UIKit | ||
|
||
public protocol SongSearchResultFactory { | ||
func makeView() -> UIViewController | ||
func makeView(_ text: String) -> UIViewController | ||
} |
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
12 changes: 12 additions & 0 deletions
12
Projects/Features/SearchFeature/Sources/Components/ListSearchResultComponent.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,12 @@ | ||
import BaseFeature | ||
import BaseFeatureInterface | ||
import Foundation | ||
import NeedleFoundation | ||
import SearchFeatureInterface | ||
import UIKit | ||
|
||
public final class ListSearchResultComponent: Component<EmptyDependency>, ListSearchResultFactory { | ||
public func makeView(_ text: String) -> UIViewController { | ||
ListSearchResultViewController(reactor: ListSearchResultReactor(text)) | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...ures/SearchFeature/Sources/CompositionalLayout/Enum/Section/ListSearchResultSection.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,12 @@ | ||
import Foundation | ||
|
||
internal enum ListSearchResultSection: Hashable { | ||
case list | ||
|
||
var title: String { | ||
switch self { | ||
case .list: | ||
"노래" | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ures/SearchFeature/Sources/CompositionalLayout/Enum/Section/SongSearchResultSection.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
46 changes: 46 additions & 0 deletions
46
...archFeature/Sources/CompositionalLayout/Layout/ListSearchResultCollectionViewLayout.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,46 @@ | ||
import UIKit | ||
import Utility | ||
|
||
final class ListSearchResultCollectionViewLayout: UICollectionViewCompositionalLayout { | ||
init() { | ||
super.init { _, _ in | ||
|
||
return ListSearchResultCollectionViewLayout.configureLayout() | ||
} | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} | ||
|
||
extension ListSearchResultCollectionViewLayout { | ||
private static func configureLayout() -> NSCollectionLayoutSection { | ||
let itemSize = NSCollectionLayoutSize( | ||
widthDimension: .fractionalWidth(1.0), | ||
heightDimension: .fractionalHeight(1.0) | ||
) | ||
|
||
let headerLayout = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .absolute(30)) | ||
|
||
let header = NSCollectionLayoutBoundarySupplementaryItem( | ||
layoutSize: headerLayout, | ||
elementKind: SearchResultHeaderView.kind, | ||
alignment: .top | ||
) | ||
|
||
let item: NSCollectionLayoutItem = NSCollectionLayoutItem(layoutSize: itemSize) | ||
let groupSize = NSCollectionLayoutSize( | ||
widthDimension: .fractionalWidth(1.0), | ||
heightDimension: .absolute(60.0) | ||
) | ||
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) | ||
|
||
let section = NSCollectionLayoutSection(group: group) | ||
section.contentInsets = NSDirectionalEdgeInsets(top: .zero, leading: 20.0, bottom: 20.0, trailing: 20.0) | ||
section.boundarySupplementaryItems = [header] | ||
|
||
return section | ||
} | ||
} |
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
Oops, something went wrong.