Skip to content

Commit

Permalink
SwiftFormat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dogo committed Aug 19, 2023
1 parent bf88acf commit a31c2f1
Show file tree
Hide file tree
Showing 44 changed files with 219 additions and 219 deletions.
6 changes: 3 additions & 3 deletions SWDestinyTrades/Classes/About/View/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ extension AboutView: UITextViewDelegate {

extension AboutView: BaseViewConfiguration {

internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(logoImage)
addSubview(versionLabel)
addSubview(aboutTextView)
}

internal func setupConstraints() {
func setupConstraints() {
logoImage.layout.applyConstraint { view in
view.topAnchor(equalTo: self.safeTopAnchor, constant: 34)
view.centerXAnchor(equalTo: self.centerXAnchor)
Expand All @@ -84,7 +84,7 @@ extension AboutView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
backgroundColor = .blackWhite

logoImage.image = Asset.Logo.largeIconBlack.image.withRenderingMode(.alwaysTemplate)
Expand Down
8 changes: 4 additions & 4 deletions SWDestinyTrades/Classes/AddCard/View/AddCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class AddCardCell: UITableViewCell, Identifiable {
fatalError("init(coder:) has not been implemented")
}

internal func configureCell(cardDTO: CardDTO) {
func configureCell(cardDTO: CardDTO) {
baseViewCell.titleLabel.text = cardDTO.name
setIconImage(card: cardDTO)
baseViewCell.subtitleLabel.text = "\(cardDTO.setName) -- \(cardDTO.rarityName)"
Expand All @@ -45,11 +45,11 @@ final class AddCardCell: UITableViewCell, Identifiable {
}

extension AddCardCell: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
contentView.addSubview(baseViewCell)
}

internal func setupConstraints() {
func setupConstraints() {
baseViewCell.layout.applyConstraint { view in
view.topAnchor(equalTo: self.contentView.topAnchor)
view.leadingAnchor(equalTo: self.contentView.leadingAnchor)
Expand All @@ -58,7 +58,7 @@ extension AddCardCell: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
accessoryType = .detailButton
selectionStyle = .none
tintColor = .whiteBlack
Expand Down
4 changes: 2 additions & 2 deletions SWDestinyTrades/Classes/AddCard/View/AddCardTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ final class AddCardTableView: UITableView, SearchDelegate {

// MARK: - <SearchDelegate>

internal func didSelectRow(at index: IndexPath) {
func didSelectRow(at index: IndexPath) {
if let card = tableDatasource?.getCard(at: index) {
didSelectCard?(card)
}
}

internal func didSelectAccessory(at index: IndexPath) {
func didSelectAccessory(at index: IndexPath) {
if let card = tableDatasource?.getCard(at: index) {
didSelectAccessory?(card)
}
Expand Down
6 changes: 3 additions & 3 deletions SWDestinyTrades/Classes/AddCard/View/AddCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ final class AddCardView: UIView, AddCardViewType {

extension AddCardView: BaseViewConfiguration {

internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(searchBar)
addSubview(addCardTableView)
addCardTableView.addSubview(activityIndicator)
}

internal func setupConstraints() {
func setupConstraints() {
searchBar.layout.applyConstraint { view in
view.topAnchor(equalTo: self.safeTopAnchor)
view.leadingAnchor(equalTo: self.leadingAnchor)
Expand All @@ -93,7 +93,7 @@ extension AddCardView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
backgroundColor = .blackWhite
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ final class AddToDeckTableView: UITableView, SearchDelegate {

// MARK: - <SearchDelegate>

internal func didSelectRow(at index: IndexPath) {
func didSelectRow(at index: IndexPath) {
if let card = tableDatasource?.getCard(at: index) {
didSelectCard?(card)
}
}

internal func didSelectAccessory(at index: IndexPath) {
func didSelectAccessory(at index: IndexPath) {
if let card = tableDatasource?.getCard(at: index) {
didSelectAccessory?(card)
}
}

// MARK: - <FilterHeaderViewDelegate>

internal func didSelectSegment(index: Int) {
func didSelectSegment(index: Int) {
switch index {
case 0:
tableDatasource?.updateSearchList([])
Expand Down
6 changes: 3 additions & 3 deletions SWDestinyTrades/Classes/AddToDeck/View/AddToDeckView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ final class AddToDeckView: UIView {
}

extension AddToDeckView: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(searchBar)
addSubview(addToDeckTableView)
addToDeckTableView.addSubview(activityIndicator)
}

internal func setupConstraints() {
func setupConstraints() {
searchBar.layout.applyConstraint { view in
view.topAnchor(equalTo: self.safeTopAnchor)
view.leadingAnchor(equalTo: self.leadingAnchor)
Expand All @@ -58,7 +58,7 @@ extension AddToDeckView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
backgroundColor = .blackWhite
}
}
2 changes: 1 addition & 1 deletion SWDestinyTrades/Classes/Analytics/LoggerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class LoggerManager: LoggerProtocol {

private init() {}

internal func setup() {
func setup() {
loggers.forEach { $0.setup() }
}

Expand Down
8 changes: 4 additions & 4 deletions SWDestinyTrades/Classes/Base/View/BaseViewCell.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// BaseCell.swift
// BaseViewCell.swift
// SWDestiny Trades
//
// Created by Diogo Autilio on 05/01/17.
Expand Down Expand Up @@ -58,7 +58,7 @@ final class BaseViewCell: UIView {
}

extension BaseViewCell: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(contentView)
contentView.addSubview(textContainer)
contentView.addSubview(iconImageView)
Expand All @@ -67,7 +67,7 @@ extension BaseViewCell: BaseViewConfiguration {
contentView.addSubview(accessoryLabel)
}

internal func setupConstraints() {
func setupConstraints() {
contentView.layout.applyConstraint { view in
view.inset(to: self, withInset: UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8))
}
Expand All @@ -92,5 +92,5 @@ extension BaseViewCell: BaseViewConfiguration {
}
}

internal func configureViews() {}
func configureViews() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ final class CollapsibleTableViewHeader: UITableViewHeaderFooterView, Identifiabl
}

extension CollapsibleTableViewHeader: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
contentView.addSubview(titleLabel)
contentView.addSubview(arrowLabel)
}

internal func setupConstraints() {
func setupConstraints() {
titleLabel.layout.applyConstraint { view in
view.centerYAnchor(equalTo: self.centerYAnchor)
view.leadingAnchor(equalTo: self.leadingAnchor, constant: 12)
Expand All @@ -76,7 +76,7 @@ extension CollapsibleTableViewHeader: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
contentView.backgroundColor = .sectionColor
}
}
6 changes: 3 additions & 3 deletions SWDestinyTrades/Classes/CardDetail/View/CardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ final class CardView: UIView {
}

extension CardView: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(slideshow)
}

internal func setupConstraints() {
func setupConstraints() {
slideshow.layout.applyConstraint { view in
view.topAnchor(equalTo: self.safeTopAnchor)
view.leadingAnchor(equalTo: self.leadingAnchor)
Expand All @@ -46,7 +46,7 @@ extension CardView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
backgroundColor = .blackWhite
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// CardListDatasource.swift
// AlphabeticalListDatasource.swift
// SWDestiny Trades
//
// Created by Diogo Autilio on 28/12/16.
Expand Down Expand Up @@ -47,11 +47,11 @@ final class AlphabeticalListDatasource: NSObject, UITableViewDataSource, CardRet

// MARK: <CardReturnable>

internal func getCard(at index: IndexPath) -> CardDTO? {
return (alphabeticallyCards[sections[index.section]]?[index.row])
func getCard(at index: IndexPath) -> CardDTO? {
return alphabeticallyCards[sections[index.section]]?[index.row]
}

internal func getCardList() -> [CardDTO] {
func getCardList() -> [CardDTO] {
var list = [CardDTO]()
for cardList in alphabeticallyCards.values {
list.append(contentsOf: Array(cardList))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ final class ColorListDatasource: NSObject, UITableViewDataSource, CardReturnable

// MARK: <CardReturnable>

internal func getCard(at index: IndexPath) -> CardDTO? {
return (colorCards[sections[index.section]]?[index.row])
func getCard(at index: IndexPath) -> CardDTO? {
return colorCards[sections[index.section]]?[index.row]
}

internal func getCardList() -> [CardDTO] {
func getCardList() -> [CardDTO] {
var list = [CardDTO]()
for cardList in colorCards.values {
list.append(contentsOf: Array(cardList))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ final class NumberListDatasource: NSObject, UITableViewDataSource, CardReturnabl

// MARK: <CardReturnable>

internal func getCard(at index: IndexPath) -> CardDTO? {
func getCard(at index: IndexPath) -> CardDTO? {
return numberCards[index.row]
}

internal func getCardList() -> [CardDTO] {
func getCardList() -> [CardDTO] {
return numberCards
}

Expand Down
8 changes: 4 additions & 4 deletions SWDestinyTrades/Classes/CardList/View/CardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class CardCell: UITableViewCell, Identifiable {
fatalError("init(coder:) has not been implemented")
}

internal func configureCell(card: CardDTO, useIndex: Bool) {
func configureCell(card: CardDTO, useIndex: Bool) {
baseViewCell.titleLabel.text = card.name
setSubtitle(card: card, useIndex: useIndex)
setIconImage(card: card)
Expand Down Expand Up @@ -59,11 +59,11 @@ final class CardCell: UITableViewCell, Identifiable {
}

extension CardCell: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
contentView.addSubview(baseViewCell)
}

internal func setupConstraints() {
func setupConstraints() {
baseViewCell.layout.applyConstraint { view in
view.topAnchor(equalTo: self.contentView.topAnchor)
view.leadingAnchor(equalTo: self.contentView.leadingAnchor)
Expand All @@ -72,7 +72,7 @@ extension CardCell: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
accessoryType = .disclosureIndicator
}
}
4 changes: 2 additions & 2 deletions SWDestinyTrades/Classes/CardList/View/CardListTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class CardListTableView: UITableView {

// MARK: <CardListViewDelegate>

internal func didSelectRowAt(index: IndexPath) {
func didSelectRowAt(index: IndexPath) {
if let currentDatasource: CardReturnable = dataSource as? CardReturnable {
if let card = currentDatasource.getCard(at: index) {
didSelectCard?(currentDatasource.getCardList(), card)
Expand All @@ -56,7 +56,7 @@ final class CardListTableView: UITableView {

// MARK: <FilterHeaderViewDelegate>

internal func didSelectSegment(index: Int) {
func didSelectSegment(index: Int) {
switch index {
case 0:
dataSource = alphabeticalDatasource
Expand Down
6 changes: 3 additions & 3 deletions SWDestinyTrades/Classes/CardList/View/CardListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ final class CardListView: UIView {
}

extension CardListView: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(cardListTableView)
cardListTableView.addSubview(activityIndicator)
}

internal func setupConstraints() {
func setupConstraints() {
cardListTableView.layout.applyConstraint { view in
view.topAnchor(equalTo: self.safeTopAnchor)
view.leadingAnchor(equalTo: self.leadingAnchor)
Expand All @@ -48,7 +48,7 @@ extension CardListView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
backgroundColor = .blackWhite
}
}
8 changes: 4 additions & 4 deletions SWDestinyTrades/Classes/CardList/View/FilterHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class FilterHeaderView: UITableViewHeaderFooterView, Identifiable {
fatalError("init(coder:) has not been implemented")
}

internal func configureHeader() {
func configureHeader() {
segmentControl.insertSegment(withTitle: L10n.aToZ, at: 0, animated: false)
segmentControl.insertSegment(withTitle: L10n.color, at: 1, animated: false)
// segmentControl.insertSegment(withTitle: "Price", at: 2, animated: false)
Expand All @@ -53,11 +53,11 @@ final class FilterHeaderView: UITableViewHeaderFooterView, Identifiable {
}

extension FilterHeaderView: BaseViewConfiguration {
internal func buildViewHierarchy() {
func buildViewHierarchy() {
addSubview(segmentControl)
}

internal func setupConstraints() {
func setupConstraints() {
segmentControl.layout.applyConstraint { view in
view.topAnchor(equalTo: self.topAnchor, constant: 8)
view.leadingAnchor(equalTo: self.leadingAnchor, constant: 18)
Expand All @@ -66,7 +66,7 @@ extension FilterHeaderView: BaseViewConfiguration {
}
}

internal func configureViews() {
func configureViews() {
contentView.backgroundColor = .blackWhite
segmentControl.tintColor = ColorPalette.appTheme
}
Expand Down
Loading

0 comments on commit a31c2f1

Please sign in to comment.