From 5af3309214717eedacc6744fdabe51a3924ec632 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Fri, 31 Jan 2025 10:17:02 +0400 Subject: [PATCH 1/9] clear background of hosting controller --- SurfPlaybook/Playbook/Core/Containers/SUIViewContainer.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SurfPlaybook/Playbook/Core/Containers/SUIViewContainer.swift b/SurfPlaybook/Playbook/Core/Containers/SUIViewContainer.swift index eb6aff7..646c359 100644 --- a/SurfPlaybook/Playbook/Core/Containers/SUIViewContainer.swift +++ b/SurfPlaybook/Playbook/Core/Containers/SUIViewContainer.swift @@ -61,6 +61,8 @@ extension SUIViewContainer: PlaybookContainer { return self } + contentView.backgroundColor = .clear + translatesAutoresizingMaskIntoConstraints = false contentView.translatesAutoresizingMaskIntoConstraints = false From 91f32a08fc7a82afbaaf159fcd13a67127fe669c Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 3 Feb 2025 12:25:56 +0400 Subject: [PATCH 2/9] prefer presets --- SurfPlaybook/Playbook/Core/PlaybookPage.swift | 8 ++++++++ .../Flows/Main/Page/View/PageViewController.swift | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SurfPlaybook/Playbook/Core/PlaybookPage.swift b/SurfPlaybook/Playbook/Core/PlaybookPage.swift index 10a7afc..9e0259b 100644 --- a/SurfPlaybook/Playbook/Core/PlaybookPage.swift +++ b/SurfPlaybook/Playbook/Core/PlaybookPage.swift @@ -40,6 +40,14 @@ public struct PlaybookPage { return config(nil).makeSnapshot() } + /// Предпочтительная конфигурация. + /// При наличии вариантов конфигурации предпочтение отдаётся первой конфигурации. + /// Это сделано для того, чтобы в частном случае можно было в `config` записать + /// эксклюзивную конфигурацию для snapshot, с дополнительным фоном или отключенными анимациями. + var preferredConfig: PlaybookContainerProvider { + presets.first?.config ?? config + } + // MARK: - Public Properties /// Массив, содержащий различные варианты конфигурации UI-компонента. diff --git a/SurfPlaybook/Playbook/Flows/Main/Page/View/PageViewController.swift b/SurfPlaybook/Playbook/Flows/Main/Page/View/PageViewController.swift index ecff21b..20ac563 100644 --- a/SurfPlaybook/Playbook/Flows/Main/Page/View/PageViewController.swift +++ b/SurfPlaybook/Playbook/Flows/Main/Page/View/PageViewController.swift @@ -59,7 +59,7 @@ private extension PageViewController { func configureAppearance(with page: PlaybookPage) { configureNavigationBar(with: page) - configureContent(contentView: page.config(self).loadView()) + configureContent(contentView: page.preferredConfig(self).loadView()) configureGesture() } From 5be863d59437709b7ec420c7fd6b88ef3dc45fc3 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 09:53:47 +0400 Subject: [PATCH 3/9] fix cocoapods version --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index b0cd61a..4dd8a68 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ git_source(:github) do |repo_name| end if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('2') gem "fastlane", "2.226.0" -gem 'cocoapods' +gem 'cocoapods', "1.16.2" gem 'xcpretty', "0.4.0" gem 'generamba', github: 'surfstudio/Generamba', tag: '1.7.1' From ec44db78df8b34ae6ea30b1af72adde8a8c713d8 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 09:53:56 +0400 Subject: [PATCH 4/9] fix version of ruby --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..9c25013 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.6 From b8d3f5230a68068e0e5a73446fb608682f6b7c88 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 09:54:05 +0400 Subject: [PATCH 5/9] rename workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e12778c..2abdba3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: CocoaPods + - name: Init run: | gem install xcpretty -N make init From 012161fea727260c241812353c1f76e769560888 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 10:09:56 +0400 Subject: [PATCH 6/9] move generamba templates in right place --- Makefile | 1 - Rambafile | 6 +- .../module_configurator.swift.liquid | 30 ---------- .../module_test_configurator.swift.liquid | 20 ------- .../Code/Presenter/module_input.swift.liquid | 10 ---- .../Code/Presenter/module_output.swift.liquid | 10 ---- .../Code/Presenter/presenter.swift.liquid | 27 --------- .../Code/View/view_controller.swift.liquid | 22 ------- .../Code/View/view_input.swift.liquid | 10 ---- .../Code/View/view_output.swift.liquid | 10 ---- .../module_deallocation_tests.swift.liquid | 22 ------- .../surf_mvp_coordinatable_alert.rambaspec | 30 ---------- .../module_configurator.swift.liquid | 23 -------- .../Code/Presenter/module_input.swift.liquid | 10 ---- .../Code/Presenter/module_output.swift.liquid | 10 ---- .../Code/Presenter/presenter.swift.liquid | 32 ---------- .../View/view_controller.storyboard.liquid | 28 --------- .../Code/View/view_controller.swift.liquid | 33 ----------- .../Code/View/view_controller.xib.liquid | 23 -------- .../Code/View/view_input.swift.liquid | 12 ---- .../Code/View/view_output.swift.liquid | 12 ---- .../module_configurator_tests.swift.liquid | 23 -------- .../Presenter/presenter_tests.swift.liquid | 59 ------------------- .../Tests/View/view_tests.swift.liquid | 53 ----------------- .../surf_mvp_coordinatable_module.rambaspec | 36 ----------- .../Code/coordinator.swift.liquid | 38 ------------ .../Code/coordinator_output.swift.liquid | 10 ---- .../surf_mvp_coordinator.rambaspec | 12 ---- 28 files changed, 3 insertions(+), 609 deletions(-) delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_configurator.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_test_configurator.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_input.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_output.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/presenter.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_controller.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_input.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_output.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/Tests/Configurator/module_deallocation_tests.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_alert/surf_mvp_coordinatable_alert.rambaspec delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/Configurator/module_configurator.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_input.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_output.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/presenter.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.storyboard.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.xib.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/View/view_input.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Code/View/view_output.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Tests/Configurator/module_configurator_tests.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Tests/Presenter/presenter_tests.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/Tests/View/view_tests.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinatable_module/surf_mvp_coordinatable_module.rambaspec delete mode 100644 generamba/templates/surf_mvp_coordinator/Code/coordinator.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinator/Code/coordinator_output.swift.liquid delete mode 100644 generamba/templates/surf_mvp_coordinator/surf_mvp_coordinator.rambaspec diff --git a/Makefile b/Makefile index 72238b1..d31ec8b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ init: -bundle install -bundle exec pod repo update -bundle exec pod install - -bundle exec generamba template install build: bundle exec fastlane build clean:true diff --git a/Rambafile b/Rambafile index ed6abfd..e00d92f 100644 --- a/Rambafile +++ b/Rambafile @@ -27,6 +27,6 @@ podfile_path: Podfile ### Templates templates: -- {name: surf_mvp_coordinatable_module, local: 'generamba/templates/surf_mvp_coordinatable_module'} -- {name: surf_mvp_coordinatable_alert, local: 'generamba/templates/surf_mvp_coordinatable_alert'} -- {name: surf_mvp_coordinator, local: 'generamba/templates/surf_mvp_coordinator'} \ No newline at end of file +- {name: surf_mvp_coordinatable_module} +- {name: surf_mvp_coordinatable_alert} +- {name: surf_mvp_coordinator} \ No newline at end of file diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_configurator.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_configurator.swift.liquid deleted file mode 100644 index 840d8c4..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_configurator.swift.liquid +++ /dev/null @@ -1,30 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import UIKit - -typealias {{ module_info.name }}ModuleComponents = ( - view: {{ module_info.name }}Controller, - output: {{ module_info.name }}ModuleOutput -) - -final class {{ module_info.name }}ModuleConfigurator { - - func configure() -> {{ module_info.name }}ModuleComponents { - - // TODO: Change title and message - let view = {{ module_info.name }}Controller(title: nil, message: nil, preferredStyle: .alert) - let presenter = {{ module_info.name }}Presenter() - - presenter.view = view - view.output = presenter - - return (view, presenter) - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_test_configurator.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_test_configurator.swift.liquid deleted file mode 100644 index 644c8b1..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/Configurator/module_test_configurator.swift.liquid +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import UIKit - -public final class {{ module_info.name }}ModuleTestConfigurator { - - // MARK: - Initializer - - public init() {} - - // MARK: - Public methods - - public func configure() -> (UIViewController, [AnyObject]) { - let (view, output) = {{ module_info.name }}ModuleConfigurator().configure() - return (view, [output]) - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_input.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_input.swift.liquid deleted file mode 100644 index 6e75e03..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_input.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ModuleInput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_output.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_output.swift.liquid deleted file mode 100644 index 606faa6..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/module_output.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ModuleOutput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/presenter.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/presenter.swift.liquid deleted file mode 100644 index 235303c..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/Presenter/presenter.swift.liquid +++ /dev/null @@ -1,27 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -final class {{ module_info.name }}Presenter: {{ module_info.name }}ModuleOutput { - - // MARK: - {{ module_info.name }}ModuleOutput - - // MARK: - Properties - - weak var view: {{ module_info.name }}ViewInput? - -} - -// MARK: - {{ module_info.name }}ModuleInput - -extension {{ module_info.name }}Presenter: {{ module_info.name }}ModuleInput { -} - -// MARK: - {{ module_info.name }}ViewOutput - -extension {{ module_info.name }}Presenter: {{ module_info.name }}ViewOutput { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_controller.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_controller.swift.liquid deleted file mode 100644 index f9493f4..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_controller.swift.liquid +++ /dev/null @@ -1,22 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import UIKit - -final class {{ module_info.name }}Controller: UIAlertController { - - // MARK: - Properties - - var output: {{ module_info.name }}ViewOutput? - -} - -// MARK: - {{ module_info.name }}ViewInput - -extension {{ module_info.name }}Controller: {{ module_info.name }}ViewInput { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_input.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_input.swift.liquid deleted file mode 100644 index 64fbff5..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_input.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ViewInput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_output.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_output.swift.liquid deleted file mode 100644 index ffbf0ab..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Code/View/view_output.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ViewOutput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/Tests/Configurator/module_deallocation_tests.swift.liquid b/generamba/templates/surf_mvp_coordinatable_alert/Tests/Configurator/module_deallocation_tests.swift.liquid deleted file mode 100644 index 45cbeb6..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/Tests/Configurator/module_deallocation_tests.swift.liquid +++ /dev/null @@ -1,22 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import XCTest -@testable import {{ module_info.product_module_name }} - -final class {{ module_info.name }}ModuleDeallocationTests: XCTestCase { - - // MARK: - Main tests - - func testDeallocation() { - assertDeallocation(of: { - return {{ module_info.name }}ModuleTestConfigurator().configure() - }) - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_alert/surf_mvp_coordinatable_alert.rambaspec b/generamba/templates/surf_mvp_coordinatable_alert/surf_mvp_coordinatable_alert.rambaspec deleted file mode 100644 index fd2ca77..0000000 --- a/generamba/templates/surf_mvp_coordinatable_alert/surf_mvp_coordinatable_alert.rambaspec +++ /dev/null @@ -1,30 +0,0 @@ -# Template information section -name: "surf_mvp_coordinatable_alert" -summary: "Template for creating MVP alert modules with coordinator." -author: "Serge Nanaev" -version: "1.0.0" -license: "MIT" - -# The declarations for code files - -code_files: -# Configurator -- {name: Configurator/ModuleConfigurator.swift, path: Code/Configurator/module_configurator.swift.liquid} -- {name: Configurator/ModuleTestConfigurator.swift, path: Code/Configurator/module_test_configurator.swift.liquid} - -# Presenter layer -- {name: Presenter/Presenter.swift, path: Code/Presenter/presenter.swift.liquid} -- {name: Presenter/ModuleInput.swift, path: Code/Presenter/module_input.swift.liquid} -- {name: Presenter/ModuleOutput.swift, path: Code/Presenter/module_output.swift.liquid} - -# View layer -- {name: View/Controller.swift, path: Code/View/view_controller.swift.liquid} -- {name: View/ViewInput.swift, path: Code/View/view_input.swift.liquid} -- {name: View/ViewOutput.swift, path: Code/View/view_output.swift.liquid} - -# The declarations for test files - -test_files: - -# Configurators tests -- {name: Configurator/ModuleDeallocationTests.swift, path: Tests/Configurator/module_deallocation_tests.swift.liquid} \ No newline at end of file diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/Configurator/module_configurator.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/Configurator/module_configurator.swift.liquid deleted file mode 100644 index 6a3dea8..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/Configurator/module_configurator.swift.liquid +++ /dev/null @@ -1,23 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import UIKit - -final class {{ module_info.name }}ModuleConfigurator { - - func configure() -> (UIViewController, {{ module_info.name }}ModuleOutput) { - let view = {{ module_info.name }}ViewController() - let presenter = {{ module_info.name }}Presenter() - - presenter.view = view - view.output = presenter - - return (view, presenter) - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_input.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_input.swift.liquid deleted file mode 100644 index 6e75e03..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_input.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ModuleInput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_output.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_output.swift.liquid deleted file mode 100644 index 606faa6..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/module_output.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ModuleOutput: class { -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/presenter.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/presenter.swift.liquid deleted file mode 100644 index fd3e9df..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/Presenter/presenter.swift.liquid +++ /dev/null @@ -1,32 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -final class {{ module_info.name }}Presenter: {{ module_info.name }}ModuleOutput { - - // MARK: - {{ module_info.name }}ModuleOutput - - // MARK: - Properties - - weak var view: {{ module_info.name }}ViewInput? - -} - -// MARK: - {{ module_info.name }}ModuleInput - -extension {{ module_info.name }}Presenter: {{ module_info.name }}ModuleInput { -} - -// MARK: - {{ module_info.name }}ViewOutput - -extension {{ module_info.name }}Presenter: {{ module_info.name }}ViewOutput { - - func viewLoaded() { - view?.setupInitialState() - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.storyboard.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.storyboard.liquid deleted file mode 100644 index f5cd460..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.storyboard.liquid +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.swift.liquid deleted file mode 100644 index 25ece4e..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.swift.liquid +++ /dev/null @@ -1,33 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import UIKit - -final class {{ module_info.name }}ViewController: UIViewController { - - // MARK: - Properties - - var output: {{ module_info.name }}ViewOutput? - - // MARK: - UIViewController - - override func viewDidLoad() { - super.viewDidLoad() - output?.viewLoaded() - } - -} - -// MARK: - {{ module_info.name }}ViewInput - -extension {{ module_info.name }}ViewController: {{ module_info.name }}ViewInput { - - func setupInitialState() { - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.xib.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.xib.liquid deleted file mode 100644 index cbe889b..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_controller.xib.liquid +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_input.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_input.swift.liquid deleted file mode 100644 index 5209c0d..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_input.swift.liquid +++ /dev/null @@ -1,12 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ViewInput: class { - /// Method for setup initial state of view - func setupInitialState() -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_output.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_output.swift.liquid deleted file mode 100644 index 01c9fc7..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Code/View/view_output.swift.liquid +++ /dev/null @@ -1,12 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}ViewOutput { - /// Notify presenter that view is ready - func viewLoaded() -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Tests/Configurator/module_configurator_tests.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Tests/Configurator/module_configurator_tests.swift.liquid deleted file mode 100644 index 417ff0b..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Tests/Configurator/module_configurator_tests.swift.liquid +++ /dev/null @@ -1,23 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import XCTest -@testable import {{ module_info.product_module_name }} - -final class {{ module_info.name }}ModuleConfiguratorTests: XCTestCase { - - // MARK: - Main tests - - func testDeallocation() { - assertDeallocation(of: { - let (view, output) = {{ module_info.name }}ModuleConfigurator().configure() - return (view, [output]) - }) - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Tests/Presenter/presenter_tests.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Tests/Presenter/presenter_tests.swift.liquid deleted file mode 100644 index 88161b6..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Tests/Presenter/presenter_tests.swift.liquid +++ /dev/null @@ -1,59 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import XCTest -@testable import {{ module_info.product_module_name }} - -final class {{ module_info.name }}PresenterTest: XCTestCase { - - // MARK: - Properties - - private var presenter: {{ module_info.name }}Presenter? - private var view: MockViewController? - private var output: MockModuleOutput? - - // MARK: - XCTestCase - - override func setUp() { - super.setUp() - presenter = {{ module_info.name }}Presenter() - output = MockModuleOutput() - view = MockViewController() - presenter?.view = view - } - - override func tearDown() { - super.tearDown() - presenter = nil - view = nil - } - - // MARK: - Main tests - - func testThatPresenterHandlesViewLoadedEvent() { - // when - presenter?.viewLoaded() - // then - XCTAssertTrue((presenter?.view as? MockViewController)?.setupInitialStateWasCalled == true) - } - - // MARK: - Mocks - - private final class MockViewController: {{ module_info.name }}ViewInput { - var setupInitialStateWasCalled: Bool = false - - func setupInitialState() { - setupInitialStateWasCalled = true - } - } - - private final class MockModuleOutput { - - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/Tests/View/view_tests.swift.liquid b/generamba/templates/surf_mvp_coordinatable_module/Tests/View/view_tests.swift.liquid deleted file mode 100644 index aa6a608..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/Tests/View/view_tests.swift.liquid +++ /dev/null @@ -1,53 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -import XCTest -@testable import {{ module_info.product_module_name }} - -final class {{ module_info.name }}ViewTests: XCTestCase { - - // MARK: - Properties - - private var view: {{ module_info.name }}ViewController? - private var output: {{ module_info.name }}ViewOutputMock? - - // MARK: - XCTestCase - - override func setUp() { - super.setUp() - view = {{ module_info.name }}ViewController() - output = {{ module_info.name }}ViewOutputMock() - view?.output = output - } - - override func tearDown() { - super.tearDown() - view = nil - output = nil - } - - // MARK: - Main tests - - func testThatViewNotifiesPresenterOnDidLoad() { - // when - self.view?.viewDidLoad() - // then - XCTAssert(self.output?.viewLoadedWasCalled == true) - } - - // MARK: - Mocks - - final class {{ module_info.name }}ViewOutputMock: {{ module_info.name }}ViewOutput { - var viewLoadedWasCalled: Bool = false - - func viewLoaded() { - viewLoadedWasCalled = true - } - } - -} diff --git a/generamba/templates/surf_mvp_coordinatable_module/surf_mvp_coordinatable_module.rambaspec b/generamba/templates/surf_mvp_coordinatable_module/surf_mvp_coordinatable_module.rambaspec deleted file mode 100644 index 752a888..0000000 --- a/generamba/templates/surf_mvp_coordinatable_module/surf_mvp_coordinatable_module.rambaspec +++ /dev/null @@ -1,36 +0,0 @@ -# Template information section -name: "surf_mvp_module" -summary: "Template for creating MVP modules with coordinator." -author: "Serge Nanaev" -version: "1.0.0" -license: "MIT" - -# The declarations for code files - -code_files: -# Configurator -- {name: Configurator/ModuleConfigurator.swift, path: Code/Configurator/module_configurator.swift.liquid} - -# Presenter layer -- {name: Presenter/Presenter.swift, path: Code/Presenter/presenter.swift.liquid} -- {name: Presenter/ModuleInput.swift, path: Code/Presenter/module_input.swift.liquid} -- {name: Presenter/ModuleOutput.swift, path: Code/Presenter/module_output.swift.liquid} - -# View layer -- {name: View/ViewController.swift, path: Code/View/view_controller.swift.liquid} -- {name: View/ViewController.xib, path: Code/View/view_controller.xib.liquid} -- {name: View/ViewInput.swift, path: Code/View/view_input.swift.liquid} -- {name: View/ViewOutput.swift, path: Code/View/view_output.swift.liquid} - -# The declarations for test files - -test_files: - -# Configurators tests -- {name: Configurator/ModuleConfiguratorTests.swift, path: Tests/Configurator/module_configurator_tests.swift.liquid} - -# Presenter tests -#- {name: Presenter/PresenterTests.swift, path: Tests/Presenter/presenter_tests.swift.liquid} - -# View tests -#- {name: View/ViewTests.swift, path: Tests/View/view_tests.swift.liquid} diff --git a/generamba/templates/surf_mvp_coordinator/Code/coordinator.swift.liquid b/generamba/templates/surf_mvp_coordinator/Code/coordinator.swift.liquid deleted file mode 100644 index ffbc75b..0000000 --- a/generamba/templates/surf_mvp_coordinator/Code/coordinator.swift.liquid +++ /dev/null @@ -1,38 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -final class {{ module_info.name }}Coordinator: BaseCoordinator, {{ module_info.name }}CoordinatorOutput { - - // MARK: - {{ module_info.name }}CoordinatorOutput - - // MARK: - Private Properties - - private let router: Router - - // MARK: - Initialization - - init(router: Router) { - self.router = router - } - - // MARK: - Coordinator - - override func start(with deepLinkOption: DeepLinkOption?) { - showModule() - } - -} - -// MARK: - Private Methods - -private extension {{ module_info.name }}Coordinator { - - func showModule() { - } - -} diff --git a/generamba/templates/surf_mvp_coordinator/Code/coordinator_output.swift.liquid b/generamba/templates/surf_mvp_coordinator/Code/coordinator_output.swift.liquid deleted file mode 100644 index a203f39..0000000 --- a/generamba/templates/surf_mvp_coordinator/Code/coordinator_output.swift.liquid +++ /dev/null @@ -1,10 +0,0 @@ -// -// {{ module_info.file_name }} -// {{ module_info.project_name }} -// -// Created by {{ developer.name }} on {{ date }}. -// Copyright © {{ year }} {{ developer.company }}. All rights reserved. -// - -protocol {{ module_info.name }}CoordinatorOutput: class { -} diff --git a/generamba/templates/surf_mvp_coordinator/surf_mvp_coordinator.rambaspec b/generamba/templates/surf_mvp_coordinator/surf_mvp_coordinator.rambaspec deleted file mode 100644 index 2f86a33..0000000 --- a/generamba/templates/surf_mvp_coordinator/surf_mvp_coordinator.rambaspec +++ /dev/null @@ -1,12 +0,0 @@ -# Template information section -name: "surf_mvp_coordinator" -summary: "Template for creating coordinator." -author: "Alexander Chausov" -version: "1.0.0" -license: "MIT" - -# The declarations for code files - -code_files: -- {name: Coordinator.swift, path: Code/coordinator.swift.liquid} -- {name: CoordinatorOutput.swift, path: Code/coordinator_output.swift.liquid} \ No newline at end of file From 9a3621f57d5f6bdfea8010f8eb87066692165f9e Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 10:18:53 +0400 Subject: [PATCH 7/9] extend documentation --- SurfPlaybook/Playbook/Core/PlaybookPage.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/SurfPlaybook/Playbook/Core/PlaybookPage.swift b/SurfPlaybook/Playbook/Core/PlaybookPage.swift index 9e0259b..1bcdab2 100644 --- a/SurfPlaybook/Playbook/Core/PlaybookPage.swift +++ b/SurfPlaybook/Playbook/Core/PlaybookPage.swift @@ -53,10 +53,10 @@ public struct PlaybookPage { /// Массив, содержащий различные варианты конфигурации UI-компонента. /// /// Представляет собой массив элементов, где каждый состоит из двух компонентов - /// - preset - абстрактный объект, выполняющий протокол `StringRepresentable`, + /// - **preset** - абстрактный объект, выполняющий протокол `StringRepresentable`, /// где протокол содержит лишь одно поле `title`. Так что, фактически, /// это просто `название состояния` - /// - config - замыкание, при вызове которого строится нужное состояние UI-компонента + /// - **config** - замыкание, при вызове которого строится нужное состояние UI-компонента /// и возвращается UIView, его содержащее public var presets: [(preset: StringRepresentable, config: PlaybookContainerProvider)] = [] @@ -65,11 +65,15 @@ public struct PlaybookPage { /// Конструктор для создание страницы плейбука /// /// - Parameters: - /// - name: название UI-компонента, будет отображено в приложении - /// - description: опциональное описание компонента + /// - name: название UI-компонента, будет отображено в приложении + /// - description: опциональное описание компонента /// (пока что не используется и нигде не отображается) - /// - config: замыкание, при вызове которого должно строится нужное состояние UI-компонента + /// - config: замыкание, при вызове которого должно строится нужное состояние UI-компонента /// и возвращаться UIView, его содержащее + /// - Warning: Снимок для превью компонента делается с `config`, а не с `presets`. + /// В случае, если UI-компонент **анимирован** и анимации **искажают** его preview или оставляют его **пустым**, + /// можно передать в `config` уникальную конфигурацию с отключенной анимацией, + /// а конфигурацию для показа установить в `presets`. public init(name: String, description: String?, config: @escaping PlaybookContainerProvider) { From 74d489571ce4a569274f29c57066b9d2cf28d9c9 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 10:29:39 +0400 Subject: [PATCH 8/9] update version of github actions used to deploy documentation --- .github/workflows/deploy_docc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docc.yml b/.github/workflows/deploy_docc.yml index ab0e32f..c368002 100644 --- a/.github/workflows/deploy_docc.yml +++ b/.github/workflows/deploy_docc.yml @@ -43,10 +43,10 @@ jobs: --output-path docs; - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 with: path: 'docs' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file + uses: actions/deploy-pages@v3 \ No newline at end of file From 5f3a5ded06af7f2d039a8bd6f2420389fb397109 Mon Sep 17 00:00:00 2001 From: Nikita Korobeinikov Date: Mon, 10 Feb 2025 10:42:07 +0400 Subject: [PATCH 9/9] disable new tabController transition animation --- .../TabBar/TabBar/View/TabBarViewController.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SurfPlaybook/Playbook/Flows/TabBar/TabBar/View/TabBarViewController.swift b/SurfPlaybook/Playbook/Flows/TabBar/TabBar/View/TabBarViewController.swift index 844491a..2e72019 100644 --- a/SurfPlaybook/Playbook/Flows/TabBar/TabBar/View/TabBarViewController.swift +++ b/SurfPlaybook/Playbook/Flows/TabBar/TabBar/View/TabBarViewController.swift @@ -67,6 +67,21 @@ extension TabBarViewController: UITabBarControllerDelegate { isStackEmpty = navigationController?.visibleViewController == navigationController?.viewControllers[0] } isSelectableStackEmpty = isStackEmpty + + // Отключаем новомодную [анимацию](https://medium.com/@adityaramadhan.biz/new-tabbar-transition-animation-in-ios-18-and-xcode-16-ea4b2c4d84d4) + guard let fromView = selectedViewController?.view, + let toView = viewController.view else { + return false + } + + if fromView != toView { + UIView.transition(from: fromView, + to: toView, + duration: 0, + options: [.transitionCrossDissolve], + completion: nil) + } + return true }