-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from f3dm76/task/shadows
Fix #34: Implement DropShadow effect rendering
Showing
21 changed files
with
542 additions
and
200 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
39 changes: 34 additions & 5 deletions
39
Example/Example/Examples/SVG/SVGExampleViewController.swift
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 |
---|---|---|
@@ -1,10 +1,39 @@ | ||
import UIKit | ||
// | ||
// SVGExampleViewController.swift | ||
// Example | ||
// | ||
// Created by Alisa Mylnikova on 17/05/2018. | ||
// Copyright © 2018 Exyte. All rights reserved. | ||
// | ||
|
||
import Macaw | ||
|
||
class SVGExampleView: MacawView { | ||
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 | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
super.init(node: SVGParser.parse(path: "tiger"), coder: aDecoder) | ||
} | ||
// 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. | ||
} | ||
*/ | ||
|
||
} |
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,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) | ||
} | ||
|
||
} |
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
Oops, something went wrong.