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
17269950
Unverified
Commit
17269950
authored
Nov 10, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
editor: moved Divider and Grid to struct types
parent
085dacdb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
30 deletions
+27
-30
Material.xcodeproj/project.pbxproj
+6
-6
Sources/iOS/Depth.swift
+2
-2
Sources/iOS/Divider.swift
+7
-7
Sources/iOS/Editor.swift
+7
-10
Sources/iOS/Gravity.swift
+0
-0
Sources/iOS/Grid.swift
+5
-5
No files found.
Material.xcodeproj/project.pbxproj
View file @
17269950
...
...
@@ -31,7 +31,7 @@
965E80DB1DD4C50600D61E4B
/* InterimSpace.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7871CB40DC500C806FE
/* InterimSpace.swift */
;
};
965E80DC1DD4C50600D61E4B
/* Depth.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7781CB40DC500C806FE
/* Depth.swift */
;
};
965E80DD1DD4C50600D61E4B
/* EdgeInsets.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77A1CB40DC500C806FE
/* EdgeInsets.swift */
;
};
965E80DE1DD4C50600D61E4B
/*
MaterialGravity.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77C1CB40DC500C806FE
/* Material
Gravity.swift */
;
};
965E80DE1DD4C50600D61E4B
/*
Gravity.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77C1CB40DC500C806FE
/*
Gravity.swift */
;
};
965E80DF1DD4C50600D61E4B
/* CornerRadius.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7851CB40DC500C806FE
/* CornerRadius.swift */
;
};
965E80E01DD4C50600D61E4B
/* Shape.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7861CB40DC500C806FE
/* Shape.swift */
;
};
965E80E11DD4C50600D61E4B
/* Offset.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
968C99461D377849000074FF
/* Offset.swift */
;
};
...
...
@@ -162,7 +162,7 @@
96BCB84E1CB4115200C806FE
/* InterimSpace.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7871CB40DC500C806FE
/* InterimSpace.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB84F1CB4115200C806FE
/* Depth.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7781CB40DC500C806FE
/* Depth.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8501CB4115200C806FE
/* EdgeInsets.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77A1CB40DC500C806FE
/* EdgeInsets.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8511CB4115200C806FE
/*
MaterialGravity.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77C1CB40DC500C806FE
/* Material
Gravity.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8511CB4115200C806FE
/*
Gravity.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB77C1CB40DC500C806FE
/*
Gravity.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8521CB4115200C806FE
/* CornerRadius.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7851CB40DC500C806FE
/* CornerRadius.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8531CB4115200C806FE
/* Shape.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7861CB40DC500C806FE
/* Shape.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
96BCB8551CB4115200C806FE
/* PulseView.swift in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96BCB7841CB40DC500C806FE
/* PulseView.swift */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -253,7 +253,7 @@
96BCB7791CB40DC500C806FE
/* Device.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Device.swift
;
sourceTree
=
"<group>"
;
};
96BCB77A1CB40DC500C806FE
/* EdgeInsets.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
EdgeInsets.swift
;
sourceTree
=
"<group>"
;
};
96BCB77B1CB40DC500C806FE
/* Font.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Font.swift
;
sourceTree
=
"<group>"
;
};
96BCB77C1CB40DC500C806FE
/*
MaterialGravity.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Material
Gravity.swift
;
sourceTree
=
"<group>"
;
};
96BCB77C1CB40DC500C806FE
/*
Gravity.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Gravity.swift
;
sourceTree
=
"<group>"
;
};
96BCB77D1CB40DC500C806FE
/* Icon.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Icon.swift
;
sourceTree
=
"<group>"
;
};
96BCB77E1CB40DC500C806FE
/* MotionKeyframe.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
MotionKeyframe.swift
;
sourceTree
=
"<group>"
;
};
96BCB7801CB40DC500C806FE
/* Layer.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Layer.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -684,7 +684,7 @@
96BCB7871CB40DC500C806FE
/* InterimSpace.swift */
,
96BCB7781CB40DC500C806FE
/* Depth.swift */
,
96BCB77A1CB40DC500C806FE
/* EdgeInsets.swift */
,
96BCB77C1CB40DC500C806FE
/*
Material
Gravity.swift */
,
96BCB77C1CB40DC500C806FE
/* Gravity.swift */
,
96BCB7851CB40DC500C806FE
/* CornerRadius.swift */
,
96BCB7861CB40DC500C806FE
/* Shape.swift */
,
968C99461D377849000074FF
/* Offset.swift */
,
...
...
@@ -836,7 +836,7 @@
96BCB84E1CB4115200C806FE
/* InterimSpace.swift in Headers */
,
96BCB84F1CB4115200C806FE
/* Depth.swift in Headers */
,
96BCB8501CB4115200C806FE
/* EdgeInsets.swift in Headers */
,
96BCB8511CB4115200C806FE
/*
Material
Gravity.swift in Headers */
,
96BCB8511CB4115200C806FE
/* Gravity.swift in Headers */
,
96BCB8521CB4115200C806FE
/* CornerRadius.swift in Headers */
,
96BCB8531CB4115200C806FE
/* Shape.swift in Headers */
,
96BCB8551CB4115200C806FE
/* PulseView.swift in Headers */
,
...
...
@@ -1127,7 +1127,7 @@
965E80DB1DD4C50600D61E4B
/* InterimSpace.swift in Sources */
,
965E80DC1DD4C50600D61E4B
/* Depth.swift in Sources */
,
965E80DD1DD4C50600D61E4B
/* EdgeInsets.swift in Sources */
,
965E80DE1DD4C50600D61E4B
/*
Material
Gravity.swift in Sources */
,
965E80DE1DD4C50600D61E4B
/* Gravity.swift in Sources */
,
965E80DF1DD4C50600D61E4B
/* CornerRadius.swift in Sources */
,
965E80FB1DD4D59500D61E4B
/* SearchBar.swift in Sources */
,
965E80E01DD4C50600D61E4B
/* Shape.swift in Sources */
,
...
...
Sources/iOS/Depth.swift
View file @
17269950
...
...
@@ -51,7 +51,7 @@ public struct Depth {
public
var
radius
:
CGFloat
/// Preset.
public
var
preset
:
DepthPreset
=
.
none
{
public
var
preset
=
DepthPreset
.
none
{
didSet
{
let
depth
=
DepthPresetToValue
(
preset
:
preset
)
offset
=
depth
.
offset
...
...
@@ -66,7 +66,7 @@ public struct Depth {
- Parameter opacity: Float.
- Parameter radius: CGFloat.
*/
public
init
(
offset
:
Offset
=
Offset
.
zero
,
opacity
:
Float
=
0
,
radius
:
CGFloat
=
0
)
{
public
init
(
offset
:
Offset
=
.
zero
,
opacity
:
Float
=
0
,
radius
:
CGFloat
=
0
)
{
self
.
offset
=
offset
self
.
opacity
=
opacity
self
.
radius
=
radius
...
...
Sources/iOS/Divider.swift
View file @
17269950
...
...
@@ -38,7 +38,7 @@ public enum DividerAlignment: Int {
case
right
}
open
class
Divider
{
public
struct
Divider
{
/// A reference to the UIView.
internal
weak
var
view
:
UIView
?
...
...
@@ -46,28 +46,28 @@ open class Divider {
internal
var
line
:
UIView
?
/// A reference to the height.
open
var
thickness
:
CGFloat
{
public
var
thickness
:
CGFloat
{
didSet
{
reload
()
}
}
/// A preset wrapper around contentEdgeInsets.
open
var
contentEdgeInsetsPreset
=
EdgeInsetsPreset
.
none
{
public
var
contentEdgeInsetsPreset
=
EdgeInsetsPreset
.
none
{
didSet
{
contentEdgeInsets
=
EdgeInsetsPresetToValue
(
preset
:
contentEdgeInsetsPreset
)
}
}
/// A reference to EdgeInsets.
open
var
contentEdgeInsets
=
EdgeInsets
.
zero
{
public
var
contentEdgeInsets
=
EdgeInsets
.
zero
{
didSet
{
reload
()
}
}
/// A UIColor.
open
var
color
:
UIColor
?
{
public
var
color
:
UIColor
?
{
get
{
return
line
?
.
backgroundColor
}
...
...
@@ -88,7 +88,7 @@ open class Divider {
}
/// A reference to the dividerAlignment.
open
var
alignment
=
DividerAlignment
.
bottom
{
public
var
alignment
=
DividerAlignment
.
bottom
{
didSet
{
reload
()
}
...
...
@@ -105,7 +105,7 @@ open class Divider {
}
/// Lays out the divider.
open
func
reload
()
{
public
func
reload
()
{
guard
let
l
=
line
,
let
v
=
view
else
{
return
}
...
...
Sources/iOS/Editor.swift
View file @
17269950
...
...
@@ -128,12 +128,11 @@ public protocol EditorDelegate {
- Parameter in characterRange: A Range.
- Returns: A boolean indicating if the textView should interact with a URL in
a given character range, true if yes, false otherwise.
*/
@available(iOS, introduced: 8.0,
obsole
ted: 10.0)
@available(iOS, introduced: 8.0,
depreca
ted: 10.0)
@objc
optional func editor(editor: Editor, textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool
/**
A delegation method that is executed when the textView should interact with
a text attachment in a given character range.
- Parameter editor: An Editor.
...
...
@@ -142,12 +141,10 @@ public protocol EditorDelegate {
- Parameter in characterRange: A Range.
- Returns: A boolean indicating if the textView should interact with a
NSTextAttachment in a given character range, true if yes, false otherwise.
*/
@available(iOS, introduced: 8.0, obsoleted: 10.0)
@available(iOS, introduced: 8.0, deprecated: 10.0)
@objc
optional func editor(editor: Editor, textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange) -> Bool
/**
A delegation method that is executed when the textView should interact with
a URL in a given character range.
- Parameter editor: An Editor.
...
...
@@ -157,12 +154,10 @@ public protocol EditorDelegate {
- Parameter interaction: A UITextItemInteraction.
- Returns: A boolean indicating if the textView should interact with a URL in
a given character range, true if yes, false otherwise.
*/
@available(iOS 10.0, *)
@objc
optional func editor(editor: Editor, textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool
/**
A delegation method that is executed when the textView should interact with
a text attachment in a given character range.
- Parameter editor: An Editor.
...
...
@@ -172,10 +167,10 @@ public protocol EditorDelegate {
- Parameter interaction: A UITextItemInteraction.
- Returns: A boolean indicating if the textView should interact with a
NSTextAttachment in a given character range, true if yes, false otherwise.
*/
@available(iOS 10.0, *)
@objc
optional func editor(editor: Editor, textView: UITextView, shouldInteractWith textAttachment: NSTextAttachment, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool
*/
}
open
class
Editor
:
View
{
...
...
@@ -347,7 +342,8 @@ extension Editor: TextViewDelegate {
}
}
@available(iOS, introduced: 8.0, obsoleted: 10.0)
/*
@available(iOS, introduced: 8.0, deprecated: : 10.0)
extension Editor {
open func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool {
return delegate?.editor?(editor: self, textView: textView, shouldInteractWith: URL, in: characterRange) ?? true
...
...
@@ -368,3 +364,4 @@ extension Editor {
return delegate?.editor?(editor: self, textView: textView, shouldInteractWith: textAttachment, in: characterRange, interaction: interaction) ?? true
}
}
*/
Sources/iOS/
Material
Gravity.swift
→
Sources/iOS/Gravity.swift
View file @
17269950
File moved
Sources/iOS/Grid.swift
View file @
17269950
...
...
@@ -76,7 +76,7 @@ public struct GridOffset {
}
}
public
class
Grid
{
public
struct
Grid
{
/// Defer the calculation.
public
var
deferred
=
false
...
...
@@ -169,7 +169,7 @@ public class Grid {
- Parameter columns: The number of columns, horizontal axis the grid will use.
- Parameter interimSpace: The interim space between rows or columns.
*/
public
init
(
context
:
UIView
?,
rows
:
Int
=
0
,
columns
:
Int
=
0
,
interimSpace
:
InterimSpace
=
0
)
{
internal
init
(
context
:
UIView
?,
rows
:
Int
=
0
,
columns
:
Int
=
0
,
interimSpace
:
InterimSpace
=
0
)
{
self
.
context
=
context
self
.
rows
=
rows
self
.
columns
=
columns
...
...
@@ -177,12 +177,12 @@ public class Grid {
}
/// Begins a deferred block.
public
func
begin
()
{
mutating
public
func
begin
()
{
deferred
=
true
}
/// Completes a deferred block.
public
func
commit
()
{
mutating
public
func
commit
()
{
deferred
=
false
reload
()
}
...
...
@@ -269,7 +269,7 @@ private var GridKey: UInt8 = 0
/// Grid extension for UIView.
extension
UIView
{
/// Grid reference.
public
fileprivate
(
set
)
var
grid
:
Grid
{
public
var
grid
:
Grid
{
get
{
return
AssociatedObject
(
base
:
self
,
key
:
&
GridKey
)
{
return
Grid
(
context
:
self
)
...
...
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