Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
add OffGame RIB files
  • Loading branch information
unnnyong committed Jun 10, 2020
1 parent 4c5cd7f commit 7510440
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 0 deletions.
34 changes: 34 additions & 0 deletions RIBsPractice/RIBsPractice/OffGame/OffGameBuilder.swift
@@ -0,0 +1,34 @@
//
// OffGameBuilder.swift
// RIBsPractice
//
// Created by Eunyeong Kim on 2020/06/10.
// Copyright © 2020 Eunyeong Kim. All rights reserved.
//

import RIBs

protocol OffGameDependency: Dependency {}

final class OffGameComponent: Component<OffGameDependency> {}

// MARK: - Builder
protocol OffGameBuildable: Buildable {
func build(withListener listener: OffGameListener) -> OffGameRouting
}

final class OffGameBuilder: Builder<OffGameDependency>, OffGameBuildable {

override init(dependency: OffGameDependency) {
super.init(dependency: dependency)
}

func build(withListener listener: OffGameListener) -> OffGameRouting {
_ = OffGameComponent(dependency: dependency)
let viewController = OffGameViewController()
let interactor = OffGameInteractor(presenter: viewController)
interactor.listener = listener

return OffGameRouter(interactor: interactor, viewController: viewController)
}
}
30 changes: 30 additions & 0 deletions RIBsPractice/RIBsPractice/OffGame/OffGameInteractor.swift
@@ -0,0 +1,30 @@
//
// OffGameInteractor.swift
// RIBsPractice
//
// Created by Eunyeong Kim on 2020/06/10.
// Copyright © 2020 Eunyeong Kim. All rights reserved.
//

import RIBs
import RxSwift

protocol OffGameRouting: ViewableRouting {}

protocol OffGamePresentable: Presentable {
var listener: OffGamePresentableListener? { get set }
}

protocol OffGameListener: class {}

final class OffGameInteractor: PresentableInteractor<OffGamePresentable>, OffGameInteractable, OffGamePresentableListener {

weak var router: OffGameRouting?
weak var listener: OffGameListener?

override init(presenter: OffGamePresentable) {
super.init(presenter: presenter)

presenter.listener = self
}
}
25 changes: 25 additions & 0 deletions RIBsPractice/RIBsPractice/OffGame/OffGameRouter.swift
@@ -0,0 +1,25 @@
//
// OffGameRouter.swift
// RIBsPractice
//
// Created by Eunyeong Kim on 2020/06/10.
// Copyright © 2020 Eunyeong Kim. All rights reserved.
//

import RIBs

protocol OffGameInteractable: Interactable {
var router: OffGameRouting? { get set }
var listener: OffGameListener? { get set }
}

protocol OffGameViewControllable: ViewControllable {}

final class OffGameRouter: ViewableRouter<OffGameInteractable, OffGameViewControllable>, OffGameRouting {

override init(interactor: OffGameInteractable, viewController: OffGameViewControllable) {
super.init(interactor: interactor, viewController: viewController)

interactor.router = self
}
}
28 changes: 28 additions & 0 deletions RIBsPractice/RIBsPractice/OffGame/OffGameViewController.storyboard
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="vKn-9P-Ny8">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--product Name View Controller-->
<scene sceneID="GzV-lN-fg7">
<objects>
<viewController id="vKn-9P-Ny8" customClass="OffGameViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="BNZ-bO-rhc">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<viewLayoutGuide key="safeArea" id="HgA-Aw-ocO"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="k0X-am-vwV" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="244" y="205"/>
</scene>
</scenes>
</document>
18 changes: 18 additions & 0 deletions RIBsPractice/RIBsPractice/OffGame/OffGameViewController.swift
@@ -0,0 +1,18 @@
//
// OffGameViewController.swift
// RIBsPractice
//
// Created by Eunyeong Kim on 2020/06/10.
// Copyright © 2020 Eunyeong Kim. All rights reserved.
//

import RIBs
import RxSwift
import UIKit

protocol OffGamePresentableListener: class {}

final class OffGameViewController: UIViewController, OffGamePresentable, OffGameViewControllable {

weak var listener: OffGamePresentableListener?
}

0 comments on commit 7510440

Please sign in to comment.