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
be05fff0
Commit
be05fff0
authored
Aug 07, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: removed public extension declarations, not needed.
parent
19fad6e1
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
79 additions
and
93 deletions
+79
-93
Sources/iOS/BasicAnimation.swift
+1
-1
Sources/iOS/BottomTabBar.swift
+2
-2
Sources/iOS/Button.swift
+9
-18
Sources/iOS/Depth.swift
+1
-1
Sources/iOS/Grid.swift
+21
-20
Sources/iOS/IconButton.swift
+2
-0
Sources/iOS/KeyframeAnimation.swift
+1
-1
Sources/iOS/Layout.swift
+2
-2
Sources/iOS/Material+Array.swift
+1
-1
Sources/iOS/Material+String.swift
+1
-1
Sources/iOS/Material+UIFont.swift
+1
-1
Sources/iOS/Material+UIView.swift
+25
-33
Sources/iOS/Material+UIWindow.swift
+1
-1
Sources/iOS/MenuController.swift
+1
-1
Sources/iOS/NavigationBar.swift
+1
-1
Sources/iOS/NavigationDrawerController.swift
+1
-1
Sources/iOS/NavigationItem.swift
+1
-1
Sources/iOS/Offset.swift
+3
-3
Sources/iOS/SearchBarController.swift
+1
-1
Sources/iOS/StatusBarController.swift
+1
-1
Sources/iOS/ToolbarController.swift
+1
-1
Sources/iOS/TransitionAnimation.swift
+1
-1
No files found.
Sources/iOS/BasicAnimation.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
Animation
{
extension
Animation
{
/**
:name: backgroundColor
*/
...
...
Sources/iOS/BottomTabBar.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UITabBarItem
{
extension
UITabBarItem
{
/// Sets the color of the title color for a state.
public
func
setTitleColor
(
color
:
UIColor
,
forState
state
:
UIControlState
)
{
setTitleTextAttributes
([
NSForegroundColorAttributeName
:
color
],
for
:
state
)
...
...
@@ -146,7 +146,7 @@ public class MaterialAssociatedObjectTabBar {
}
}
public
extension
UITabBar
{
extension
UITabBar
{
/// TabBarItem reference.
public
internal(set)
var
item
:
MaterialAssociatedObjectTabBar
{
get
{
...
...
Sources/iOS/Button.swift
View file @
be05fff0
...
...
@@ -47,13 +47,13 @@ public class Button: UIButton {
public
weak
var
delegate
:
MaterialDelegate
?
/// An Array of pulse layers.
public
private(set)
lazy
var
pulseLayers
:
Array
<
CAShapeLayer
>
=
Array
<
CAShapeLayer
>
()
public
private(set)
lazy
var
pulseLayers
=
Array
<
CAShapeLayer
>
()
/// The opacity value for the pulse animation.
@IBInspectable
public
var
pulseOpacity
:
CGFloat
=
0.25
/// The color of the pulse effect.
@IBInspectable
public
var
pulseColor
:
UIColor
=
Color
.
grey
.
base
@IBInspectable
public
var
pulseColor
=
Color
.
grey
.
base
/// The type of PulseAnimation.
public
var
pulseAnimation
:
PulseAnimation
=
.
pointWithBacking
...
...
@@ -68,18 +68,9 @@ public class Button: UIButton {
/// A preset property for updated contentEdgeInsets.
public
var
contentEdgeInsetsPreset
:
EdgeInsetsPreset
=
.
none
{
didSet
{
content
Inset
=
EdgeInsetsPresetToValue
(
preset
:
contentEdgeInsetsPreset
)
content
EdgeInsets
=
EdgeInsetsPresetToValue
(
preset
:
contentEdgeInsetsPreset
)
}
}
/**
:name: contentInset
*/
@IBInspectable
public
var
contentInset
=
EdgeInsets
.
zero
{
didSet
{
contentEdgeInsets
=
contentInset
}
}
/**
An initializer that initializes the object with a NSCoder object.
...
...
@@ -169,12 +160,12 @@ public class Button: UIButton {
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public
func
prepareView
()
{
contentScaleFactor
=
Device
.
scale
prepareVisualLayer
()
...
...
Sources/iOS/Depth.swift
View file @
be05fff0
...
...
@@ -109,7 +109,7 @@ public func DepthPresetToValue(preset: DepthPreset) -> Depth {
}
/// Grid extension for UIView.
public
extension
UIView
{
extension
UIView
{
/// A preset value for Depth.
public
var
depthPreset
:
DepthPreset
{
get
{
...
...
Sources/iOS/Grid.swift
View file @
be05fff0
...
...
@@ -201,9 +201,9 @@ public class Grid {
var
n
:
Int
=
0
for
i
in
0
..<
v
.
count
{
let
child
:
UIView
=
v
[
i
]
let
child
=
v
[
i
]
if
let
parent
:
UIView
=
context
{
if
let
parent
=
context
{
if
parent
!=
child
.
superview
{
child
.
removeFromSuperview
()
parent
.
addSubview
(
child
)
...
...
@@ -213,17 +213,15 @@ public class Grid {
switch
axis
.
direction
{
case
.
horizontal
:
let
w
=
(
parent
.
bounds
.
width
-
contentInset
.
left
-
contentInset
.
right
-
layoutInset
.
left
-
layoutInset
.
right
+
interimSpace
)
/
CGFloat
(
gc
)
let
c
=
child
.
grid
.
columns
let
co
=
child
.
grid
.
offset
.
columns
let
vh
=
parent
.
bounds
.
height
-
contentInset
.
top
-
contentInset
.
bottom
-
layoutInset
.
top
-
layoutInset
.
bottom
let
vl
=
CGFloat
(
i
+
n
+
co
)
*
w
+
contentInset
.
left
+
layoutInset
.
left
let
vw
=
w
*
CGFloat
(
c
)
-
interimSpace
child
.
x
=
vl
let
w
=
(
parent
.
bounds
.
width
-
contentInset
.
left
-
contentInset
.
right
-
layoutInset
.
left
-
layoutInset
.
right
+
interimSpace
)
/
CGFloat
(
gc
)
child
.
x
=
CGFloat
(
i
+
n
+
co
)
*
w
+
contentInset
.
left
+
layoutInset
.
left
child
.
y
=
contentInset
.
top
+
layoutInset
.
top
child
.
width
=
vw
child
.
height
=
vh
child
.
width
=
w
*
CGFloat
(
c
)
-
interimSpace
child
.
height
=
parent
.
bounds
.
height
-
contentInset
.
top
-
contentInset
.
bottom
-
layoutInset
.
top
-
layoutInset
.
bottom
n
+=
c
+
co
-
1
...
...
@@ -243,21 +241,24 @@ public class Grid {
n
+=
r
+
ro
-
1
case
.
none
:
let
w
=
(
parent
.
bounds
.
width
-
contentInset
.
left
-
contentInset
.
right
-
layoutInset
.
left
-
layoutInset
.
right
+
interimSpace
)
/
CGFloat
(
gc
)
let
c
=
child
.
grid
.
columns
let
co
=
child
.
grid
.
offset
.
columns
let
h
=
(
parent
.
bounds
.
height
-
contentInset
.
top
-
contentInset
.
bottom
-
layoutInset
.
top
-
layoutInset
.
bottom
+
interimSpace
)
/
CGFloat
(
gr
)
var
w
=
(
parent
.
bounds
.
width
-
contentInset
.
left
-
contentInset
.
right
-
layoutInset
.
left
-
layoutInset
.
right
+
interimSpace
)
/
CGFloat
(
gc
)
var
h
=
(
parent
.
bounds
.
height
-
contentInset
.
top
-
contentInset
.
bottom
-
layoutInset
.
top
-
layoutInset
.
bottom
+
interimSpace
)
/
CGFloat
(
gr
)
let
r
=
child
.
grid
.
rows
let
ro
=
child
.
grid
.
offset
.
rows
let
vt
=
CGFloat
(
ro
)
*
h
+
contentInset
.
top
+
layoutInset
.
top
let
vl
=
CGFloat
(
co
)
*
w
+
contentInset
.
left
+
layoutInset
.
left
let
vh
=
h
*
CGFloat
(
r
)
-
interimSpace
let
vw
=
w
*
CGFloat
(
c
)
-
interimSpace
let
x
=
CGFloat
(
co
)
*
w
+
contentInset
.
left
+
layoutInset
.
left
let
y
=
CGFloat
(
ro
)
*
h
+
contentInset
.
top
+
layoutInset
.
top
child
.
x
=
vl
child
.
y
=
vt
child
.
width
=
vw
child
.
height
=
vh
w
=
w
*
CGFloat
(
c
)
-
interimSpace
h
=
h
*
CGFloat
(
r
)
-
interimSpace
child
.
x
=
x
child
.
y
=
y
child
.
width
=
w
child
.
height
=
h
}
}
}
...
...
@@ -269,7 +270,7 @@ public class Grid {
private
var
GridKey
:
UInt8
=
0
/// Grid extension for UIView.
public
extension
UIView
{
extension
UIView
{
/// Grid reference.
public
private(set)
var
grid
:
Grid
{
get
{
...
...
Sources/iOS/IconButton.swift
View file @
be05fff0
...
...
@@ -42,5 +42,7 @@ public class IconButton: Button {
super
.
prepareView
()
cornerRadiusPreset
=
.
cornerRadius1
pulseAnimation
=
.
center
shapePreset
=
.
circle
contentEdgeInsetsPreset
=
.
none
}
}
Sources/iOS/KeyframeAnimation.swift
View file @
be05fff0
...
...
@@ -51,7 +51,7 @@ public func AnimationRotationModeToValue(mode: AnimationRotationMode) -> String?
}
}
public
extension
Animation
{
extension
Animation
{
/**
:name: path
*/
...
...
Sources/iOS/Layout.swift
View file @
be05fff0
...
...
@@ -593,7 +593,7 @@ public class Layout {
}
/// Layout
public
extension
Layout
{
extension
Layout
{
/**
Sets the width of a view.
- Parameter parent: A parent UIView context.
...
...
@@ -900,7 +900,7 @@ public extension Layout {
private
var
LayoutKey
:
UInt8
=
0
/// Layout extension for UIView.
public
extension
UIView
{
extension
UIView
{
/// Layout reference.
public
private(set)
var
layout
:
Layout
{
get
{
...
...
Sources/iOS/Material+Array.swift
View file @
be05fff0
...
...
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
public
extension
Array
where
Element
:
Equatable
{
extension
Array
where
Element
:
Equatable
{
/**
Slices a out a segment of an array based on the start
and end positions.
...
...
Sources/iOS/Material+String.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
String
{
extension
String
{
/**
:name: lines
*/
...
...
Sources/iOS/Material+UIFont.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIFont
{
extension
UIFont
{
/**
:name: stringSize
*/
...
...
Sources/iOS/Material+UIView.swift
View file @
be05fff0
...
...
@@ -69,22 +69,7 @@ public class Material {
}
/// A preset property to set the shape.
public
var
shapePreset
:
ShapePreset
=
.
none
{
didSet
{
guard
let
v
=
view
else
{
return
}
if
.
none
!=
shapePreset
{
if
v
.
width
<
v
.
height
{
v
.
frame
.
size
.
width
=
v
.
height
}
else
{
v
.
frame
.
size
.
height
=
v
.
width
}
v
.
layoutShadowPath
()
}
}
}
public
var
shapePreset
:
ShapePreset
=
.
none
/// A preset value for Depth.
public
var
depthPreset
:
DepthPreset
{
...
...
@@ -111,7 +96,7 @@ public class Material {
}
/// Enables automatic shadowPath sizing.
public
var
isShadowPathAutoSizing
:
Bool
=
tru
e
{
public
var
isShadowPathAutoSizing
:
Bool
=
fals
e
{
didSet
{
if
isShadowPathAutoSizing
{
view
?
.
layoutShadowPath
()
...
...
@@ -124,7 +109,7 @@ public class Material {
private
var
MaterialKey
:
UInt8
=
0
/// Grid extension for UIView.
public
extension
UIView
{
extension
UIView
{
/// Material Reference.
internal
var
material
:
Material
{
get
{
...
...
@@ -145,6 +130,8 @@ public extension UIView {
}
set
(
value
)
{
layer
.
frame
.
origin
.
x
=
value
layoutShadowPath
()
}
}
...
...
@@ -156,6 +143,8 @@ public extension UIView {
}
set
(
value
)
{
layer
.
frame
.
origin
.
y
=
value
layoutShadowPath
()
}
}
...
...
@@ -167,9 +156,9 @@ public extension UIView {
}
set
(
value
)
{
layer
.
frame
.
size
.
width
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
height
=
value
}
layoutShape
()
layoutShadowPath
()
}
}
...
...
@@ -181,9 +170,9 @@ public extension UIView {
}
set
(
value
)
{
layer
.
frame
.
size
.
height
=
value
if
.
none
!=
shapePreset
{
layer
.
frame
.
size
.
width
=
value
}
layoutShape
()
layoutShadowPath
()
}
}
...
...
@@ -198,6 +187,7 @@ public extension UIView {
}
set
(
value
)
{
material
.
shapePreset
=
value
layoutShape
()
layoutShadowPath
()
}
...
...
@@ -291,9 +281,11 @@ public extension UIView {
}
set
(
value
)
{
layer
.
cornerRadius
=
value
layoutShadowPath
()
if
.
circle
==
shapePreset
{
shapePreset
=
.
none
}
else
{
layoutShadowPath
()
}
}
}
...
...
@@ -400,17 +392,17 @@ public extension UIView {
/// Manages the layout for the shape of the view instance.
public
func
layoutShape
()
{
if
.
circle
=
=
shapePreset
{
if
.
none
!
=
shapePreset
{
if
width
<
height
{
width
=
height
}
else
{
height
=
width
}
let
r
=
width
/
2
if
r
!=
cornerRadius
{
cornerRadius
=
r
layer
.
frame
.
size
.
width
=
height
}
else
if
width
>
height
{
layer
.
frame
.
size
.
height
=
width
}
}
if
.
circle
==
shapePreset
{
layer
.
cornerRadius
=
width
/
2
}
}
/// Sets the shadow path.
...
...
Sources/iOS/Material+UIWindow.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIWindow
{
extension
UIWindow
{
/**
Captures a screenshot of the contents in the apps keyWindow.
- Returns: An optional UIImage.
...
...
Sources/iOS/MenuController.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIViewController
{
extension
UIViewController
{
/**
A convenience property that provides access to the MenuController.
This is the recommended method of accessing the MenuController
...
...
Sources/iOS/NavigationBar.swift
View file @
be05fff0
...
...
@@ -38,7 +38,7 @@ public enum NavigationBarStyle: Int {
case
Medium
}
public
extension
UINavigationBar
{
extension
UINavigationBar
{
/// Device status bar style.
public
var
statusBarStyle
:
UIStatusBarStyle
{
get
{
...
...
Sources/iOS/NavigationDrawerController.swift
View file @
be05fff0
...
...
@@ -36,7 +36,7 @@ public enum NavigationDrawerPosition: Int {
case
right
}
public
extension
UIViewController
{
extension
UIViewController
{
/**
A convenience property that provides access to the NavigationDrawerController.
This is the recommended method of accessing the NavigationDrawerController
...
...
Sources/iOS/NavigationItem.swift
View file @
be05fff0
...
...
@@ -87,7 +87,7 @@ public class MaterialAssociatedObjectNavigationItem {
}
}
public
extension
UINavigationItem
{
extension
UINavigationItem
{
/// NavigationItem reference.
public
internal(set)
var
item
:
MaterialAssociatedObjectNavigationItem
{
get
{
...
...
Sources/iOS/Offset.swift
View file @
be05fff0
...
...
@@ -32,14 +32,14 @@ import UIKit
public
typealias
Offset
=
UIOffset
public
extension
CGSize
{
extension
CGSize
{
/// Returns an Offset version of the CGSize.
public
var
asOffset
:
Offset
{
return
Offset
(
size
:
self
)
}
}
public
extension
Offset
{
extension
Offset
{
/**
Initializer that accepts a CGSize value.
- Parameter size: A CGSize value.
...
...
@@ -49,7 +49,7 @@ public extension Offset {
}
}
public
extension
Offset
{
extension
Offset
{
/// Returns a CGSize version of the Offset.
public
var
asSize
:
CGSize
{
return
CGSize
(
width
:
horizontal
,
height
:
vertical
)
...
...
Sources/iOS/SearchBarController.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIViewController
{
extension
UIViewController
{
/**
A convenience property that provides access to the SearchBarController.
This is the recommended method of accessing the SearchBarController
...
...
Sources/iOS/StatusBarController.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIViewController
{
extension
UIViewController
{
/**
A convenience property that provides access to the StatusBarController.
This is the recommended method of accessing the StatusBarController
...
...
Sources/iOS/ToolbarController.swift
View file @
be05fff0
...
...
@@ -30,7 +30,7 @@
import
UIKit
public
extension
UIViewController
{
extension
UIViewController
{
/**
A convenience property that provides access to the ToolbarController.
This is the recommended method of accessing the ToolbarController
...
...
Sources/iOS/TransitionAnimation.swift
View file @
be05fff0
...
...
@@ -81,7 +81,7 @@ public func AnimationTransitionSubTypeToValue(direction: AnimationTransitionSubT
}
}
public
extension
Animation
{
extension
Animation
{
/**
:name: transition
*/
...
...
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