Commit 54a0341a by Daniel Dahan

updated MaterialLayer example to use async image loading

parent bec6cbeb
......@@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "CosmicMindAppIcon.png",
"filename" : "CosmicMindInverted.png",
"scale" : "1x"
},
{
......
......@@ -59,15 +59,17 @@ class ViewController: UIViewController {
:description: General usage example.
*/
private func prepareGeneralMaterialLayerExample() {
let materialLayer: MaterialLayer = MaterialLayer(frame: CGRectMake(132, 132, 150, 150))
let diameter: CGFloat = 150
let point: CGFloat = UIScreen.mainScreen().bounds.width / 2 - diameter / 2
let materialLayer: MaterialLayer = MaterialLayer(frame: CGRectMake(point, point, diameter, diameter))
materialLayer.shape = .Circle
materialLayer.depth = .Depth2
UIImage.contentsOfURL(NSURL(string: "http://www.cosmicmind.io/CosmicMind.png")!) { (image: UIImage?, error: NSError?) in
UIImage.contentsOfURL(NSURL(string: "http://www.cosmicmind.io/CM/CosmicMindInverted.png")!) { (image: UIImage?, error: NSError?) in
if let v: UIImage = image {
materialLayer.image = v
} else {
materialLayer.image = UIImage(named: "CosmicMindAppIcon")
materialLayer.image = UIImage(named: "CosmicMindInverted")
}
}
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.29.0'
s.version = '1.29.1'
s.license = 'BSD'
s.summary = 'A beautiful graphics framework for Material Design in Swift.'
s.homepage = 'http://cosmicmind.io'
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.29.0</string>
<string>1.29.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment