Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
4e5e7bcc
Commit
4e5e7bcc
authored
Mar 27, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issues with Swift 3
parent
7cccc6ec
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
86 additions
and
125 deletions
+86
-125
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
+0
-6
Examples/Programmatic/App/App/AppSearchBarViewController.swift
+6
-8
Examples/Programmatic/App/App/ItemViewController.swift
+6
-0
Examples/Programmatic/App/App/RecipesViewController.swift
+3
-1
Material.xcodeproj/project.pbxproj
+0
-6
Sources/CardView.swift
+6
-2
Sources/ImageCardView.swift
+6
-2
Sources/Material+UIImage+Crop.swift
+5
-5
Sources/Material+UIImage+PhotoLibrary.swift
+0
-41
Sources/Material+UIImage+Resize.swift
+9
-6
Sources/MaterialButton.swift
+3
-6
Sources/MaterialCollectionViewCell.swift
+3
-6
Sources/MaterialLayout.swift
+4
-2
Sources/MaterialPulseAnimation.swift
+17
-14
Sources/MaterialPulseView.swift
+3
-6
Sources/MaterialTableViewCell.swift
+3
-6
Sources/SideNavigationController.swift
+12
-8
No files found.
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
View file @
4e5e7bcc
...
@@ -7,8 +7,6 @@
...
@@ -7,8 +7,6 @@
objects
=
{
objects
=
{
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
96162C691CA7191800E3A235
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C681CA7191800E3A235
/* Material.framework */
;
};
96162C6A1CA7191800E3A235
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C681CA7191800E3A235
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
96162C6C1CA71C8700E3A235
/* VideoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
;
};
96162C6C1CA71C8700E3A235
/* VideoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
;
};
96162C6E1CA7274E00E3A235
/* PhotoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
;
};
96162C6E1CA7274E00E3A235
/* PhotoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
;
};
9663F9321C7A744600AF0965
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9311C7A744600AF0965
/* AppDelegate.swift */
;
};
9663F9321C7A744600AF0965
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9311C7A744600AF0965
/* AppDelegate.swift */
;
};
...
@@ -30,7 +28,6 @@
...
@@ -30,7 +28,6 @@
dstPath
=
""
;
dstPath
=
""
;
dstSubfolderSpec
=
10
;
dstSubfolderSpec
=
10
;
files
=
(
files
=
(
96162C6A1CA7191800E3A235
/* Material.framework in Embed Frameworks */
,
);
);
name
=
"Embed Frameworks"
;
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -38,7 +35,6 @@
...
@@ -38,7 +35,6 @@
/* End PBXCopyFilesBuildPhase section */
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
96162C681CA7191800E3A235
/* 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>"
;
};
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
VideoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
VideoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PhotoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PhotoViewController.swift
;
sourceTree
=
"<group>"
;
};
9663F92E1C7A744600AF0965
/* App.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
App.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9663F92E1C7A744600AF0965
/* App.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
App.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
...
@@ -60,7 +56,6 @@
...
@@ -60,7 +56,6 @@
isa
=
PBXFrameworksBuildPhase
;
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
96162C691CA7191800E3A235
/* Material.framework in Frameworks */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
@@ -70,7 +65,6 @@
...
@@ -70,7 +65,6 @@
9663F9251C7A744500AF0965
=
{
9663F9251C7A744500AF0965
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
96162C681CA7191800E3A235
/* Material.framework */
,
9663F9301C7A744600AF0965
/* App */
,
9663F9301C7A744600AF0965
/* App */
,
9663F92F1C7A744600AF0965
/* Products */
,
9663F92F1C7A744600AF0965
/* Products */
,
);
);
...
...
Examples/Programmatic/App/App/AppSearchBarViewController.swift
View file @
4e5e7bcc
...
@@ -43,12 +43,6 @@ class AppSearchBarController: SearchBarController {
...
@@ -43,12 +43,6 @@ class AppSearchBarController: SearchBarController {
prepareSearchBar
()
prepareSearchBar
()
}
}
override
func
viewWillDisappear
(
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
searchBar
.
textField
.
resignFirstResponder
()
sideNavigationController
?
.
enabled
=
true
}
override
func
viewWillAppear
(
animated
:
Bool
)
{
override
func
viewWillAppear
(
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
searchBar
.
statusBarStyle
=
.
Default
searchBar
.
statusBarStyle
=
.
Default
...
@@ -60,6 +54,12 @@ class AppSearchBarController: SearchBarController {
...
@@ -60,6 +54,12 @@ class AppSearchBarController: SearchBarController {
searchBar
.
textField
.
becomeFirstResponder
()
searchBar
.
textField
.
becomeFirstResponder
()
}
}
override
func
viewWillDisappear
(
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
searchBar
.
textField
.
resignFirstResponder
()
sideNavigationController
?
.
enabled
=
true
}
/// Toggle SideSearchViewController left UIViewController.
/// Toggle SideSearchViewController left UIViewController.
internal
func
handleBackButton
()
{
internal
func
handleBackButton
()
{
searchBar
.
textField
.
resignFirstResponder
()
searchBar
.
textField
.
resignFirstResponder
()
...
@@ -108,8 +108,6 @@ class AppSearchBarController: SearchBarController {
...
@@ -108,8 +108,6 @@ class AppSearchBarController: SearchBarController {
searchBar
.
placeholderTextColor
=
MaterialColor
.
grey
.
darken4
searchBar
.
placeholderTextColor
=
MaterialColor
.
grey
.
darken4
searchBar
.
textField
.
font
=
RobotoFont
.
regular
searchBar
.
textField
.
font
=
RobotoFont
.
regular
searchBar
.
textField
.
delegate
=
self
searchBar
.
textField
.
delegate
=
self
searchBar
.
contentInset
.
left
=
8
searchBar
.
contentInset
.
right
=
8
searchBar
.
clearButton
=
clearButton
searchBar
.
clearButton
=
clearButton
searchBar
.
leftControls
=
[
backButton
]
searchBar
.
leftControls
=
[
backButton
]
...
...
Examples/Programmatic/App/App/ItemViewController.swift
View file @
4e5e7bcc
...
@@ -73,6 +73,12 @@ class ItemViewController: UIViewController {
...
@@ -73,6 +73,12 @@ class ItemViewController: UIViewController {
prepareImageCardView
()
prepareImageCardView
()
}
}
override
func
viewWillAppear
(
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
// Stops the scrollView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets
=
false
}
override
func
viewWillLayoutSubviews
()
{
override
func
viewWillLayoutSubviews
()
{
super
.
viewWillLayoutSubviews
()
super
.
viewWillLayoutSubviews
()
scrollView
.
frame
=
view
.
bounds
scrollView
.
frame
=
view
.
bounds
...
...
Examples/Programmatic/App/App/RecipesViewController.swift
View file @
4e5e7bcc
...
@@ -63,6 +63,9 @@ class RecipesViewController: UIViewController {
...
@@ -63,6 +63,9 @@ class RecipesViewController: UIViewController {
override
func
viewWillAppear
(
animated
:
Bool
)
{
override
func
viewWillAppear
(
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
super
.
viewWillAppear
(
animated
)
// Stops the tableView contentInsets from being automatically adjusted.
automaticallyAdjustsScrollViewInsets
=
false
// Set the navigationBar style.
// Set the navigationBar style.
navigationController
?
.
navigationBar
.
statusBarStyle
=
.
LightContent
navigationController
?
.
navigationBar
.
statusBarStyle
=
.
LightContent
...
@@ -213,7 +216,6 @@ class RecipesViewController: UIViewController {
...
@@ -213,7 +216,6 @@ class RecipesViewController: UIViewController {
/// Prepares view.
/// Prepares view.
private
func
prepareView
()
{
private
func
prepareView
()
{
view
.
backgroundColor
=
MaterialColor
.
white
view
.
backgroundColor
=
MaterialColor
.
white
automaticallyAdjustsScrollViewInsets
=
false
}
}
/// Prepares the titleLabel.
/// Prepares the titleLabel.
...
...
Material.xcodeproj/project.pbxproj
View file @
4e5e7bcc
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
960B232E1C383EAA00E96216
/* Material+UIImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
};
960B232E1C383EAA00E96216
/* Material+UIImage.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
};
960B232F1C383EAA00E96216
/* Material+UIImage+Crop.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
};
960B232F1C383EAA00E96216
/* Material+UIImage+Crop.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
};
960B23301C383EAA00E96216
/* Material+UIImage+Network.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
;
};
960B23301C383EAA00E96216
/* Material+UIImage+Network.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
;
};
960B23311C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232B1C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift */
;
};
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
;
};
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
;
};
960B23331C383EAA00E96216
/* Material+UIImage+Size.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
;
};
960B23331C383EAA00E96216
/* Material+UIImage+Size.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
;
};
960B23461C38480E00E96216
/* Text.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23431C38480E00E96216
/* Text.swift */
;
};
960B23461C38480E00E96216
/* Text.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23431C38480E00E96216
/* Text.swift */
;
};
...
@@ -23,7 +22,6 @@
...
@@ -23,7 +22,6 @@
960B234A1C38490D00E96216
/* Material+UIImage.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234A1C38490D00E96216
/* Material+UIImage.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23281C383EAA00E96216
/* Material+UIImage.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234B1C38490D00E96216
/* Material+UIImage+Crop.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234B1C38490D00E96216
/* Material+UIImage+Crop.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234C1C38490D00E96216
/* Material+UIImage+Network.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234C1C38490D00E96216
/* Material+UIImage+Network.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234D1C38490D00E96216
/* Material+UIImage+PhotoLibrary.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232B1C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234E1C38490D00E96216
/* Material+UIImage+Resize.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234E1C38490D00E96216
/* Material+UIImage+Resize.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234F1C38490D00E96216
/* Material+UIImage+Size.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B234F1C38490D00E96216
/* Material+UIImage+Size.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B23501C38490D00E96216
/* Text.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23431C38480E00E96216
/* Text.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
960B23501C38490D00E96216
/* Text.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
960B23431C38480E00E96216
/* Text.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
@@ -181,7 +179,6 @@
...
@@ -181,7 +179,6 @@
960B23281C383EAA00E96216
/* Material+UIImage.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage.swift"
;
sourceTree
=
"<group>"
;
};
960B23281C383EAA00E96216
/* Material+UIImage.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage.swift"
;
sourceTree
=
"<group>"
;
};
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Crop.swift"
;
sourceTree
=
"<group>"
;
};
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Crop.swift"
;
sourceTree
=
"<group>"
;
};
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Network.swift"
;
sourceTree
=
"<group>"
;
};
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Network.swift"
;
sourceTree
=
"<group>"
;
};
960B232B1C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+PhotoLibrary.swift"
;
sourceTree
=
"<group>"
;
};
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Resize.swift"
;
sourceTree
=
"<group>"
;
};
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Resize.swift"
;
sourceTree
=
"<group>"
;
};
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Size.swift"
;
sourceTree
=
"<group>"
;
};
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIImage+Size.swift"
;
sourceTree
=
"<group>"
;
};
960B23431C38480E00E96216
/* Text.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Text.swift
;
sourceTree
=
"<group>"
;
};
960B23431C38480E00E96216
/* Text.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Text.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -554,7 +551,6 @@
...
@@ -554,7 +551,6 @@
960B23281C383EAA00E96216
/* Material+UIImage.swift */
,
960B23281C383EAA00E96216
/* Material+UIImage.swift */
,
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
,
960B23291C383EAA00E96216
/* Material+UIImage+Crop.swift */
,
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
,
960B232A1C383EAA00E96216
/* Material+UIImage+Network.swift */
,
960B232B1C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift */
,
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
,
960B232C1C383EAA00E96216
/* Material+UIImage+Resize.swift */
,
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
,
960B232D1C383EAA00E96216
/* Material+UIImage+Size.swift */
,
96DBA7351C61198400844821
/* Material+UIImage+Color.swift */
,
96DBA7351C61198400844821
/* Material+UIImage+Color.swift */
,
...
@@ -657,7 +653,6 @@
...
@@ -657,7 +653,6 @@
960B234A1C38490D00E96216
/* Material+UIImage.swift in Headers */
,
960B234A1C38490D00E96216
/* Material+UIImage.swift in Headers */
,
960B234B1C38490D00E96216
/* Material+UIImage+Crop.swift in Headers */
,
960B234B1C38490D00E96216
/* Material+UIImage+Crop.swift in Headers */
,
960B234C1C38490D00E96216
/* Material+UIImage+Network.swift in Headers */
,
960B234C1C38490D00E96216
/* Material+UIImage+Network.swift in Headers */
,
960B234D1C38490D00E96216
/* Material+UIImage+PhotoLibrary.swift in Headers */
,
960B234E1C38490D00E96216
/* Material+UIImage+Resize.swift in Headers */
,
960B234E1C38490D00E96216
/* Material+UIImage+Resize.swift in Headers */
,
960B234F1C38490D00E96216
/* Material+UIImage+Size.swift in Headers */
,
960B234F1C38490D00E96216
/* Material+UIImage+Size.swift in Headers */
,
960B23501C38490D00E96216
/* Text.swift in Headers */
,
960B23501C38490D00E96216
/* Text.swift in Headers */
,
...
@@ -838,7 +833,6 @@
...
@@ -838,7 +833,6 @@
96D88C221C1328D800B91418
/* FabButton.swift in Sources */
,
96D88C221C1328D800B91418
/* FabButton.swift in Sources */
,
96D88C3F1C1328D800B91418
/* RaisedButton.swift in Sources */
,
96D88C3F1C1328D800B91418
/* RaisedButton.swift in Sources */
,
65FDC2EB1C66858A00103AC2
/* Menu.swift in Sources */
,
65FDC2EB1C66858A00103AC2
/* Menu.swift in Sources */
,
960B23311C383EAA00E96216
/* Material+UIImage+PhotoLibrary.swift in Sources */
,
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
,
960B23321C383EAA00E96216
/* Material+UIImage+Resize.swift in Sources */
,
96D88C3C1C1328D800B91418
/* MaterialTransitionAnimation.swift in Sources */
,
96D88C3C1C1328D800B91418
/* MaterialTransitionAnimation.swift in Sources */
,
96D88C361C1328D800B91418
/* MaterialPulseView.swift in Sources */
,
96D88C361C1328D800B91418
/* MaterialPulseView.swift in Sources */
,
...
...
Sources/CardView.swift
View file @
4e5e7bcc
...
@@ -322,7 +322,7 @@ public class CardView : MaterialPulseView {
...
@@ -322,7 +322,7 @@ public class CardView : MaterialPulseView {
d
[
k
]
=
b
d
[
k
]
=
b
if
0
==
i
++
{
if
0
==
i
{
h
+=
"-(left)-"
h
+=
"-(left)-"
}
else
{
}
else
{
h
+=
"-(left_right)-"
h
+=
"-(left_right)-"
...
@@ -332,6 +332,8 @@ public class CardView : MaterialPulseView {
...
@@ -332,6 +332,8 @@ public class CardView : MaterialPulseView {
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
leftButtonsInset
.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
leftButtonsInset
.
bottom
)
i
+=
1
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInset
.
left
+
leftButtonsInset
.
left
,
"left_right"
:
leftButtonsInset
.
left
+
leftButtonsInset
.
right
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInset
.
left
+
leftButtonsInset
.
left
,
"left_right"
:
leftButtonsInset
.
left
+
leftButtonsInset
.
right
],
views
:
d
))
...
@@ -352,7 +354,7 @@ public class CardView : MaterialPulseView {
...
@@ -352,7 +354,7 @@ public class CardView : MaterialPulseView {
h
+=
"[
\(
k
)
]"
h
+=
"[
\(
k
)
]"
if
0
==
i
--
{
if
0
==
i
{
h
+=
"-(right)-"
h
+=
"-(right)-"
}
else
{
}
else
{
h
+=
"-(right_left)-"
h
+=
"-(right_left)-"
...
@@ -360,6 +362,8 @@ public class CardView : MaterialPulseView {
...
@@ -360,6 +362,8 @@ public class CardView : MaterialPulseView {
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
rightButtonsInset
.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
rightButtonsInset
.
bottom
)
i
-=
1
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInset
.
right
+
rightButtonsInset
.
right
,
"right_left"
:
rightButtonsInset
.
right
+
rightButtonsInset
.
left
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInset
.
right
+
rightButtonsInset
.
right
,
"right_left"
:
rightButtonsInset
.
right
+
rightButtonsInset
.
left
],
views
:
d
))
...
...
Sources/ImageCardView.swift
View file @
4e5e7bcc
...
@@ -425,7 +425,7 @@ public class ImageCardView : MaterialPulseView {
...
@@ -425,7 +425,7 @@ public class ImageCardView : MaterialPulseView {
d
[
k
]
=
b
d
[
k
]
=
b
if
0
==
i
++
{
if
0
==
i
{
h
+=
"-(left)-"
h
+=
"-(left)-"
}
else
{
}
else
{
h
+=
"-(left_right)-"
h
+=
"-(left_right)-"
...
@@ -435,6 +435,8 @@ public class ImageCardView : MaterialPulseView {
...
@@ -435,6 +435,8 @@ public class ImageCardView : MaterialPulseView {
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
leftButtonsInset
.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
leftButtonsInset
.
bottom
)
i
+=
1
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInset
.
left
+
leftButtonsInset
.
left
,
"left_right"
:
leftButtonsInset
.
left
+
leftButtonsInset
.
right
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
,
options
:
[],
metrics
:
[
"left"
:
contentInset
.
left
+
leftButtonsInset
.
left
,
"left_right"
:
leftButtonsInset
.
left
+
leftButtonsInset
.
right
],
views
:
d
))
...
@@ -455,7 +457,7 @@ public class ImageCardView : MaterialPulseView {
...
@@ -455,7 +457,7 @@ public class ImageCardView : MaterialPulseView {
h
+=
"[
\(
k
)
]"
h
+=
"[
\(
k
)
]"
if
0
==
i
--
{
if
0
==
i
{
h
+=
"-(right)-"
h
+=
"-(right)-"
}
else
{
}
else
{
h
+=
"-(right_left)-"
h
+=
"-(right_left)-"
...
@@ -463,6 +465,8 @@ public class ImageCardView : MaterialPulseView {
...
@@ -463,6 +465,8 @@ public class ImageCardView : MaterialPulseView {
addSubview
(
b
)
addSubview
(
b
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
rightButtonsInset
.
bottom
)
MaterialLayout
.
alignFromBottom
(
self
,
child
:
b
,
bottom
:
contentInset
.
bottom
+
rightButtonsInset
.
bottom
)
i
-=
1
}
}
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInset
.
right
+
rightButtonsInset
.
right
,
"right_left"
:
rightButtonsInset
.
right
+
rightButtonsInset
.
left
],
views
:
d
))
addConstraints
(
MaterialLayout
.
constraint
(
h
+
"|"
,
options
:
[],
metrics
:
[
"right"
:
contentInset
.
right
+
rightButtonsInset
.
right
,
"right_left"
:
rightButtonsInset
.
right
+
rightButtonsInset
.
left
],
views
:
d
))
...
...
Sources/Material+UIImage+Crop.swift
View file @
4e5e7bcc
...
@@ -34,14 +34,14 @@ public extension UIImage {
...
@@ -34,14 +34,14 @@ public extension UIImage {
/**
/**
:name: crop
:name: crop
*/
*/
public
func
crop
(
var
toWidth
w
:
CGFloat
,
var
toHeight
h
:
CGFloat
)
->
UIImage
?
{
public
func
crop
(
toWidth
tw
:
CGFloat
,
toHeight
t
h
:
CGFloat
)
->
UIImage
?
{
let
g
:
UIImage
?
let
g
:
UIImage
?
let
b
:
Bool
=
width
>
height
let
b
:
Bool
=
width
>
height
let
s
:
CGFloat
=
b
?
h
/
height
:
w
/
width
let
s
:
CGFloat
=
b
?
th
/
height
:
t
w
/
width
let
t
:
CGSize
=
CGSizeMake
(
w
,
h
)
let
t
:
CGSize
=
CGSizeMake
(
tw
,
t
h
)
w
=
width
*
s
let
w
=
width
*
s
h
=
height
*
s
let
h
=
height
*
s
UIGraphicsBeginImageContext
(
t
)
UIGraphicsBeginImageContext
(
t
)
drawInRect
(
b
?
CGRectMake
(
-
1
*
(
w
-
t
.
width
)
/
2
,
0
,
w
,
h
)
:
CGRectMake
(
0
,
-
1
*
(
h
-
t
.
height
)
/
2
,
w
,
h
),
blendMode
:
.
Normal
,
alpha
:
1
)
drawInRect
(
b
?
CGRectMake
(
-
1
*
(
w
-
t
.
width
)
/
2
,
0
,
w
,
h
)
:
CGRectMake
(
0
,
-
1
*
(
h
-
t
.
height
)
/
2
,
w
,
h
),
blendMode
:
.
Normal
,
alpha
:
1
)
...
...
Sources/Material+UIImage+PhotoLibrary.swift
deleted
100644 → 0
View file @
7cccc6ec
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import
UIKit
public
extension
UIImage
{
/**
:name: writeToPhotoLibrary
*/
public
func
writeToPhotoLibrary
(
target
t
:
AnyObject
?
=
nil
)
{
UIImageWriteToSavedPhotosAlbum
(
self
,
t
,
"image:didFinishSavingWithError:contextInfo:"
,
nil
)
}
}
\ No newline at end of file
Sources/Material+UIImage+Resize.swift
View file @
4e5e7bcc
...
@@ -34,15 +34,18 @@ public extension UIImage {
...
@@ -34,15 +34,18 @@ public extension UIImage {
/**
/**
:name: internalResize
:name: internalResize
*/
*/
private
func
internalResize
(
var
toWidth
w
:
CGFloat
=
0
,
var
toHeight
h
:
CGFloat
=
0
)
->
UIImage
?
{
private
func
internalResize
(
toWidth
tw
:
CGFloat
=
0
,
toHeight
th
:
CGFloat
=
0
)
->
UIImage
?
{
if
0
<
w
{
var
w
:
CGFloat
?
h
=
height
*
w
/
width
var
h
:
CGFloat
?
}
else
if
0
<
h
{
w
=
width
*
h
/
height
if
0
<
tw
{
h
=
height
*
tw
/
width
}
else
if
0
<
th
{
w
=
width
*
th
/
height
}
}
let
g
:
UIImage
?
let
g
:
UIImage
?
let
t
:
CGRect
=
CGRectMake
(
0
,
0
,
w
,
h
)
let
t
:
CGRect
=
CGRectMake
(
0
,
0
,
nil
==
w
?
tw
:
w
!
,
nil
==
h
?
th
:
h
!
)
UIGraphicsBeginImageContextWithOptions
(
t
.
size
,
false
,
MaterialDevice
.
scale
)
UIGraphicsBeginImageContextWithOptions
(
t
.
size
,
false
,
MaterialDevice
.
scale
)
drawInRect
(
t
,
blendMode
:
.
Normal
,
alpha
:
1
)
drawInRect
(
t
,
blendMode
:
.
Normal
,
alpha
:
1
)
g
=
UIGraphicsGetImageFromCurrentImageContext
()
g
=
UIGraphicsGetImageFromCurrentImageContext
()
...
...
Sources/MaterialButton.swift
View file @
4e5e7bcc
...
@@ -408,15 +408,12 @@ public class MaterialButton : UIButton {
...
@@ -408,15 +408,12 @@ public class MaterialButton : UIButton {
- Parameter point: A Optional point to pulse from, otherwise pulses
- Parameter point: A Optional point to pulse from, otherwise pulses
from the center.
from the center.
*/
*/
public
func
pulse
(
var
point
:
CGPoint
?
=
nil
)
{
public
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
if
nil
==
point
{
let
p
:
CGPoint
=
nil
==
point
?
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
:
point
!
point
=
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
}
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
if
let
v
:
UIColor
=
pulseColor
{
if
let
v
:
UIColor
=
pulseColor
{
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
oint
!
,
width
:
width
,
height
:
height
,
duration
:
duration
)
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
,
width
:
width
,
height
:
height
,
duration
:
duration
)
}
}
if
pulseScale
{
if
pulseScale
{
...
...
Sources/MaterialCollectionViewCell.swift
View file @
4e5e7bcc
...
@@ -513,15 +513,12 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
...
@@ -513,15 +513,12 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
- Parameter point: A Optional point to pulse from, otherwise pulses
- Parameter point: A Optional point to pulse from, otherwise pulses
from the center.
from the center.
*/
*/
public
func
pulse
(
var
point
:
CGPoint
?
=
nil
)
{
public
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
if
nil
==
point
{
let
p
:
CGPoint
=
nil
==
point
?
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
:
point
!
point
=
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
}
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
if
let
v
:
UIColor
=
pulseColor
{
if
let
v
:
UIColor
=
pulseColor
{
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
oint
!
,
width
:
width
,
height
:
height
,
duration
:
duration
)
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
,
width
:
width
,
height
:
height
,
duration
:
duration
)
}
}
if
pulseScale
{
if
pulseScale
{
...
...
Sources/MaterialLayout.swift
View file @
4e5e7bcc
...
@@ -66,7 +66,8 @@ public struct MaterialLayout {
...
@@ -66,7 +66,8 @@ public struct MaterialLayout {
var
i
:
Int
=
1
var
i
:
Int
=
1
var
views
:
Dictionary
<
String
,
UIView
>
=
Dictionary
<
String
,
UIView
>
()
var
views
:
Dictionary
<
String
,
UIView
>
=
Dictionary
<
String
,
UIView
>
()
for
v
in
children
{
for
v
in
children
{
let
k
:
String
=
"view
\(
i
++
)
"
let
k
:
String
=
"view
\(
i
)
"
i
+=
1
views
[
k
]
=
v
views
[
k
]
=
v
format
+=
i
>
children
.
count
?
"[
\(
k
)
(==view1)]-(right)-|"
:
"[
\(
k
)
(==view1)]-(spacing)-"
format
+=
i
>
children
.
count
?
"[
\(
k
)
(==view1)]-(right)-|"
:
"[
\(
k
)
(==view1)]-(spacing)-"
}
}
...
@@ -83,7 +84,8 @@ public struct MaterialLayout {
...
@@ -83,7 +84,8 @@ public struct MaterialLayout {
var
i
:
Int
=
1
var
i
:
Int
=
1
var
views
:
Dictionary
<
String
,
UIView
>
=
Dictionary
<
String
,
UIView
>
()
var
views
:
Dictionary
<
String
,
UIView
>
=
Dictionary
<
String
,
UIView
>
()
for
v
in
children
{
for
v
in
children
{
let
k
:
String
=
"view
\(
i
++
)
"
let
k
:
String
=
"view
\(
i
)
"
i
+=
1
views
[
k
]
=
v
views
[
k
]
=
v
format
+=
i
>
children
.
count
?
"[
\(
k
)
(==view1)]-(bottom)-|"
:
"[
\(
k
)
(==view1)]-(spacing)-"
format
+=
i
>
children
.
count
?
"[
\(
k
)
(==view1)]-(bottom)-|"
:
"[
\(
k
)
(==view1)]-(spacing)-"
}
}
...
...
Sources/MaterialPulseAnimation.swift
View file @
4e5e7bcc
...
@@ -42,7 +42,7 @@ internal extension MaterialAnimation {
...
@@ -42,7 +42,7 @@ internal extension MaterialAnimation {
- Parameter duration: Animation duration.
- Parameter duration: Animation duration.
- Parameter pulseLayer: An Optional pulseLayer to use in the animation.
- Parameter pulseLayer: An Optional pulseLayer to use in the animation.
*/
*/
internal
static
func
pulseAnimation
(
layer
:
CALayer
,
visualLayer
:
CALayer
,
color
:
UIColor
,
point
:
CGPoint
,
width
:
CGFloat
,
height
:
CGFloat
,
duration
:
NSTimeInterval
,
var
pulseLayer
:
CAShapeLayer
?
=
nil
)
{
internal
static
func
pulseAnimation
(
layer
:
CALayer
,
visualLayer
:
CALayer
,
color
:
UIColor
,
point
:
CGPoint
,
width
:
CGFloat
,
height
:
CGFloat
,
duration
:
NSTimeInterval
,
pulseLayer
:
CAShapeLayer
?
=
nil
)
{
let
r
:
CGFloat
=
(
width
<
height
?
height
:
width
)
/
2
let
r
:
CGFloat
=
(
width
<
height
?
height
:
width
)
/
2
let
f
:
CGFloat
=
3
let
f
:
CGFloat
=
3
...
@@ -50,37 +50,40 @@ internal extension MaterialAnimation {
...
@@ -50,37 +50,40 @@ internal extension MaterialAnimation {
let
d
:
CGFloat
=
2
*
f
let
d
:
CGFloat
=
2
*
f
var
b
:
Bool
=
false
var
b
:
Bool
=
false
var
pLayer
:
CAShapeLayer
?
if
nil
==
pulseLayer
{
if
nil
==
pulseLayer
{
p
ulse
Layer
=
CAShapeLayer
()
pLayer
=
CAShapeLayer
()
b
=
true
b
=
true
}
else
{
pLayer
=
pulseLayer
}
}
p
ulse
Layer
!.
hidden
=
true
pLayer
!.
hidden
=
true
p
ulse
Layer
!.
zPosition
=
1
pLayer
!.
zPosition
=
1
p
ulse
Layer
!.
backgroundColor
=
color
.
CGColor
pLayer
!.
backgroundColor
=
color
.
CGColor
visualLayer
.
addSublayer
(
p
ulse
Layer
!
)
visualLayer
.
addSublayer
(
pLayer
!
)
MaterialAnimation
.
animationDisabled
{
MaterialAnimation
.
animationDisabled
{
p
ulse
Layer
!.
bounds
=
CGRectMake
(
0
,
0
,
v
,
v
)
pLayer
!.
bounds
=
CGRectMake
(
0
,
0
,
v
,
v
)
p
ulse
Layer
!.
position
=
point
pLayer
!.
position
=
point
p
ulse
Layer
!.
cornerRadius
=
r
/
d
pLayer
!.
cornerRadius
=
r
/
d
p
ulse
Layer
!.
hidden
=
false
pLayer
!.
hidden
=
false
}
}
p
ulse
Layer
!.
addAnimation
(
MaterialAnimation
.
scale
((
b
?
3
:
1.7
)
*
d
,
duration
:
duration
),
forKey
:
nil
)
pLayer
!.
addAnimation
(
MaterialAnimation
.
scale
((
b
?
3
:
1.7
)
*
d
,
duration
:
duration
),
forKey
:
nil
)
if
b
{
if
b
{
MaterialAnimation
.
delay
(
duration
)
{
MaterialAnimation
.
delay
(
duration
)
{
MaterialAnimation
.
animateWithDuration
(
duration
,
animations
:
{
MaterialAnimation
.
animateWithDuration
(
duration
,
animations
:
{
p
ulse
Layer
?
.
hidden
=
true
pLayer
?
.
hidden
=
true
})
{
})
{
p
ulse
Layer
?
.
removeFromSuperlayer
()
pLayer
?
.
removeFromSuperlayer
()
}
}
}
}
}
else
{
}
else
{
MaterialAnimation
.
delay
(
duration
/
2
)
{
MaterialAnimation
.
delay
(
duration
/
2
)
{
p
ulse
Layer
?
.
addAnimation
(
MaterialAnimation
.
scale
(
1.3
*
d
,
duration
:
duration
),
forKey
:
nil
)
pLayer
?
.
addAnimation
(
MaterialAnimation
.
scale
(
1.3
*
d
,
duration
:
duration
),
forKey
:
nil
)
}
}
}
}
}
}
...
...
Sources/MaterialPulseView.swift
View file @
4e5e7bcc
...
@@ -51,15 +51,12 @@ public class MaterialPulseView : MaterialView {
...
@@ -51,15 +51,12 @@ public class MaterialPulseView : MaterialView {
- Parameter point: A Optional point to pulse from, otherwise pulses
- Parameter point: A Optional point to pulse from, otherwise pulses
from the center.
from the center.
*/
*/
public
func
pulse
(
var
point
:
CGPoint
?
=
nil
)
{
public
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
if
nil
==
point
{
let
p
:
CGPoint
=
nil
==
point
?
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
:
point
!
point
=
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
}
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
if
let
v
:
UIColor
=
pulseColor
{
if
let
v
:
UIColor
=
pulseColor
{
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
oint
!
,
width
:
width
,
height
:
height
,
duration
:
duration
)
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
,
width
:
width
,
height
:
height
,
duration
:
duration
)
}
}
if
pulseScale
{
if
pulseScale
{
...
...
Sources/MaterialTableViewCell.swift
View file @
4e5e7bcc
...
@@ -363,15 +363,12 @@ public class MaterialTableViewCell : UITableViewCell {
...
@@ -363,15 +363,12 @@ public class MaterialTableViewCell : UITableViewCell {
- Parameter point: A Optional point to pulse from, otherwise pulses
- Parameter point: A Optional point to pulse from, otherwise pulses
from the center.
from the center.
*/
*/
public
func
pulse
(
var
point
:
CGPoint
?
=
nil
)
{
public
func
pulse
(
point
:
CGPoint
?
=
nil
)
{
if
nil
==
point
{
let
p
:
CGPoint
=
nil
==
point
?
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
:
point
!
point
=
CGPointMake
(
CGFloat
(
width
/
2
),
CGFloat
(
height
/
2
))
}
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
let
duration
:
NSTimeInterval
=
MaterialAnimation
.
pulseDuration
(
width
)
if
let
v
:
UIColor
=
pulseColor
{
if
let
v
:
UIColor
=
pulseColor
{
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
oint
!
,
width
:
width
,
height
:
height
,
duration
:
duration
)
MaterialAnimation
.
pulseAnimation
(
layer
,
visualLayer
:
visualLayer
,
color
:
v
.
colorWithAlphaComponent
(
pulseOpacity
),
point
:
p
,
width
:
width
,
height
:
height
,
duration
:
duration
)
}
}
if
pulseScale
{
if
pulseScale
{
...
...
Sources/SideNavigationController.swift
View file @
4e5e7bcc
...
@@ -365,18 +365,20 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
...
@@ -365,18 +365,20 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
- Parameter animated: A Boolean value that indicates to animate
- Parameter animated: A Boolean value that indicates to animate
the leftView width change.
the leftView width change.
*/
*/
public
func
setLeftViewWidth
(
width
:
CGFloat
,
var
hidden
:
Bool
,
animated
:
Bool
,
duration
:
NSTimeInterval
=
0.5
)
{
public
func
setLeftViewWidth
(
width
:
CGFloat
,
hidden
:
Bool
,
animated
:
Bool
,
duration
:
NSTimeInterval
=
0.5
)
{
if
let
v
:
MaterialView
=
leftView
{
if
let
v
:
MaterialView
=
leftView
{
leftViewWidth
=
width
leftViewWidth
=
width
var
hide
:
Bool
=
hidden
if
openedRightView
{
if
openedRightView
{
hid
den
=
true
hid
e
=
true
}
}
if
animated
{
if
animated
{
v
.
shadowPathAutoSizeEnabled
=
false
v
.
shadowPathAutoSizeEnabled
=
false
if
hid
den
{
if
hid
e
{
UIView
.
animateWithDuration
(
duration
,
UIView
.
animateWithDuration
(
duration
,
animations
:
{
[
unowned
self
]
in
animations
:
{
[
unowned
self
]
in
v
.
bounds
.
size
.
width
=
width
v
.
bounds
.
size
.
width
=
width
...
@@ -401,7 +403,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
...
@@ -401,7 +403,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
}
}
}
else
{
}
else
{
v
.
bounds
.
size
.
width
=
width
v
.
bounds
.
size
.
width
=
width
if
hid
den
{
if
hid
e
{
hideView
(
v
)
hideView
(
v
)
v
.
position
.
x
=
-
v
.
width
/
2
v
.
position
.
x
=
-
v
.
width
/
2
rootViewController
.
view
.
alpha
=
1
rootViewController
.
view
.
alpha
=
1
...
@@ -429,18 +431,20 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
...
@@ -429,18 +431,20 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
- Parameter animated: A Boolean value that indicates to animate
- Parameter animated: A Boolean value that indicates to animate
the rightView width change.
the rightView width change.
*/
*/
public
func
setRightViewWidth
(
width
:
CGFloat
,
var
hidden
:
Bool
,
animated
:
Bool
,
duration
:
NSTimeInterval
=
0.5
)
{
public
func
setRightViewWidth
(
width
:
CGFloat
,
hidden
:
Bool
,
animated
:
Bool
,
duration
:
NSTimeInterval
=
0.5
)
{
if
let
v
:
MaterialView
=
rightView
{
if
let
v
:
MaterialView
=
rightView
{
rightViewWidth
=
width
rightViewWidth
=
width
var
hide
:
Bool
=
hidden
if
openedLeftView
{
if
openedLeftView
{
hid
den
=
true
hid
e
=
true
}
}
if
animated
{
if
animated
{
v
.
shadowPathAutoSizeEnabled
=
false
v
.
shadowPathAutoSizeEnabled
=
false
if
hid
den
{
if
hid
e
{
UIView
.
animateWithDuration
(
duration
,
UIView
.
animateWithDuration
(
duration
,
animations
:
{
[
unowned
self
]
in
animations
:
{
[
unowned
self
]
in
v
.
bounds
.
size
.
width
=
width
v
.
bounds
.
size
.
width
=
width
...
@@ -465,7 +469,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
...
@@ -465,7 +469,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
}
}
}
else
{
}
else
{
v
.
bounds
.
size
.
width
=
width
v
.
bounds
.
size
.
width
=
width
if
hid
den
{
if
hid
e
{
hideView
(
v
)
hideView
(
v
)
v
.
position
.
x
=
view
.
bounds
.
width
+
v
.
width
/
2
v
.
position
.
x
=
view
.
bounds
.
width
+
v
.
width
/
2
rootViewController
.
view
.
alpha
=
1
rootViewController
.
view
.
alpha
=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment