This repository has been archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
3,863 additions
and
287 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1200" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "5B4C374025299ABB00A53EE0" | ||
BuildableName = "Example.app" | ||
BlueprintName = "Example" | ||
ReferencedContainer = "container:Example.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "5B4C374025299ABB00A53EE0" | ||
BuildableName = "Example.app" | ||
BlueprintName = "Example" | ||
ReferencedContainer = "container:Example.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "5B4C374025299ABB00A53EE0" | ||
BuildableName = "Example.app" | ||
BlueprintName = "Example" | ||
ReferencedContainer = "container:Example.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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,29 @@ | ||
// | ||
// AppDelegate.swift | ||
// Example | ||
// | ||
// Created by Lysytsia Yurii on 04.10.2020. | ||
// Copyright © 2020 Lysytsia Yurii. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@UIApplicationMain | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
// Create navigation controller | ||
let rootViewController = ModuleFabric.createStaticTableModule() | ||
let navigationController = UINavigationController(rootViewController: rootViewController) | ||
// Create window and set root view controller | ||
let window = UIWindow(frame: UIScreen.main.bounds) | ||
window.rootViewController = navigationController | ||
window.makeKeyAndVisible() | ||
self.window = window | ||
return true | ||
} | ||
|
||
} | ||
|
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,20 @@ | ||
// | ||
// Story.swift | ||
// Example | ||
// | ||
// Created by Lysytsia Yurii on 04.10.2020. | ||
// Copyright © 2020 Lysytsia Yurii. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class Story { | ||
var title: String | ||
var text: String | ||
|
||
init(title: String, text: String) { | ||
self.title = title | ||
self.text = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// User.swift | ||
// Example | ||
// | ||
// Created by Lysytsia Yurii on 04.10.2020. | ||
// Copyright © 2020 Lysytsia Yurii. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class User { | ||
|
||
var name: String | ||
var birthdate: Date? | ||
var gender: Gender? | ||
|
||
init(name: String) { | ||
self.name = name | ||
} | ||
|
||
enum Gender: String, CaseIterable { | ||
case male | ||
case female | ||
case other | ||
} | ||
|
||
} |
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,41 @@ | ||
// | ||
// ModuleFabric.swift | ||
// Example | ||
// | ||
// Created by Lysytsia Yurii on 04.10.2020. | ||
// Copyright © 2020 Lysytsia Yurii. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
enum ModuleFabric { | ||
|
||
static func createStaticTableModule() -> UIViewController { | ||
let view = StaticTableViewController() | ||
let presenter = StaticTablePresenter(view: view) | ||
view.output = presenter | ||
return view | ||
} | ||
|
||
static func createDynamicTableModule() -> UIViewController { | ||
let view = DynamicTableViewController() | ||
let presenter = DynamicTablePresenter(view: view) | ||
view.output = presenter | ||
return view | ||
} | ||
|
||
static func createDynamicUserTableModule(user: User) -> UIViewController { | ||
let view = DynamicUserTableViewController() | ||
let presenter = DynamicUserTablePresenter(user: user, view: view) | ||
view.output = presenter | ||
return view | ||
} | ||
|
||
static func createDynamicStoryTableModule(story: Story) -> UIViewController { | ||
let view = DynamicStoryTableViewController() | ||
let presenter = DynamicStoryTablePresenter(story: story, view: view) | ||
view.output = presenter | ||
return view | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
Example/Modules/DynamicStoryTable/Cell/DynamicStoryTableViewCell.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,36 @@ | ||
// | ||
// DynamicStoryTableViewCell.swift | ||
// Example | ||
// | ||
// Created by Lysytsia Yurii on 04.10.2020. | ||
// Copyright © 2020 Lysytsia Yurii. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import Source | ||
|
||
class DynamicStoryTableViewCell: UITableViewCell, IdentificableView, NibLoadableView, TextInputConfigurableView { | ||
|
||
// MARK: Outlet properties | ||
@IBOutlet private weak var titleLabel: UILabel! | ||
@IBOutlet private weak var descriptionTextView: UITextView! | ||
|
||
// MARK: Computed property | ||
var textInputView: UITextView { | ||
return self.descriptionTextView | ||
} | ||
|
||
// MARK: Functions | ||
func configure(model: Model) { | ||
self.titleLabel.text = model.title | ||
self.descriptionTextView.text = model.description | ||
} | ||
|
||
// MARK: Helpers | ||
struct Model: TextInputConfigurableModel { | ||
let title: String | ||
let description: String | ||
let textInputConfiguration: TextViewConfiguration | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
Example/Modules/DynamicStoryTable/Cell/DynamicStoryTableViewCell.xib
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,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="DynamicStoryTableViewCell" customModule="Example" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="240"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> | ||
<rect key="frame" x="0.0" y="0.0" width="320" height="240"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="99D-H6-1zp"> | ||
<rect key="frame" x="16" y="11" width="288" height="20.5"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<nil key="textColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Av8-i0-QNa"> | ||
<rect key="frame" x="16" y="35.5" width="288" height="193.5"/> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<constraints> | ||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="120" id="Zok-I4-HC2"/> | ||
</constraints> | ||
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string> | ||
<color key="textColor" systemColor="labelColor"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="14"/> | ||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> | ||
</textView> | ||
</subviews> | ||
<constraints> | ||
<constraint firstAttribute="bottomMargin" secondItem="Av8-i0-QNa" secondAttribute="bottom" id="Btm-FW-zrP"/> | ||
<constraint firstAttribute="trailingMargin" secondItem="99D-H6-1zp" secondAttribute="trailing" id="Rjn-i4-2Ij"/> | ||
<constraint firstItem="99D-H6-1zp" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="Yy9-UZ-cLC"/> | ||
<constraint firstItem="Av8-i0-QNa" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leadingMargin" id="beB-xL-iGK"/> | ||
<constraint firstAttribute="trailingMargin" secondItem="Av8-i0-QNa" secondAttribute="trailing" id="hPg-j5-ryX"/> | ||
<constraint firstItem="Av8-i0-QNa" firstAttribute="top" secondItem="99D-H6-1zp" secondAttribute="bottom" constant="4" id="tBB-1B-rx7"/> | ||
<constraint firstItem="99D-H6-1zp" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="topMargin" id="uZs-RH-yUb"/> | ||
</constraints> | ||
</tableViewCellContentView> | ||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/> | ||
<connections> | ||
<outlet property="descriptionTextView" destination="Av8-i0-QNa" id="puG-Wl-NVR"/> | ||
<outlet property="titleLabel" destination="99D-H6-1zp" id="kbq-f1-wZH"/> | ||
</connections> | ||
<point key="canvasLocation" x="137.68115942028987" y="126.5625"/> | ||
</tableViewCell> | ||
</objects> | ||
<resources> | ||
<systemColor name="labelColor"> | ||
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
</resources> | ||
</document> |
Oops, something went wrong.