Skip to content

Dsml #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Dsml #11

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ This repository hosts each sample app in separate directory.
| Example | Description |
| ------------- | ------------- |
| [tmdb-mvvm-rxswift-pure](tmdb-mvvm-rxswift-pure) | Uses [RxSwift](https://github.com/ReactiveX/RxSwift) and observables as binding mechanism between `ViewController` and `ViewModel`. Also, it uses simple navigator pattern for transitions between screens. (README in progress) |
| [tmdb-rx-driver](tmdb-rx-driver) | Uses [RxSwift](https://github.com/ReactiveX/RxSwift) and observables as binding mechanism between `ViewController` and `Driver`. Also, it uses binding techniques to separate logic. [Wiki.](https://github.com/dmsl1805/Cookbook/wiki) |


### Single screen app examples
Expand Down
Binary file added tmdb-rx-driver/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmdb-rx-driver/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmdb-rx-driver/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tmdb-rx-driver/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions tmdb-rx-driver/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'tmdb-rx-driver' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

pod 'RxSwift', '~> 5'
pod 'RxCocoa', '~> 5'
pod 'RxSwiftExt', '~> 5'
pod 'RxViewController'
pod 'RxDataSources'
pod 'R.swift'
pod 'Nuke', '~> 7.0'

end
65 changes: 65 additions & 0 deletions tmdb-rx-driver/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
PODS:
- Differentiator (4.0.1)
- Nuke (7.6.3)
- R.swift (5.2.2):
- R.swift.Library (~> 5.2.0)
- R.swift.Library (5.2.0)
- RxCocoa (5.1.1):
- RxRelay (~> 5)
- RxSwift (~> 5)
- RxDataSources (4.0.1):
- Differentiator (~> 4.0)
- RxCocoa (~> 5.0)
- RxSwift (~> 5.0)
- RxRelay (5.1.1):
- RxSwift (~> 5)
- RxSwift (5.1.1)
- RxSwiftExt (5.2.0):
- RxSwiftExt/Core (= 5.2.0)
- RxSwiftExt/RxCocoa (= 5.2.0)
- RxSwiftExt/Core (5.2.0):
- RxSwift (~> 5.0)
- RxSwiftExt/RxCocoa (5.2.0):
- RxCocoa (~> 5.0)
- RxSwiftExt/Core
- RxViewController (1.0.0):
- RxCocoa (~> 5.0)
- RxSwift (~> 5.0)

DEPENDENCIES:
- Nuke (~> 7.0)
- R.swift
- RxCocoa (~> 5)
- RxDataSources
- RxSwift (~> 5)
- RxSwiftExt (~> 5)
- RxViewController

SPEC REPOS:
trunk:
- Differentiator
- Nuke
- R.swift
- R.swift.Library
- RxCocoa
- RxDataSources
- RxRelay
- RxSwift
- RxSwiftExt
- RxViewController

SPEC CHECKSUMS:
Differentiator: 886080237d9f87f322641dedbc5be257061b0602
Nuke: 44130e95e09463f8773ae4b96b90de1eba6b3350
R.swift: 7c52cdc57a66840ffe6cbd8a823d732059d42a32
R.swift.Library: 5ba4f1631300caf9a4d890186930da85d540769d
RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601
RxDataSources: efee07fa4de48477eca0a4611e6d11e2da9c1114
RxRelay: d77f7d771495f43c556cbc43eebd1bb54d01e8e9
RxSwift: 81470a2074fa8780320ea5fe4102807cb7118178
RxSwiftExt: 4ca80336f43c28f11a2825cdd2fc61dd6c044697
RxViewController: 7330a46e5c31cd680db169da4c9fc8676e975a81

PODFILE CHECKSUM: 1b323ff7b941979a9274ad85169b0f5f4130f733

COCOAPODS: 1.9.3
25 changes: 25 additions & 0 deletions tmdb-rx-driver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# tmdb-mvvm-rxswift-driver
🔒 ** If you want to login, use username `iostest` and password `test`.**


This example uses RxSwift Drivers as binding mechanism between `Driver` and `ViewController`.
### [Read Wiki](https://github.com/dmsl1805/Cookbook/wiki)

| ![](1.png) | ![](2.png) |
| --- | --- |
| ![](3.png) | ![](4.png) |

## Installation
Clone the repository:

`git clone [email protected]:dmsl1805/ios-architecture.git`

branch `dsml`

Navigate to `tmdb-rx-driver` directory:

`cd tmdb-rx-driver`

Install dependencies:

`pod install`
829 changes: 829 additions & 0 deletions tmdb-rx-driver/tmdb-rx-driver.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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>
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 = "1AE0176325175DD40019F8FA"
BuildableName = "tmdb-rx-driver.app"
BlueprintName = "tmdb-rx-driver"
ReferencedContainer = "container:tmdb-rx-driver.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 = "1AE0176325175DD40019F8FA"
BuildableName = "tmdb-rx-driver.app"
BlueprintName = "tmdb-rx-driver"
ReferencedContainer = "container:tmdb-rx-driver.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1AE0176325175DD40019F8FA"
BuildableName = "tmdb-rx-driver.app"
BlueprintName = "tmdb-rx-driver"
ReferencedContainer = "container:tmdb-rx-driver.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 10 additions & 0 deletions tmdb-rx-driver/tmdb-rx-driver.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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>
42 changes: 42 additions & 0 deletions tmdb-rx-driver/tmdb-rx-driver/Application/App.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// App.swift
// tmdb-mvvm-pure
//
// Created by krawiecp-home on 30/01/2019.
// Copyright © 2019 tailec. All rights reserved.
//

import UIKit

final class App {
static let shared = App()

func startInterface(in window: UIWindow) {
let discoverViewController = DiscoverViewController.Factory.default
let discoverNavigationController = UINavigationController(rootViewController: discoverViewController)

let searchNavigationController = UINavigationController(rootViewController: SearchViewController.Factory.default)

let tabBarController = UITabBarController()
tabBarController.tabBar.barTintColor = UIColor(red: 18/255, green: 18/255, blue: 18/255, alpha: 1.0)
tabBarController.tabBar.tintColor = .white

discoverNavigationController.tabBarItem = UITabBarItem(title: "Discover", image: nil, selectedImage: nil)

searchNavigationController.tabBarItem = UITabBarItem(title: "Search", image: nil, selectedImage: nil)

tabBarController.viewControllers = [
discoverNavigationController,
searchNavigationController
]

let loginNavigationController = UINavigationController(rootViewController: LoginViewController.Factory.default)

window.rootViewController = tabBarController
window.makeKeyAndVisible()

// Not the nicest solution, if someone has any idea how to manage login/main screens, please let me know!
tabBarController.present(loginNavigationController, animated: true, completion: nil)

}
}
25 changes: 25 additions & 0 deletions tmdb-rx-driver/tmdb-rx-driver/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AppDelegate.swift
// tmdb-mvvm-pure
//
// Created by krawiecp-home on 27/01/2019.
// Copyright © 2019 tailec. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)

if let window = window {
App.shared.startInterface(in: window)
}

return true
}
}
25 changes: 25 additions & 0 deletions tmdb-rx-driver/tmdb-rx-driver/Application/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
Loading