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
c3ff9361
Commit
c3ff9361
authored
Sep 14, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial phase to Swift 4 complete
parent
3130a55c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
126 additions
and
54 deletions
+126
-54
Material.xcodeproj/project.pbxproj
+20
-4
Material.xcodeproj/xcshareddata/xcschemes/Material.xcscheme
+3
-1
Sources/Frameworks/Motion/Sources/Motion.swift
+18
-11
Sources/Frameworks/Motion/Sources/MotionAnimation.swift
+20
-0
Sources/Frameworks/Motion/Sources/MotionController.swift
+4
-0
Sources/Frameworks/Motion/Sources/MotionTransition.swift
+20
-0
Sources/iOS/CharacterAttribute.swift
+23
-23
Sources/iOS/Font.swift
+1
-1
Sources/iOS/Material+UIFont.swift
+1
-1
Sources/iOS/Material+UIView.swift
+2
-0
Sources/iOS/SearchBar.swift
+2
-2
Sources/iOS/SnackbarController.swift
+1
-1
Sources/iOS/TabBar.swift
+5
-5
Sources/iOS/TabsController.swift
+1
-1
Sources/iOS/TextStorage.swift
+4
-4
Sources/iOS/TransitionController.swift
+1
-0
No files found.
Material.xcodeproj/project.pbxproj
View file @
c3ff9361
...
@@ -1036,14 +1036,14 @@
...
@@ -1036,14 +1036,14 @@
attributes
=
{
attributes
=
{
LastSwiftMigration
=
0710
;
LastSwiftMigration
=
0710
;
LastSwiftUpdateCheck
=
0730
;
LastSwiftUpdateCheck
=
0730
;
LastUpgradeCheck
=
0
8
00
;
LastUpgradeCheck
=
0
9
00
;
ORGANIZATIONNAME
=
"CosmicMind, Inc."
;
ORGANIZATIONNAME
=
"CosmicMind, Inc."
;
TargetAttributes
=
{
TargetAttributes
=
{
963832351B88DFD80015F710
=
{
963832351B88DFD80015F710
=
{
CreatedOnToolsVersion
=
6.4
;
CreatedOnToolsVersion
=
6.4
;
DevelopmentTeam
=
9Z76XCNLGL
;
DevelopmentTeam
=
9Z76XCNLGL
;
DevelopmentTeamName
=
"CosmicMind Inc."
;
DevelopmentTeamName
=
"CosmicMind Inc."
;
LastSwiftMigration
=
0
8
00
;
LastSwiftMigration
=
0
9
00
;
ProvisioningStyle
=
Manual
;
ProvisioningStyle
=
Manual
;
};
};
};
};
...
@@ -1215,14 +1215,20 @@
...
@@ -1215,14 +1215,20 @@
CLANG_CXX_LIBRARY
=
"libc++"
;
CLANG_CXX_LIBRARY
=
"libc++"
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_OBJC_ARC
=
YES
;
CLANG_ENABLE_OBJC_ARC
=
YES
;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
=
YES
;
CLANG_WARN_BOOL_CONVERSION
=
YES
;
CLANG_WARN_BOOL_CONVERSION
=
YES
;
CLANG_WARN_COMMA
=
YES
;
CLANG_WARN_CONSTANT_CONVERSION
=
YES
;
CLANG_WARN_CONSTANT_CONVERSION
=
YES
;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE
=
YES_ERROR
;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE
=
YES_ERROR
;
CLANG_WARN_EMPTY_BODY
=
YES
;
CLANG_WARN_EMPTY_BODY
=
YES
;
CLANG_WARN_ENUM_CONVERSION
=
YES
;
CLANG_WARN_ENUM_CONVERSION
=
YES
;
CLANG_WARN_INFINITE_RECURSION
=
YES
;
CLANG_WARN_INFINITE_RECURSION
=
YES
;
CLANG_WARN_INT_CONVERSION
=
YES
;
CLANG_WARN_INT_CONVERSION
=
YES
;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION
=
YES
;
CLANG_WARN_OBJC_LITERAL_CONVERSION
=
YES
;
CLANG_WARN_OBJC_ROOT_CLASS
=
YES_ERROR
;
CLANG_WARN_OBJC_ROOT_CLASS
=
YES_ERROR
;
CLANG_WARN_RANGE_LOOP_ANALYSIS
=
YES
;
CLANG_WARN_STRICT_PROTOTYPES
=
YES
;
CLANG_WARN_SUSPICIOUS_MOVE
=
YES
;
CLANG_WARN_SUSPICIOUS_MOVE
=
YES
;
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
...
@@ -1254,6 +1260,7 @@
...
@@ -1254,6 +1260,7 @@
PRODUCT_NAME
=
Material
;
PRODUCT_NAME
=
Material
;
SDKROOT
=
iphoneos
;
SDKROOT
=
iphoneos
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_SWIFT3_OBJC_INFERENCE
=
Default
;
SWIFT_VERSION
=
3.0
;
SWIFT_VERSION
=
3.0
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
...
@@ -1269,14 +1276,20 @@
...
@@ -1269,14 +1276,20 @@
CLANG_CXX_LIBRARY
=
"libc++"
;
CLANG_CXX_LIBRARY
=
"libc++"
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_OBJC_ARC
=
YES
;
CLANG_ENABLE_OBJC_ARC
=
YES
;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
=
YES
;
CLANG_WARN_BOOL_CONVERSION
=
YES
;
CLANG_WARN_BOOL_CONVERSION
=
YES
;
CLANG_WARN_COMMA
=
YES
;
CLANG_WARN_CONSTANT_CONVERSION
=
YES
;
CLANG_WARN_CONSTANT_CONVERSION
=
YES
;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE
=
YES_ERROR
;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE
=
YES_ERROR
;
CLANG_WARN_EMPTY_BODY
=
YES
;
CLANG_WARN_EMPTY_BODY
=
YES
;
CLANG_WARN_ENUM_CONVERSION
=
YES
;
CLANG_WARN_ENUM_CONVERSION
=
YES
;
CLANG_WARN_INFINITE_RECURSION
=
YES
;
CLANG_WARN_INFINITE_RECURSION
=
YES
;
CLANG_WARN_INT_CONVERSION
=
YES
;
CLANG_WARN_INT_CONVERSION
=
YES
;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION
=
YES
;
CLANG_WARN_OBJC_LITERAL_CONVERSION
=
YES
;
CLANG_WARN_OBJC_ROOT_CLASS
=
YES_ERROR
;
CLANG_WARN_OBJC_ROOT_CLASS
=
YES_ERROR
;
CLANG_WARN_RANGE_LOOP_ANALYSIS
=
YES
;
CLANG_WARN_STRICT_PROTOTYPES
=
YES
;
CLANG_WARN_SUSPICIOUS_MOVE
=
YES
;
CLANG_WARN_SUSPICIOUS_MOVE
=
YES
;
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN_UNREACHABLE_CODE
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
CLANG_WARN__DUPLICATE_METHOD_MATCH
=
YES
;
...
@@ -1300,6 +1313,7 @@
...
@@ -1300,6 +1313,7 @@
PRODUCT_NAME
=
Material
;
PRODUCT_NAME
=
Material
;
SDKROOT
=
iphoneos
;
SDKROOT
=
iphoneos
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Owholemodule"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Owholemodule"
;
SWIFT_SWIFT3_OBJC_INFERENCE
=
Default
;
SWIFT_VERSION
=
3.0
;
SWIFT_VERSION
=
3.0
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
VALIDATE_PRODUCT
=
YES
;
VALIDATE_PRODUCT
=
YES
;
...
@@ -1329,7 +1343,8 @@
...
@@ -1329,7 +1343,8 @@
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
""
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
3.0
;
SWIFT_SWIFT3_OBJC_INFERENCE
=
Off
;
SWIFT_VERSION
=
4.0
;
};
};
name
=
Debug
;
name
=
Debug
;
};
};
...
@@ -1354,7 +1369,8 @@
...
@@ -1354,7 +1369,8 @@
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
""
;
SKIP_INSTALL
=
YES
;
SKIP_INSTALL
=
YES
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Owholemodule"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Owholemodule"
;
SWIFT_VERSION
=
3.0
;
SWIFT_SWIFT3_OBJC_INFERENCE
=
Off
;
SWIFT_VERSION
=
4.0
;
};
};
name
=
Release
;
name
=
Release
;
};
};
...
...
Material.xcodeproj/xcshareddata/xcschemes/Material.xcscheme
View file @
c3ff9361
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
<Scheme
LastUpgradeVersion =
"0
83
0"
LastUpgradeVersion =
"0
90
0"
version =
"1.3"
>
version =
"1.3"
>
<BuildAction
<BuildAction
parallelizeBuildables =
"YES"
parallelizeBuildables =
"YES"
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
buildConfiguration =
"Debug"
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
<Testables>
<TestableReference
<TestableReference
...
@@ -55,6 +56,7 @@
...
@@ -55,6 +56,7 @@
buildConfiguration =
"Debug"
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
...
...
Sources/Frameworks/Motion/Sources/Motion.swift
View file @
c3ff9361
...
@@ -770,21 +770,28 @@ extension Motion: UITabBarControllerDelegate {
...
@@ -770,21 +770,28 @@ extension Motion: UITabBarControllerDelegate {
}
}
}
}
public
typealias
Motion
Delay
CancelBlock
=
(
Bool
)
->
Void
public
typealias
MotionCancelBlock
=
(
Bool
)
->
Void
extension
Motion
{
extension
Motion
{
/**
/**
Executes a block of code asynchronously on the main thread.
- Parameter execute: A block that is executed asynchronously on the main thread.
*/
public
class
func
async
(
_
execute
:
@escaping
()
->
Void
)
{
Motion
.
delay
(
0
,
execute
:
execute
)
}
/**
Executes a block of code after a time delay.
Executes a block of code after a time delay.
- Parameter duration: An animation duration time.
- Parameter _ time: A delay time.
- Parameter animations: An animation block.
- Parameter execute: A block that is executed once delay has passed.
- Parameter execute block: A completion block that is executed once
- Returns: An optional MotionCancelBlock.
the animations have completed.
*/
*/
@discardableResult
@discardableResult
public
class
func
delay
(
_
time
:
TimeInterval
,
execute
:
@escaping
()
->
Void
)
->
Motion
Delay
CancelBlock
?
{
public
class
func
delay
(
_
time
:
TimeInterval
,
execute
:
@escaping
()
->
Void
)
->
MotionCancelBlock
?
{
var
cancelable
:
Motion
Delay
CancelBlock
?
var
cancelable
:
MotionCancelBlock
?
let
delayed
:
Motion
Delay
CancelBlock
=
{
let
delayed
:
MotionCancelBlock
=
{
if
!
$0
{
if
!
$0
{
DispatchQueue
.
main
.
async
(
execute
:
execute
)
DispatchQueue
.
main
.
async
(
execute
:
execute
)
}
}
...
@@ -802,10 +809,10 @@ extension Motion {
...
@@ -802,10 +809,10 @@ extension Motion {
}
}
/**
/**
Cancels the delayed Motion
Delay
CancelBlock.
Cancels the delayed MotionCancelBlock.
- Parameter delayed completion: An Motion
Delay
CancelBlock.
- Parameter delayed completion: An MotionCancelBlock.
*/
*/
public
class
func
cancel
(
delayed
completion
:
Motion
Delay
CancelBlock
)
{
public
class
func
cancel
(
delayed
completion
:
MotionCancelBlock
)
{
completion
(
true
)
completion
(
true
)
}
}
...
...
Sources/Frameworks/Motion/Sources/MotionAnimation.swift
View file @
c3ff9361
...
@@ -227,6 +227,16 @@ public extension MotionAnimation {
...
@@ -227,6 +227,16 @@ public extension MotionAnimation {
}
}
}
}
/**
Animates a view's current position to the given x and y values.
- Parameter x: A CGloat.
- Parameter y: A CGloat.
- Returns: A MotionAnimation.
*/
static
func
position
(
x
:
CGFloat
,
y
:
CGFloat
)
->
MotionAnimation
{
return
.
position
(
CGPoint
(
x
:
x
,
y
:
y
))
}
/// Fades the view in during an animation.
/// Fades the view in during an animation.
static
var
fadeIn
=
MotionAnimation
.
fade
(
1
)
static
var
fadeIn
=
MotionAnimation
.
fade
(
1
)
...
@@ -267,6 +277,16 @@ public extension MotionAnimation {
...
@@ -267,6 +277,16 @@ public extension MotionAnimation {
}
}
/**
/**
Animates the view's current size to the given width and height.
- Parameter width: A CGFloat.
- Parameter height: A CGFloat.
- Returns: A MotionAnimation.
*/
static
func
size
(
width
:
CGFloat
,
height
:
CGFloat
)
->
MotionAnimation
{
return
.
size
(
CGSize
(
width
:
width
,
height
:
height
))
}
/**
Animates a view's current shadow path to the given one.
Animates a view's current shadow path to the given one.
- Parameter path: A CGPath.
- Parameter path: A CGPath.
- Returns: A MotionAnimation.
- Returns: A MotionAnimation.
...
...
Sources/Frameworks/Motion/Sources/MotionController.swift
View file @
c3ff9361
...
@@ -310,6 +310,7 @@ internal extension MotionController {
...
@@ -310,6 +310,7 @@ internal extension MotionController {
Subclasses should call context.set(fromViews: toViews) after
Subclasses should call context.set(fromViews: toViews) after
inserting fromViews & toViews into the container
inserting fromViews & toViews into the container
*/
*/
@objc
func
prepareTransition
()
{
func
prepareTransition
()
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
return
return
...
@@ -323,6 +324,7 @@ internal extension MotionController {
...
@@ -323,6 +324,7 @@ internal extension MotionController {
}
}
/// Prepares the transition fromView & toView pairs.
/// Prepares the transition fromView & toView pairs.
@objc
func
prepareTransitionPairs
()
{
func
prepareTransitionPairs
()
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
return
return
...
@@ -358,6 +360,7 @@ internal extension MotionController {
...
@@ -358,6 +360,7 @@ internal extension MotionController {
Animates the views. Subclasses should call `prepareTransition` &
Animates the views. Subclasses should call `prepareTransition` &
`prepareTransitionPairs` before calling `animate`.
`prepareTransitionPairs` before calling `animate`.
*/
*/
@objc
func
animate
()
{
func
animate
()
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
return
return
...
@@ -424,6 +427,7 @@ internal extension MotionController {
...
@@ -424,6 +427,7 @@ internal extension MotionController {
- Parameter isFinished: A Boolean indicating if the transition
- Parameter isFinished: A Boolean indicating if the transition
has completed.
has completed.
*/
*/
@objc
func
complete
(
isFinished
:
Bool
)
{
func
complete
(
isFinished
:
Bool
)
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
return
return
...
...
Sources/Frameworks/Motion/Sources/MotionTransition.swift
View file @
c3ff9361
...
@@ -234,6 +234,16 @@ public extension MotionTransition {
...
@@ -234,6 +234,16 @@ public extension MotionTransition {
}
}
}
}
/**
Animates a view's current position to the given x and y values.
- Parameter x: A CGloat.
- Parameter y: A CGloat.
- Returns: A MotionTransition.
*/
static
func
position
(
x
:
CGFloat
,
y
:
CGFloat
)
->
MotionTransition
{
return
.
position
(
CGPoint
(
x
:
x
,
y
:
y
))
}
/// Forces the view to not fade during a transition.
/// Forces the view to not fade during a transition.
static
var
forceNonFade
=
MotionTransition
{
static
var
forceNonFade
=
MotionTransition
{
$0
.
nonFade
=
true
$0
.
nonFade
=
true
...
@@ -279,6 +289,16 @@ public extension MotionTransition {
...
@@ -279,6 +289,16 @@ public extension MotionTransition {
}
}
/**
/**
Animates the view's current size to the given width and height.
- Parameter width: A CGFloat.
- Parameter height: A CGFloat.
- Returns: A MotionTransition.
*/
static
func
size
(
width
:
CGFloat
,
height
:
CGFloat
)
->
MotionTransition
{
return
.
size
(
CGSize
(
width
:
width
,
height
:
height
))
}
/**
Animates the view's current shadow path to the given one.
Animates the view's current shadow path to the given one.
- Parameter path: A CGPath.
- Parameter path: A CGPath.
- Returns: A MotionTransition.
- Returns: A MotionTransition.
...
...
Sources/iOS/CharacterAttribute.swift
View file @
c3ff9361
...
@@ -57,47 +57,47 @@ public enum CharacterAttribute: String {
...
@@ -57,47 +57,47 @@ public enum CharacterAttribute: String {
public
func
CharacterAttributeToValue
(
attribute
:
CharacterAttribute
)
->
String
{
public
func
CharacterAttributeToValue
(
attribute
:
CharacterAttribute
)
->
String
{
switch
attribute
{
switch
attribute
{
case
.
font
:
case
.
font
:
return
NS
FontAttributeNam
e
return
NS
AttributedStringKey
.
font
.
rawValu
e
case
.
paragraphStyle
:
case
.
paragraphStyle
:
return
NS
ParagraphStyleAttributeNam
e
return
NS
AttributedStringKey
.
paragraphStyle
.
rawValu
e
case
.
forgroundColor
:
case
.
forgroundColor
:
return
NS
ForegroundColorAttributeNam
e
return
NS
AttributedStringKey
.
foregroundColor
.
rawValu
e
case
.
backgroundColor
:
case
.
backgroundColor
:
return
NS
BackgroundColorAttributeNam
e
return
NS
AttributedStringKey
.
backgroundColor
.
rawValu
e
case
.
ligature
:
case
.
ligature
:
return
NS
LigatureAttributeNam
e
return
NS
AttributedStringKey
.
ligature
.
rawValu
e
case
.
kern
:
case
.
kern
:
return
NS
KernAttributeNam
e
return
NS
AttributedStringKey
.
kern
.
rawValu
e
case
.
strikethroughStyle
:
case
.
strikethroughStyle
:
return
NS
StrikethroughStyleAttributeNam
e
return
NS
AttributedStringKey
.
strikethroughStyle
.
rawValu
e
case
.
underlineStyle
:
case
.
underlineStyle
:
return
NS
UnderlineStyleAttributeNam
e
return
NS
AttributedStringKey
.
underlineStyle
.
rawValu
e
case
.
strokeColor
:
case
.
strokeColor
:
return
NS
StrokeColorAttributeNam
e
return
NS
AttributedStringKey
.
strokeColor
.
rawValu
e
case
.
strokeWidth
:
case
.
strokeWidth
:
return
NS
StrokeWidthAttributeNam
e
return
NS
AttributedStringKey
.
strokeWidth
.
rawValu
e
case
.
shadow
:
case
.
shadow
:
return
NS
ShadowAttributeNam
e
return
NS
AttributedStringKey
.
shadow
.
rawValu
e
case
.
textEffect
:
case
.
textEffect
:
return
NS
TextEffectAttributeNam
e
return
NS
AttributedStringKey
.
textEffect
.
rawValu
e
case
.
attachment
:
case
.
attachment
:
return
NSAtt
achmentAttributeNam
e
return
NSAtt
ributedStringKey
.
attachment
.
rawValu
e
case
.
link
:
case
.
link
:
return
NS
LinkAttributeNam
e
return
NS
AttributedStringKey
.
link
.
rawValu
e
case
.
baselineOffset
:
case
.
baselineOffset
:
return
NS
BaselineOffsetAttributeNam
e
return
NS
AttributedStringKey
.
baselineOffset
.
rawValu
e
case
.
underlineColor
:
case
.
underlineColor
:
return
NS
UnderlineColorAttributeNam
e
return
NS
AttributedStringKey
.
underlineColor
.
rawValu
e
case
.
strikethroughColor
:
case
.
strikethroughColor
:
return
NS
StrikethroughColorAttributeNam
e
return
NS
AttributedStringKey
.
strikethroughColor
.
rawValu
e
case
.
obliqueness
:
case
.
obliqueness
:
return
NS
ObliquenessAttributeNam
e
return
NS
AttributedStringKey
.
obliqueness
.
rawValu
e
case
.
expansion
:
case
.
expansion
:
return
NS
ExpansionAttributeNam
e
return
NS
AttributedStringKey
.
expansion
.
rawValu
e
case
.
writingDirection
:
case
.
writingDirection
:
return
NS
WritingDirectionAttributeNam
e
return
NS
AttributedStringKey
.
writingDirection
.
rawValu
e
case
.
verticalGlyphForm
:
case
.
verticalGlyphForm
:
return
NS
VerticalGlyphFormAttributeNam
e
return
NS
AttributedStringKey
.
verticalGlyphForm
.
rawValu
e
}
}
}
}
...
@@ -109,7 +109,7 @@ extension NSMutableAttributedString {
...
@@ -109,7 +109,7 @@ extension NSMutableAttributedString {
- Parameter range: A NSRange.
- Parameter range: A NSRange.
*/
*/
open
func
add
(
characterAttribute
:
CharacterAttribute
,
value
:
Any
,
range
:
NSRange
)
{
open
func
add
(
characterAttribute
:
CharacterAttribute
,
value
:
Any
,
range
:
NSRange
)
{
addAttribute
(
CharacterAttributeToValue
(
attribute
:
characterAttribute
),
value
:
value
,
range
:
range
)
addAttribute
(
NSAttributedStringKey
(
rawValue
:
CharacterAttributeToValue
(
attribute
:
characterAttribute
)
),
value
:
value
,
range
:
range
)
}
}
/**
/**
...
@@ -151,7 +151,7 @@ extension NSMutableAttributedString {
...
@@ -151,7 +151,7 @@ extension NSMutableAttributedString {
- Parameter range: A NSRange.
- Parameter range: A NSRange.
*/
*/
open
func
remove
(
characterAttribute
:
CharacterAttribute
,
range
:
NSRange
)
{
open
func
remove
(
characterAttribute
:
CharacterAttribute
,
range
:
NSRange
)
{
removeAttribute
(
CharacterAttributeToValue
(
attribute
:
characterAttribute
),
range
:
range
)
removeAttribute
(
NSAttributedStringKey
(
rawValue
:
CharacterAttributeToValue
(
attribute
:
characterAttribute
)
),
range
:
range
)
}
}
/**
/**
...
...
Sources/iOS/Font.swift
View file @
c3ff9361
...
@@ -94,7 +94,7 @@ private class FontLoader {
...
@@ -94,7 +94,7 @@ private class FontLoader {
let
font
=
CGFont
(
provider
)
let
font
=
CGFont
(
provider
)
var
error
:
Unmanaged
<
CFError
>
?
var
error
:
Unmanaged
<
CFError
>
?
if
!
CTFontManagerRegisterGraphicsFont
(
font
,
&
error
)
{
if
!
CTFontManagerRegisterGraphicsFont
(
font
!
,
&
error
)
{
let
errorDescription
=
CFErrorCopyDescription
(
error
!.
takeUnretainedValue
())
let
errorDescription
=
CFErrorCopyDescription
(
error
!.
takeUnretainedValue
())
let
nsError
=
error
!.
takeUnretainedValue
()
as
Any
as!
Error
let
nsError
=
error
!.
takeUnretainedValue
()
as
Any
as!
Error
NSException
(
name
:
.
internalInconsistencyException
,
reason
:
errorDescription
as
String
?,
userInfo
:
[
NSUnderlyingErrorKey
:
nsError
as
Any
])
.
raise
()
NSException
(
name
:
.
internalInconsistencyException
,
reason
:
errorDescription
as
String
?,
userInfo
:
[
NSUnderlyingErrorKey
:
nsError
as
Any
])
.
raise
()
...
...
Sources/iOS/Material+UIFont.swift
View file @
c3ff9361
...
@@ -41,7 +41,7 @@ extension UIFont {
...
@@ -41,7 +41,7 @@ extension UIFont {
open
func
stringSize
(
string
:
String
,
constrainedTo
width
:
CGFloat
)
->
CGSize
{
open
func
stringSize
(
string
:
String
,
constrainedTo
width
:
CGFloat
)
->
CGSize
{
return
string
.
boundingRect
(
with
:
CGSize
(
width
:
width
,
height
:
CGFloat
(
Double
.
greatestFiniteMagnitude
)),
return
string
.
boundingRect
(
with
:
CGSize
(
width
:
width
,
height
:
CGFloat
(
Double
.
greatestFiniteMagnitude
)),
options
:
NSStringDrawingOptions
.
usesLineFragmentOrigin
,
options
:
NSStringDrawingOptions
.
usesLineFragmentOrigin
,
attributes
:
[
NS
FontAttributeName
:
self
],
attributes
:
[
NS
AttributedStringKey
.
font
:
self
],
context
:
nil
)
.
size
context
:
nil
)
.
size
}
}
}
}
Sources/iOS/Material+UIView.swift
View file @
c3ff9361
...
@@ -123,6 +123,7 @@ extension UIView {
...
@@ -123,6 +123,7 @@ extension UIView {
width or height property is set, the other will be automatically adjusted
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
to maintain the shape of the object.
*/
*/
@objc
open
var
shapePreset
:
ShapePreset
{
open
var
shapePreset
:
ShapePreset
{
get
{
get
{
return
layer
.
shapePreset
return
layer
.
shapePreset
...
@@ -223,6 +224,7 @@ extension UIView {
...
@@ -223,6 +224,7 @@ extension UIView {
}
}
/// A property that sets the cornerRadius of the backing layer.
/// A property that sets the cornerRadius of the backing layer.
@objc
open
var
cornerRadiusPreset
:
CornerRadiusPreset
{
open
var
cornerRadiusPreset
:
CornerRadiusPreset
{
get
{
get
{
return
layer
.
cornerRadiusPreset
return
layer
.
cornerRadiusPreset
...
...
Sources/iOS/SearchBar.swift
View file @
c3ff9361
...
@@ -109,7 +109,7 @@ open class SearchBar: Bar {
...
@@ -109,7 +109,7 @@ open class SearchBar: Bar {
open
var
placeholder
:
String
?
{
open
var
placeholder
:
String
?
{
didSet
{
didSet
{
if
let
v
=
placeholder
{
if
let
v
=
placeholder
{
textField
.
attributedPlaceholder
=
NSAttributedString
(
string
:
v
,
attributes
:
[
NS
ForegroundColorAttributeName
:
placeholderColor
])
textField
.
attributedPlaceholder
=
NSAttributedString
(
string
:
v
,
attributes
:
[
NS
AttributedStringKey
.
foregroundColor
:
placeholderColor
])
}
}
}
}
}
}
...
@@ -119,7 +119,7 @@ open class SearchBar: Bar {
...
@@ -119,7 +119,7 @@ open class SearchBar: Bar {
open
var
placeholderColor
=
Color
.
darkText
.
others
{
open
var
placeholderColor
=
Color
.
darkText
.
others
{
didSet
{
didSet
{
if
let
v
=
placeholder
{
if
let
v
=
placeholder
{
textField
.
attributedPlaceholder
=
NSAttributedString
(
string
:
v
,
attributes
:
[
NS
ForegroundColorAttributeName
:
placeholderColor
])
textField
.
attributedPlaceholder
=
NSAttributedString
(
string
:
v
,
attributes
:
[
NS
AttributedStringKey
.
foregroundColor
:
placeholderColor
])
}
}
}
}
}
}
...
...
Sources/iOS/SnackbarController.swift
View file @
c3ff9361
...
@@ -115,7 +115,7 @@ open class SnackbarController: TransitionController {
...
@@ -115,7 +115,7 @@ open class SnackbarController: TransitionController {
- Parameter status: A SnackbarStatus enum value.
- Parameter status: A SnackbarStatus enum value.
*/
*/
@discardableResult
@discardableResult
open
func
animate
(
snackbar
status
:
SnackbarStatus
,
delay
:
TimeInterval
=
0
,
animations
:
((
Snackbar
)
->
Void
)?
=
nil
,
completion
:
((
Snackbar
)
->
Void
)?
=
nil
)
->
Motion
Delay
CancelBlock
?
{
open
func
animate
(
snackbar
status
:
SnackbarStatus
,
delay
:
TimeInterval
=
0
,
animations
:
((
Snackbar
)
->
Void
)?
=
nil
,
completion
:
((
Snackbar
)
->
Void
)?
=
nil
)
->
MotionCancelBlock
?
{
return
Motion
.
delay
(
delay
)
{
[
weak
self
,
status
=
status
,
animations
=
animations
,
completion
=
completion
]
in
return
Motion
.
delay
(
delay
)
{
[
weak
self
,
status
=
status
,
animations
=
animations
,
completion
=
completion
]
in
guard
let
s
=
self
else
{
guard
let
s
=
self
else
{
return
return
...
...
Sources/iOS/TabBar.swift
View file @
c3ff9361
...
@@ -408,19 +408,19 @@ fileprivate extension TabBar {
...
@@ -408,19 +408,19 @@ fileprivate extension TabBar {
selectedTabItem
=
tabItem
selectedTabItem
=
tabItem
line
.
animate
(
.
duration
(
0.25
),
line
.
animate
(
.
duration
(
0.25
),
.
size
(
CGSize
(
width
:
tabItem
.
width
,
height
:
lineHeight
)
),
.
size
(
width
:
tabItem
.
width
,
height
:
lineHeight
),
.
position
(
CGPoint
(
x
:
tabItem
.
center
.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
/
2
:
lineHeight
/
2
)
),
.
position
(
x
:
tabItem
.
center
.
x
,
y
:
.
bottom
==
lineAlignment
?
height
-
lineHeight
/
2
:
lineHeight
/
2
),
.
completion
{
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
tabItem
=
tabItem
,
completion
=
completion
]
_
in
.
completion
({
[
weak
self
,
isTriggeredByUserInteraction
=
isTriggeredByUserInteraction
,
tabItem
=
tabItem
,
completion
=
completion
]
in
guard
let
s
=
self
else
{
guard
let
s
=
self
else
{
return
return
}
}
if
isTriggeredByUserInteraction
{
if
isTriggeredByUserInteraction
{
s
.
delegate
?
.
tabBar
?(
tabBar
:
s
,
didSelect
:
tabItem
)
s
.
delegate
?
.
tabBar
?(
tabBar
:
s
,
didSelect
:
tabItem
)
}
}
completion
?(
tabItem
)
completion
?(
tabItem
)
})
})
)
updateScrollView
()
updateScrollView
()
}
}
...
...
Sources/iOS/TabsController.swift
View file @
c3ff9361
...
@@ -360,7 +360,7 @@ extension TabsController {
...
@@ -360,7 +360,7 @@ extension TabsController {
return
return
}
}
Motion
.
delay
(
0
)
{
[
weak
self
]
in
Motion
.
async
{
[
weak
self
]
in
guard
let
s
=
self
else
{
guard
let
s
=
self
else
{
return
return
}
}
...
...
Sources/iOS/TextStorage.swift
View file @
c3ff9361
...
@@ -105,7 +105,7 @@ extension TextStorage {
...
@@ -105,7 +105,7 @@ extension TextStorage {
If you don't need this value, pass NULL.
If you don't need this value, pass NULL.
- Returns: The attributes for the character at index.
- Returns: The attributes for the character at index.
*/
*/
open
override
func
attributes
(
at
location
:
Int
,
effectiveRange
range
:
NSRangePointer
?)
->
[
String
:
Any
]
{
open
override
func
attributes
(
at
location
:
Int
,
effectiveRange
range
:
NSRangePointer
?)
->
[
NSAttributedStringKey
:
Any
]
{
return
storage
.
attributes
(
at
:
location
,
effectiveRange
:
range
)
return
storage
.
attributes
(
at
:
location
,
effectiveRange
:
range
)
}
}
...
@@ -126,7 +126,7 @@ extension TextStorage {
...
@@ -126,7 +126,7 @@ extension TextStorage {
- Parameter range: A range of characters that will have their
- Parameter range: A range of characters that will have their
attributes updated.
attributes updated.
*/
*/
open
override
func
setAttributes
(
_
attrs
:
[
String
:
Any
]?,
range
:
NSRange
)
{
open
override
func
setAttributes
(
_
attrs
:
[
NSAttributedStringKey
:
Any
]?,
range
:
NSRange
)
{
storage
.
setAttributes
(
attrs
,
range
:
range
)
storage
.
setAttributes
(
attrs
,
range
:
range
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
}
}
...
@@ -138,7 +138,7 @@ extension TextStorage {
...
@@ -138,7 +138,7 @@ extension TextStorage {
- Parameter range: A range of characters that will have their
- Parameter range: A range of characters that will have their
attributes added.
attributes added.
*/
*/
open
override
func
addAttribute
(
_
name
:
String
,
value
:
Any
,
range
:
NSRange
)
{
open
override
func
addAttribute
(
_
name
:
NSAttributedStringKey
,
value
:
Any
,
range
:
NSRange
)
{
storage
.
addAttribute
(
name
,
value
:
value
,
range
:
range
)
storage
.
addAttribute
(
name
,
value
:
value
,
range
:
range
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
}
}
...
@@ -149,7 +149,7 @@ extension TextStorage {
...
@@ -149,7 +149,7 @@ extension TextStorage {
- Parameter range: A range of characters that will have their
- Parameter range: A range of characters that will have their
attributes removed.
attributes removed.
*/
*/
open
override
func
removeAttribute
(
_
name
:
String
,
range
:
NSRange
)
{
open
override
func
removeAttribute
(
_
name
:
NSAttributedStringKey
,
range
:
NSRange
)
{
storage
.
removeAttribute
(
name
,
range
:
range
)
storage
.
removeAttribute
(
name
,
range
:
range
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
edited
(
.
editedAttributes
,
range
:
range
,
changeInLength
:
0
)
}
}
...
...
Sources/iOS/TransitionController.swift
View file @
c3ff9361
...
@@ -162,6 +162,7 @@ internal extension TransitionController {
...
@@ -162,6 +162,7 @@ internal extension TransitionController {
}
}
/// A method that prepares the rootViewController.
/// A method that prepares the rootViewController.
@objc
func
prepareRootViewController
()
{
func
prepareRootViewController
()
{
prepare
(
viewController
:
rootViewController
,
in
:
container
)
prepare
(
viewController
:
rootViewController
,
in
:
container
)
}
}
...
...
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