Skip to content

Commit

Permalink
Merge pull request #9 from Wzxhaha/dev
Browse files Browse the repository at this point in the history
Merge pull request #9 from Wzxhaha/dev
  • Loading branch information
wzxha authored Mar 26, 2017
2 parents c1e455b + ac20fca commit 95f43cb
Show file tree
Hide file tree
Showing 47 changed files with 1,334 additions and 1,676 deletions.
Binary file not shown.

This file was deleted.

This file was deleted.

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
@@ -1,8 +1,8 @@
//
// AppDelegate.swift
// Example
// Example_iOS
//
// Created by WzxJiang on 17/2/6.
// Created by WzxJiang on 17/3/24.
// Copyright © 2017年 wzxjiang. All rights reserved.
//

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vsx-ib-sxT">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ijt-7z-k6W">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
Expand All @@ -10,26 +10,25 @@
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="phy-eM-2MK">
<scene sceneID="QXy-Az-m6y">
<objects>
<navigationController id="vsx-ib-sxT" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Qlm-xh-sJd">
<navigationController id="ijt-7z-k6W" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="4hp-xq-tiu">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="y2q-1E-Chp"/>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="9gQ-Xx-9dS"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mrg-Uk-J5Y" userLabel="First Responder" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="up4-DE-iyr" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-964" y="91"/>
<point key="canvasLocation" x="-401" y="-250"/>
</scene>
<!--Example-->
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Example_iOS" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
Expand All @@ -39,10 +38,11 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<navigationItem key="navigationItem" title="Example" id="OdG-rP-OZQ"/>
<navigationItem key="navigationItem" id="gs8-Ix-gez"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-188" y="90"/>
<point key="canvasLocation" x="506" y="-249"/>
</scene>
</scenes>
</document>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
tableView = UITableView(frame: self.view.bounds, style: .plain)
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "ExampleCell")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "ExampleCell")
self.view.addSubview(tableView)
}

Expand All @@ -51,7 +51,7 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour
return
}

let cls: AnyClass = NSClassFromString("Example." + clsName)!
let cls: AnyClass = NSClassFromString("Example_iOS." + clsName)!

self.navigationController?.pushViewController(VisExampleViewController.init(title: datas[indexPath.row]["title"]!, cls: cls), animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Viscosity

class VisExampleAnimatedView: UIView {
var redView: UIView!
Expand Down Expand Up @@ -35,21 +36,21 @@ class VisExampleAnimatedView: UIView {
self.addSubview(blueView)

redView.vis_makeConstraints { (make) in
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.bottom.equalTo(blueView.vis_top).offset(-padding)
make.size.equalTo(greenView)
make.height.equalTo(blueView)
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
make.bottom == blueView.vis_top +~ -padding
make.size == greenView
make.height == blueView
}

greenView.vis_makeConstraints { (make) in
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.left.equalTo(redView.vis_right).offset(padding)
make.bottom.equalTo(blueView.vis_top).offset(-padding)
make.height.equalTo(blueView)
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
make.left == redView.vis_right +~ padding
make.bottom == blueView.vis_top +~ -padding
make.height == blueView
}

blueView.vis_makeConstraints { (make) in
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
}
}

Expand All @@ -75,19 +76,19 @@ class VisExampleAnimatedView: UIView {
let paddingInsets = UIEdgeInsetsMake(padding, padding, padding, padding)

redView.vis_updateConstraints { (make) in
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.bottom.equalTo(blueView.vis_top).offset(-padding)
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
make.bottom == blueView.vis_top +~ -padding
}

greenView.vis_updateConstraints { (make) in
make.left.equalTo(redView.vis_right).offset(padding)
make.bottom.equalTo(blueView.vis_top).offset(-padding)
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.left == redView.vis_right +~ padding
make.bottom == blueView.vis_top +~ -padding
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
}


blueView.vis_updateConstraints { (make) in
make.edges.equalTo(self).insets(paddingInsets).priority(UILayoutPriorityDefaultLow)
make.edges == self +~ paddingInsets ~~ UILayoutPriorityDefaultLow
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Viscosity

class VisExampleAspectFitView: UIView {

Expand All @@ -20,33 +21,33 @@ class VisExampleAspectFitView: UIView {
let topView = UIView.exampleView(color: UIColor.blue.withAlphaComponent(0.5))
self.addSubview(topView)
topView.vis_makeConstraints { (make) in
make[.left, .right, .top].equalTo(self)
make[.left, .right, .top] == self
}

let bottomView = UIView.exampleView(color: UIColor.green.withAlphaComponent(0.5))
self.addSubview(bottomView)
bottomView.vis_makeConstraints { (make) in
make[.left, .right, .bottom].equalTo(self)
make.top.equalTo(topView.vis_bottom)
make.height.equalTo(topView)
make[.left, .right, .bottom] == self
make.top == topView.vis_bottom
make.height == topView
}

let topInnerView = UIView.exampleView(color: .blue)
topView.addSubview(topInnerView)
topInnerView.vis_makeConstraints { (make) in
make.size.lessThanOrEqualTo(topView)
make.size.equalTo(topView).priority(UILayoutPriorityDefaultLow)
make.width.equalTo(topInnerView.vis_height).multiplier(3)
make.center.equalTo(topView)
make.size <= topView
make.size == topView ~~ UILayoutPriorityDefaultLow
make.width == topInnerView.vis_height *~ 3
make.center == topView
}

let bottomInnerView = UIView.exampleView(color: .green)
bottomView.addSubview(bottomInnerView)
bottomInnerView.vis_makeConstraints { (make) in
make.size.lessThanOrEqualTo(bottomView)
make.size.equalTo(bottomView).priority(UILayoutPriorityDefaultLow)
make.height.equalTo(bottomInnerView.vis_width).multiplier(3)
make.center.equalTo(bottomView)
make.size <= bottomView
make.size == bottomView ~~ UILayoutPriorityDefaultLow
make.height == bottomInnerView.vis_width *~ 3
make.center == bottomView
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import Viscosity

class VisExampleBasicView: UIView {

Expand All @@ -28,19 +29,19 @@ class VisExampleBasicView: UIView {
self.addSubview(blueView)

redView.vis_makeConstraints { (make) in
make[.top, .left].equalTo(self).offset(padding)
make[.top, .left] == self +~ padding
}

greenView.vis_makeConstraints { (make) in
make.left.equalTo(redView.vis_right).offset(padding)
make[.right, .top].equalTo(self).offset([-padding, padding])
make[.bottom, .width].equalTo(redView)
make.left == redView.vis_right +~ padding
make[.right, .top] == self +~ [-padding, padding]
make[.bottom, .width] == redView
}

blueView.vis_makeConstraints { (make) in
make[.left, .right, .bottom].equalTo(self).offset([padding, -padding, -padding])
make.top.equalTo(redView.vis_bottom).offset(padding)
make.height.equalTo(redView)
make[.left, .right, .bottom] == self +~ [padding, -padding, -padding]
make.top == redView.vis_bottom +~ padding
make.height == redView
}
}

Expand Down
Loading

0 comments on commit 95f43cb

Please sign in to comment.