Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Use more consistent variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
sendyhalim committed Jan 30, 2017
1 parent ef25a75 commit af95d9f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 35 deletions.
58 changes: 29 additions & 29 deletions Yomu/Controllers/MangaContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import RxSwift
class MangaContainerViewController: NSViewController {
@IBOutlet weak var mangaContainerView: NSView!
@IBOutlet weak var chapterContainerView: NSView!
@IBOutlet weak var chapterPageContainer: NSView!
@IBOutlet weak var chapterPageContainerView: NSView!
@IBOutlet weak var searchMangaButtonContainer: NSView!
@IBOutlet weak var searchMangaContainer: NSView!
@IBOutlet weak var searchMangaContainerView: NSView!

let mangaCollectionVM = MangaCollectionViewModel()
var mangaCollectionVC: MangaCollectionViewController!
Expand All @@ -39,7 +39,7 @@ class MangaContainerViewController: NSViewController {

mangaContainerView.addSubview(mangaCollectionVC.view)
chapterContainerView.addSubview(chapterCollectionVC.view)
searchMangaContainer.addSubview(searchedMangaVC.view)
searchMangaContainerView.addSubview(searchedMangaVC.view)

mangaCollectionVC.mangaSelectionDelegate = chapterCollectionVC
chapterCollectionVC.chapterSelectionDelegate = self
Expand All @@ -62,39 +62,39 @@ class MangaContainerViewController: NSViewController {
]))

Router.register(route: YomuRoute.searchManga([
searchMangaContainer
searchMangaContainerView
]))

Router.register(route: YomuRoute.chapterPage([
chapterPageContainer
chapterPageContainerView
]))
}

func setupConstraints() {
constrain(mangaCollectionVC.view, mangaContainerView) { mangaCollection, mangaContainerView in
mangaCollection.top == mangaContainerView.top
mangaCollection.bottom == mangaContainerView.bottom
mangaCollection.trailing == mangaContainerView.trailing
constrain(mangaCollectionVC.view, mangaContainerView) { child, parent in
child.top == parent.top
child.bottom == parent.bottom
child.trailing == parent.trailing

mangaCollection.width >= 300
mangaCollection.height >= 300
child.width >= 300
child.height >= 300
}

constrain(searchedMangaVC.view, searchMangaContainer) { searchMangaCollection, searchMangaContainer in
searchMangaCollection.top == searchMangaContainer.top
searchMangaCollection.bottom == searchMangaContainer.bottom
searchMangaCollection.trailing == searchMangaContainer.trailing
searchMangaCollection.leading == searchMangaContainer.leading
constrain(searchedMangaVC.view, searchMangaContainerView) { child, parent in
child.top == parent.top
child.bottom == parent.bottom
child.trailing == parent.trailing
child.leading == parent.leading
}

constrain(chapterCollectionVC.view, chapterContainerView) { chapterCollection, chapterContainerView in
chapterCollection.top == chapterContainerView.top
chapterCollection.bottom == chapterContainerView.bottom
chapterCollection.trailing == chapterContainerView.trailing
chapterCollection.leading == chapterContainerView.leading
constrain(chapterCollectionVC.view, chapterContainerView) { child, parent in
child.top == parent.top
child.bottom == parent.bottom
child.trailing == parent.trailing
child.leading == parent.leading

chapterCollection.width >= 470
chapterCollection.height >= 300
child.width >= 470
child.height >= 300
}
}

Expand All @@ -112,18 +112,18 @@ extension MangaContainerViewController: ChapterSelectionDelegate {
let pageVM = ChapterPageCollectionViewModel(chapterViewModel: ChapterViewModel(chapter: chapter))
chapterPageCollectionVC = ChapterPageCollectionViewController(viewModel: pageVM)
chapterPageCollectionVC!.delegate = self
chapterPageContainer.addSubview(chapterPageCollectionVC!.view)
chapterPageContainerView.addSubview(chapterPageCollectionVC!.view)

setupChapterPageCollectionConstraints()
Router.moveTo(id: YomuRouteId.ChapterPage)
}

func setupChapterPageCollectionConstraints() {
constrain(chapterPageCollectionVC!.view, chapterPageContainer) { chapterPageCollection, chapterPageContainer in
chapterPageCollection.top == chapterPageContainer.top
chapterPageCollection.bottom == chapterPageContainer.bottom
chapterPageCollection.left == chapterPageContainer.left
chapterPageCollection.right == chapterPageContainer.right
constrain(chapterPageCollectionVC!.view, chapterPageContainerView) { child, parent in
child.top == parent.top
child.bottom == parent.bottom
child.left == parent.left
child.right == parent.right
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions Yomu/Storyboards/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<capability name="system font weights other than Regular or Bold" minToolsVersion="7.0"/>
</dependencies>
<scenes>
<!--Application-->
Expand Down Expand Up @@ -674,7 +676,7 @@
<rect key="frame" x="0.0" y="0.0" width="770" height="372"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<box title="Box" boxType="custom" borderType="none" translatesAutoresizingMaskIntoConstraints="NO" id="PHi-SR-OkI">
<box boxType="custom" borderType="none" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="PHi-SR-OkI">
<rect key="frame" x="0.0" y="320" width="300" height="52"/>
<view key="contentView" id="blz-E3-99x">
<rect key="frame" x="0.0" y="0.0" width="300" height="52"/>
Expand All @@ -701,7 +703,6 @@
<constraints>
<constraint firstAttribute="height" constant="52" id="Esu-Gg-jJY"/>
</constraints>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</box>
<containerView translatesAutoresizingMaskIntoConstraints="NO" id="ieg-Qo-7il" userLabel="Manga Collection Container">
Expand Down Expand Up @@ -751,7 +752,7 @@
<outlet property="chapterPageContainerView" destination="s5e-FU-OMp" id="YZx-69-Ji8"/>
<outlet property="mangaContainerView" destination="ieg-Qo-7il" id="nvc-go-Rdh"/>
<outlet property="searchMangaButtonContainer" destination="PHi-SR-OkI" id="4mG-Fg-SMq"/>
<outlet property="searchMangaContainer" destination="1gj-c6-gQ6" id="yLD-S1-LEi"/>
<outlet property="searchMangaContainerView" destination="1gj-c6-gQ6" id="5kS-pH-Pj4"/>
</connections>
</viewController>
<customObject id="uPc-1X-fYj" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
Expand Down

0 comments on commit af95d9f

Please sign in to comment.