Skip to content

Commit

Permalink
Merge pull request #7 from chausovSurfStudio/dev
Browse files Browse the repository at this point in the history
Версия 1.2.1
  • Loading branch information
Alexander Chausov authored May 28, 2021
2 parents 03e3eca + 9fb3ea5 commit 3fd7a83
Show file tree
Hide file tree
Showing 115 changed files with 782 additions and 147 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.1

- Отдельный экран для отображения всех компонентов из одной главы [#6](https://github.com/chausovSurfStudio/SurfPlaybook/pull/6)

## 1.2.0

- Появилась возможность в третьем табе с flow-координаторами реализовать вложенную структуру экранов [#4](https://github.com/chausovSurfStudio/SurfPlaybook/pull/4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol AuthModuleInput: class {
protocol AuthModuleInput: AnyObject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol AuthModuleOutput: class {
protocol AuthModuleOutput: AnyObject {
var onClose: EmptyClosure? { get set }
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol AuthViewInput: class {
protocol AuthViewInput: AnyObject {
/// Method for setup initial state of view
func setupInitialState()
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol ListModuleInput: class {
protocol ListModuleInput: AnyObject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol ListModuleOutput: class {
protocol ListModuleOutput: AnyObject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol ListViewInput: class {
protocol ListViewInput: AnyObject {
func setupInitialState(with data: [ListAdapter.ListData])
}
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ coordinator:
bundle exec generamba gen $(modName) surf_mvp_coordinator

screen:
bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'Example/SurfPlaybookExample/Flows/$(flowName)'
# bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'SurfPlaybook/Playbook/Flows/$(flowName)'
# bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'Example/SurfPlaybookExample/Flows/$(flowName)'
bundle exec generamba gen $(modName) surf_mvp_coordinatable_module --module_path 'SurfPlaybook/Playbook/Flows/$(flowName)'

alert:
bundle exec generamba gen $(modName) surf_mvp_coordinatable_alert --module_path 'Example/SurfPlaybookExample/Flows/$(flowName)'
# bundle exec generamba gen $(modName) surf_mvp_coordinatable_alert --module_path 'SurfPlaybook/Playbook/Flows/$(flowName)'
# bundle exec generamba gen $(modName) surf_mvp_coordinatable_alert --module_path 'Example/SurfPlaybookExample/Flows/$(flowName)'
bundle exec generamba gen $(modName) surf_mvp_coordinatable_alert --module_path 'SurfPlaybook/Playbook/Flows/$(flowName)'

doc:
bundle exec jazzy --clean --build-tool-arguments -scheme,SurfPlaybook,-workspace,SurfPlaybook.xcworkspace,-sdk,iphonesimulator --output "docs"
Expand Down
6 changes: 3 additions & 3 deletions Rambafile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ xcodeproj_path: SurfPlaybook.xcodeproj

### Code generation settings section
# The main project target name
project_targets: [SurfPlaybookExample]
project_targets: [SurfPlaybook]

# The file path for new modules
project_file_path: Example/SurfPlaybookExample/Flows
project_file_path: SurfPlaybook/Playbook/Flows

# The Xcode group path to new modules
project_group_path: Example/SurfPlaybookExample/Flows
project_group_path: SurfPlaybook/Playbook/Flows

### Tests generation settings section
# The tests target name
Expand Down
2 changes: 1 addition & 1 deletion SurfPlaybook.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "SurfPlaybook"
spec.version = "1.2.0"
spec.version = "1.2.1"
spec.summary = "iOS framework for Playbook"
spec.homepage = "https://github.com/chausovSurfStudio/SurfPlaybook"
spec.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
80 changes: 78 additions & 2 deletions SurfPlaybook.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SurfPlaybook/Library/Protocols/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

/// Базовый протокол для всех координаторов приложения
protocol Coordinator: class {
protocol Coordinator: AnyObject {
/// Уведомляет координатора, что он должен начать свою работу
func start()
/// Уведомляет координатора, что он может начать свою работу,
Expand Down
2 changes: 1 addition & 1 deletion SurfPlaybook/Library/Reusable/SearchBar/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private extension SearchBar {
clearButton.alpha = 0

cancelButton.apply(style: .textActive)
cancelButton.setTitle(L10n.Common.Titles.cancel, for: .normal)
cancelButton.setTitle(StringsConfig.cancel, for: .normal)
cancelButton.contentEdgeInsets = .zero
cancelButton.alpha = 0
}
Expand Down
2 changes: 2 additions & 0 deletions SurfPlaybook/Playbook/Core/Customization/StringsConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public enum StringsConfig {

public static var searchBarPlaceholder = L10n.Main.SearchBar.placeholder
public static var emptySearchMessage = L10n.Main.EmptySearch.message
public static var emptyStateMessage = L10n.Main.EmptyState.message
public static var showAllTitle = L10n.Main.ShowAll.title

public static var coloredBackgroundName = L10n.Settings.ColoredBackground.name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/// Протокл для модулей, которые будут связаны с модулем OptionSelector
/// и которым придется обрабатывать ответы от него
protocol OptionSelectorHandler: class {
protocol OptionSelectorHandler: AnyObject {
/// Пользователь выбрал какой-то вариант из предложенных, необходимо обработать это событие.
/// Ошибку в случае неудачного запроса рекомендуется показывать с помощью методов input объекта
func selectOption(_ option: StringRepresentable, input: OptionSelectorModuleInput)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol OptionSelectorModuleInput: class {
protocol OptionSelectorModuleInput: AnyObject {
func closeSelector()
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol OptionSelectorModuleOutput: class {
protocol OptionSelectorModuleOutput: AnyObject {
var onClose: EmptyClosure? { get set }
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol OptionSelectorViewInput: class {
protocol OptionSelectorViewInput: AnyObject {
func setupInitialState(with config: OptionSelectorConfig)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol FlowsModuleInput: class {
protocol FlowsModuleInput: AnyObject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol FlowsModuleOutput: class {
protocol FlowsModuleOutput: AnyObject {
var onFlowsShow: Closure<(title: String, coordinators: [PlaybookFlowCoordinator])>? { get set }
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension FlowsViewController: FlowsViewInput {
func setupInitialState(title: String?, flowCoordinators: [PlaybookFlowCoordinator]) {
configureAppearance(title: title)
if flowCoordinators.isEmpty {
setup(state: .empty(text: L10n.Main.EmptyState.message))
setup(state: .empty(text: StringsConfig.emptyStateMessage))
} else {
setup(state: .normal)
adapter?.fill(with: flowCoordinators)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol FlowsViewInput: class, ViewStateConfigurable {
protocol FlowsViewInput: AnyObject, ViewStateConfigurable {
func setupInitialState(title: String?, flowCoordinators: [PlaybookFlowCoordinator])
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// Copyright © 2021 Surf. All rights reserved.
//

protocol FlowsCoordinatorOutput: class {
protocol FlowsCoordinatorOutput: AnyObject {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// ChapterModuleConfigurator.swift
// SurfPlaybook
//
// Created by Александр Чаусов on 20/05/2021.
// Copyright © 2021 Surf. All rights reserved.
//

import UIKit

final class ChapterModuleConfigurator {

func configure(chapter: ChapterModel) -> (UIViewController, ChapterModuleOutput) {
let view = UIViewController.instantiate(ofType: ChapterViewController.self)
let presenter = ChapterPresenter(chapter: chapter)

presenter.view = view
view.output = presenter

return (view, presenter)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// ChapterModuleInput.swift
// SurfPlaybook
//
// Created by Александр Чаусов on 20/05/2021.
// Copyright © 2021 Surf. All rights reserved.
//

protocol ChapterModuleInput: AnyObject {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// ChapterModuleOutput.swift
// SurfPlaybook
//
// Created by Александр Чаусов on 20/05/2021.
// Copyright © 2021 Surf. All rights reserved.
//

protocol ChapterModuleOutput: AnyObject {
var onPageShow: Closure<PlaybookPage>? { get set }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// ChapterPresenter.swift
// SurfPlaybook
//
// Created by Александр Чаусов on 20/05/2021.
// Copyright © 2021 Surf. All rights reserved.
//

final class ChapterPresenter: ChapterModuleOutput {

// MARK: - ChapterModuleOutput

var onPageShow: Closure<PlaybookPage>?

// MARK: - Properties

weak var view: ChapterViewInput?

// MARK: - Private Properties

private let chapter: ChapterModel

// MARK: - Initialization

init(chapter: ChapterModel) {
self.chapter = chapter
}

}

// MARK: - ChapterModuleInput

extension ChapterPresenter: ChapterModuleInput {
}

// MARK: - ChapterViewOutput

extension ChapterPresenter: ChapterViewOutput {

func viewLoaded() {
view?.setupInitialState(with: chapter)
}

func showPage(_ model: PageModel) {
onPageShow?(model.playbookPage)
}

}
Loading

0 comments on commit 3fd7a83

Please sign in to comment.