diff --git a/Example/Example/Assets/SVG/shadows.svg b/Example/Example/Assets/SVG/shadows.svg new file mode 100644 index 00000000..83d96680 --- /dev/null +++ b/Example/Example/Assets/SVG/shadows.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/Example/Example/Base.lproj/Main.storyboard b/Example/Example/Base.lproj/Main.storyboard index 57c55aa6..19d45698 100644 --- a/Example/Example/Base.lproj/Main.storyboard +++ b/Example/Example/Base.lproj/Main.storyboard @@ -158,10 +158,10 @@ - + - + @@ -186,6 +186,9 @@ + + + @@ -316,5 +319,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Examples/New Group/SVGExampleViewController.swift b/Example/Example/Examples/New Group/SVGExampleViewController.swift new file mode 100644 index 00000000..114c538a --- /dev/null +++ b/Example/Example/Examples/New Group/SVGExampleViewController.swift @@ -0,0 +1,39 @@ +// +// SVGExampleViewController.swift +// Example +// +// Created by Alisa Mylnikova on 17/05/2018. +// Copyright © 2018 Exyte. All rights reserved. +// + +import Macaw + +class SVGExampleViewController: UIViewController { + + @IBOutlet var svgView: SVGView! + + var fileName: String? + + override func viewDidLoad() { + super.viewDidLoad() + + svgView.fileName = fileName + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Example/Example/Examples/New Group/SVGViewController.swift b/Example/Example/Examples/New Group/SVGViewController.swift new file mode 100644 index 00000000..b24f34b1 --- /dev/null +++ b/Example/Example/Examples/New Group/SVGViewController.swift @@ -0,0 +1,37 @@ +import UIKit + +open class SVGViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { + + @IBOutlet var tableView: UITableView! + + fileprivate var svgExamples = [ + "shadows", + "tiger" + ] + + open override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + tableView.reloadData() + } + + open func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + open func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return svgExamples.count + } + + open func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "menu_cell")! + cell.textLabel?.text = svgExamples[indexPath.row].capitalized + return cell + } + + open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let controller = UIStoryboard(name: "Main", bundle: .none).instantiateViewController(withIdentifier: "SVGExampleViewController") as! SVGExampleViewController + controller.fileName = svgExamples[indexPath.row] + navigationController?.pushViewController(controller, animated: true) + } + +} diff --git a/Example/Example/MenuViewController.swift b/Example/Example/MenuViewController.swift index 241d3df1..a7cab389 100644 --- a/Example/Example/MenuViewController.swift +++ b/Example/Example/MenuViewController.swift @@ -8,7 +8,7 @@ open class MenuViewController: UIViewController, UITableViewDataSource, UITableV "FirstPageViewController", "TransformExampleController", "AnimationsExampleController", - "SVGExampleViewController", + "SVGViewController", "EasingExampleController", "MorphingExampleController", "EventsExampleController"