1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-10-10 19:37:32 +03:00

Add Tiger SVG example

This commit is contained in:
shipinev 2016-04-21 13:23:46 +03:00
parent 37306d76cb
commit fc18868215
6 changed files with 1545 additions and 2367 deletions

View File

@ -21,6 +21,8 @@
574EC4441CBB60AF0063F317 /* AnimationsExampleController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574EC4431CBB60AF0063F317 /* AnimationsExampleController.swift */; };
575129B61CBD14AF00BD3C2E /* AnimationsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575129B51CBD14AF00BD3C2E /* AnimationsView.swift */; };
575129B81CBD18B800BD3C2E /* PieChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575129B71CBD18B800BD3C2E /* PieChart.swift */; };
66AE19D71CC8C7EA00B78B5E /* SVGExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66AE19D61CC8C7EA00B78B5E /* SVGExampleViewController.swift */; };
66AE19DB1CC8CB3C00B78B5E /* tiger.svg in Resources */ = {isa = PBXBuildFile; fileRef = 66AE19DA1CC8CB3C00B78B5E /* tiger.svg */; };
B02E75F11C16104900D1971D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B02E75F01C16104900D1971D /* AppDelegate.swift */; };
B02E75F61C16104900D1971D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B02E75F41C16104900D1971D /* Main.storyboard */; };
B02E75F81C16104900D1971D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B02E75F71C16104900D1971D /* Assets.xcassets */; };
@ -75,6 +77,8 @@
574EC4431CBB60AF0063F317 /* AnimationsExampleController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationsExampleController.swift; sourceTree = "<group>"; };
575129B51CBD14AF00BD3C2E /* AnimationsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationsView.swift; sourceTree = "<group>"; };
575129B71CBD18B800BD3C2E /* PieChart.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PieChart.swift; sourceTree = "<group>"; };
66AE19D61CC8C7EA00B78B5E /* SVGExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SVGExampleViewController.swift; path = SVG/SVGExampleViewController.swift; sourceTree = "<group>"; };
66AE19DA1CC8CB3C00B78B5E /* tiger.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = tiger.svg; path = Example/Assets/SVG/tiger.svg; sourceTree = "<group>"; };
B02E75ED1C16104900D1971D /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
B02E75F01C16104900D1971D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B02E75F51C16104900D1971D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
@ -106,6 +110,7 @@
574EC4271CB7DE7F0063F317 /* Examples */ = {
isa = PBXGroup;
children = (
66AE19D31CC8C7A100B78B5E /* SVG */,
574EC4421CBB607E0063F317 /* Animations */,
574EC4281CB7DE7F0063F317 /* Cleaner */,
574EC42C1CB7DE7F0063F317 /* Diagram */,
@ -179,9 +184,34 @@
path = Animations;
sourceTree = "<group>";
};
66AE19D31CC8C7A100B78B5E /* SVG */ = {
isa = PBXGroup;
children = (
66AE19D61CC8C7EA00B78B5E /* SVGExampleViewController.swift */,
);
name = SVG;
sourceTree = "<group>";
};
66AE19D81CC8CAB000B78B5E /* Assets */ = {
isa = PBXGroup;
children = (
66AE19D91CC8CAB600B78B5E /* SVG */,
);
name = Assets;
sourceTree = "<group>";
};
66AE19D91CC8CAB600B78B5E /* SVG */ = {
isa = PBXGroup;
children = (
66AE19DA1CC8CB3C00B78B5E /* tiger.svg */,
);
name = SVG;
sourceTree = "<group>";
};
B02E75E41C16104900D1971D = {
isa = PBXGroup;
children = (
66AE19D81CC8CAB000B78B5E /* Assets */,
24BE06FF1C6B91C800B5882F /* img */,
B02E75EF1C16104900D1971D /* Example */,
B02E75EE1C16104900D1971D /* Products */,
@ -297,6 +327,7 @@
files = (
B02E75FB1C16104900D1971D /* LaunchScreen.storyboard in Resources */,
B02E75F81C16104900D1971D /* Assets.xcassets in Resources */,
66AE19DB1CC8CB3C00B78B5E /* tiger.svg in Resources */,
B02E75F61C16104900D1971D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -312,6 +343,7 @@
574EC43C1CB7DE7F0063F317 /* RectShapeView.swift in Sources */,
574EC4441CBB60AF0063F317 /* AnimationsExampleController.swift in Sources */,
575129B61CBD14AF00BD3C2E /* AnimationsView.swift in Sources */,
66AE19D71CC8C7EA00B78B5E /* SVGExampleViewController.swift in Sources */,
24BE07041C6DF1F000B5882F /* BasePageViewController.swift in Sources */,
574EC43A1CB7DE7F0063F317 /* DiagramExampleView.swift in Sources */,
B02E75F11C16104900D1971D /* AppDelegate.swift in Sources */,

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -90,6 +90,24 @@
</objects>
<point key="canvasLocation" x="-838" y="1195"/>
</scene>
<!--SVG-->
<scene sceneID="7mv-yr-foI">
<objects>
<viewController storyboardIdentifier="SVGExampleViewController" title="SVG" id="mKW-eb-P6k" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="TsH-he-yyr"/>
<viewControllerLayoutGuide type="bottom" id="Ohj-O3-2uP"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="anZ-To-3Vj" customClass="SVGExampleView" customModule="Example" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="W3h-lx-w4E" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-838" y="1917"/>
</scene>
<!--Shapes-->
<scene sceneID="tne-QT-ifu">
<objects>

View File

@ -12,7 +12,8 @@ class BasePageViewController: UIPageViewController {
self.newMacawViewController("FourthPageViewController"),
self.newMacawViewController("AnimationsExampleController"),
self.newMacawViewController("ModelListenersExampleController"),
self.newMacawViewController("CleanerExampleController")
self.newMacawViewController("CleanerExampleController"),
self.newMacawViewController("SVGExampleViewController")
]
}()

View File

@ -0,0 +1,20 @@
import UIKit
import Macaw
class SVGExampleView: MacawView {
required init?(coder aDecoder: NSCoder) {
let path = NSBundle.mainBundle().pathForResource("tiger", ofType: "svg")
let text = try! String(contentsOfFile: path!, encoding: NSUTF8StringEncoding)
let transform = Transform().move(150, my: 150).scale(0.8, sy: 0.8)
let parser = SVGParser(text, pos: transform)
let tigerNode = parser.parse()
super.init(node: tigerNode, coder: aDecoder)
}
required init?(node: Node, coder aDecoder: NSCoder) {
super.init(node: node, coder: aDecoder)
}
}

File diff suppressed because it is too large Load Diff