-
Notifications
You must be signed in to change notification settings - Fork 48
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
1 parent
4c12a4b
commit c94f721
Showing
8 changed files
with
166 additions
and
2 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
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
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
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
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,63 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="jtA-Is-IGf"> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Storyboard View Controller--> | ||
<scene sceneID="9I6-gG-AK5"> | ||
<objects> | ||
<viewController id="jtA-Is-IGf" customClass="StoryboardViewController" customModule="Tests_iOS" customModuleProvider="target" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="MaC-Aq-h72"/> | ||
<viewControllerLayoutGuide type="bottom" id="amm-Xz-GQN"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="Xek-1O-YQZ"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="zb1-Gc-1Ri"> | ||
<rect key="frame" x="0.0" y="20" width="600" height="580"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<prototypes> | ||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="StoryboardCell" id="Nrx-9s-Wv0" customClass="StoryboardCell" customModule="Tests_iOS" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="28" width="600" height="44"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Nrx-9s-Wv0" id="zT7-ij-Fmy"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="43"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1yW-mB-mqz"> | ||
<rect key="frame" x="159" y="8" width="42" height="21"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
</tableViewCellContentView> | ||
<connections> | ||
<outlet property="storyboardLabel" destination="1yW-mB-mqz" id="zMx-nm-zSm"/> | ||
</connections> | ||
</tableViewCell> | ||
</prototypes> | ||
</tableView> | ||
</subviews> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstItem="zb1-Gc-1Ri" firstAttribute="top" secondItem="MaC-Aq-h72" secondAttribute="bottom" id="NAh-yl-tor"/> | ||
<constraint firstItem="zb1-Gc-1Ri" firstAttribute="leading" secondItem="Xek-1O-YQZ" secondAttribute="leading" id="Nqh-Jq-jhY"/> | ||
<constraint firstAttribute="trailing" secondItem="zb1-Gc-1Ri" secondAttribute="trailing" id="jk2-LL-Lr3"/> | ||
<constraint firstItem="amm-Xz-GQN" firstAttribute="top" secondItem="zb1-Gc-1Ri" secondAttribute="bottom" id="yqA-iS-aHR"/> | ||
</constraints> | ||
</view> | ||
<connections> | ||
<outlet property="tableView" destination="zb1-Gc-1Ri" id="lfw-48-Rzn"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="2kJ-GB-9l1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="751" y="560"/> | ||
</scene> | ||
</scenes> | ||
</document> |
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,18 @@ | ||
// | ||
// StoryboardCell.swift | ||
// DTTableViewManager | ||
// | ||
// Created by Denys Telezhkin on 10.01.16. | ||
// Copyright © 2016 Denys Telezhkin. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import DTModelStorage | ||
|
||
class StoryboardCell : UITableViewCell, ModelTransfer | ||
{ | ||
@IBOutlet weak var storyboardLabel: UILabel! | ||
func updateWithModel(model: Int) { | ||
|
||
} | ||
} |
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,35 @@ | ||
// | ||
// StoryboardMappingTestCase.swift | ||
// DTTableViewManager | ||
// | ||
// Created by Denys Telezhkin on 10.01.16. | ||
// Copyright © 2016 Denys Telezhkin. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import XCTest | ||
import Nimble | ||
import DTModelStorage | ||
@testable import DTTableViewManager | ||
|
||
class StoryboardMappingTestCase: XCTestCase { | ||
|
||
var controller : StoryboardViewController! | ||
|
||
override func setUp() { | ||
super.setUp() | ||
let storyboard = UIStoryboard(name: "FixtureStoryboard", bundle: NSBundle(forClass: self.dynamicType)) | ||
controller = storyboard.instantiateInitialViewController() as! StoryboardViewController | ||
_ = controller.view | ||
controller.manager.startManagingWithDelegate(controller) | ||
} | ||
|
||
func testCellIsMappedAndOutletsAreCreated() { | ||
controller.manager.registerCellClass(StoryboardCell) | ||
controller.manager.memoryStorage.addItem(1) | ||
|
||
let cell = controller.manager.tableView(controller.tableView, cellForRowAtIndexPath: indexPath(0, 0)) as! StoryboardCell | ||
|
||
expect(cell.storyboardLabel).toNot(beNil()) | ||
} | ||
} |
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,15 @@ | ||
// | ||
// StoryboardViewController.swift | ||
// DTTableViewManager | ||
// | ||
// Created by Denys Telezhkin on 10.01.16. | ||
// Copyright © 2016 Denys Telezhkin. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import DTTableViewManager | ||
|
||
class StoryboardViewController: UIViewController, DTTableViewManageable { | ||
|
||
@IBOutlet weak var tableView: UITableView! | ||
} |