Commit 6c792658 by Daniel Dahan

updated MaterialView example

parent 87e77892
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
960CB2381C64017500EE010C /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 960CB2371C64017500EE010C /* Material.framework */; };
960CB2391C64017500EE010C /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 960CB2371C64017500EE010C /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
965E8E721C14A4950035A270 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965E8E711C14A4950035A270 /* AppDelegate.swift */; }; 965E8E721C14A4950035A270 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965E8E711C14A4950035A270 /* AppDelegate.swift */; };
965E8E741C14A4950035A270 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965E8E731C14A4950035A270 /* ViewController.swift */; }; 965E8E741C14A4950035A270 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965E8E731C14A4950035A270 /* ViewController.swift */; };
965E8E791C14A4950035A270 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 965E8E781C14A4950035A270 /* Assets.xcassets */; }; 965E8E791C14A4950035A270 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 965E8E781C14A4950035A270 /* Assets.xcassets */; };
...@@ -20,6 +22,7 @@ ...@@ -20,6 +22,7 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
960CB2391C64017500EE010C /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
960CB2371C64017500EE010C /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
965E8E6E1C14A4950035A270 /* MaterialButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MaterialButton.app; sourceTree = BUILT_PRODUCTS_DIR; }; 965E8E6E1C14A4950035A270 /* MaterialButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MaterialButton.app; sourceTree = BUILT_PRODUCTS_DIR; };
965E8E711C14A4950035A270 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 965E8E711C14A4950035A270 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
965E8E731C14A4950035A270 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 965E8E731C14A4950035A270 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
...@@ -40,6 +44,7 @@ ...@@ -40,6 +44,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
960CB2381C64017500EE010C /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -49,6 +54,7 @@ ...@@ -49,6 +54,7 @@
965E8E651C14A4950035A270 = { 965E8E651C14A4950035A270 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
960CB2371C64017500EE010C /* Material.framework */,
965E8E701C14A4950035A270 /* MaterialButton */, 965E8E701C14A4950035A270 /* MaterialButton */,
965E8E6F1C14A4950035A270 /* Products */, 965E8E6F1C14A4950035A270 /* Products */,
); );
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "Avatar.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Avatar@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Avatar@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -42,8 +42,7 @@ class ViewController: UIViewController { ...@@ -42,8 +42,7 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
// prepareGeneralMaterialViewExample() prepareGeneralMaterialViewExample()
prepareMaterialViewAnimationExample()
} }
/// General preparation statements. /// General preparation statements.
...@@ -53,46 +52,15 @@ class ViewController: UIViewController { ...@@ -53,46 +52,15 @@ class ViewController: UIViewController {
/// Prepare the MaterialView. /// Prepare the MaterialView.
private func prepareGeneralMaterialViewExample() { private func prepareGeneralMaterialViewExample() {
let point: CGFloat = (UIScreen.mainScreen().bounds.width - 150) / 2 let point: CGFloat = (UIScreen.mainScreen().bounds.width - 125) / 2
let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, 150, 150)) let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, 125, 125))
materialView.image = UIImage(named: "Avatar") materialView.image = UIImage(named: "CosmicMind")
materialView.shape = .Circle materialView.shape = .Circle
materialView.depth = .Depth2 materialView.depth = .Depth2
// Add materialView to UIViewController. // Add materialView to UIViewController.
view.addSubview(materialView) view.addSubview(materialView)
} }
/// Prepares the MaterialView animation example.
private func prepareMaterialViewAnimationExample() {
let point: CGFloat = (UIScreen.mainScreen().bounds.width - 150) / 2
let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, 150, 150))
materialView.image = UIImage(named: "Avatar")
materialView.shape = .Circle
materialView.depth = .Depth2
// Add materialView to UIViewController.
view.addSubview(materialView)
UIView.animateWithDuration(0.5,
delay: 2,
usingSpringWithDamping: 0.6,
initialSpringVelocity: 0,
options: .AllowUserInteraction,
animations: {
materialView.y = 300
}) { _ in
UIView.animateWithDuration(0.5,
delay: 2,
usingSpringWithDamping: 0.6,
initialSpringVelocity: 0,
options: .AllowUserInteraction,
animations: {
materialView.y = point
}, completion: nil)
}
}
} }
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.30.0' s.version = '1.30.1'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'A beautiful graphics framework for Material Design in Swift.' s.summary = 'A beautiful graphics framework for Material Design in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.30.0</string> <string>1.30.1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <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