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
dd1a97c2
Commit
dd1a97c2
authored
Jul 19, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest updated for Xcode 8 beta 2
parent
15cbc145
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
17 deletions
+17
-17
Sources/iOS/BottomNavigationController.swift
+3
-3
Sources/iOS/Capture.swift
+1
-1
Sources/iOS/CaptureSession.swift
+3
-3
Sources/iOS/Layer.swift
+1
-2
Sources/iOS/Material+UIImage.swift
+2
-2
Sources/iOS/Material.swift
+2
-2
Sources/iOS/MaterialCollectionViewLayout.swift
+1
-1
Sources/iOS/TextView.swift
+2
-2
Sources/iOS/View.swift
+2
-1
No files found.
Sources/iOS/BottomNavigationController.swift
View file @
dd1a97c2
...
...
@@ -31,7 +31,7 @@
import
UIKit
public
class
BottomNavigationFadeAnimatedTransitioning
:
NSObject
,
UIViewControllerAnimatedTransitioning
{
public
func
animateTransition
(
_
transitionContext
:
UIViewControllerContextTransitioning
)
{
public
func
animateTransition
(
using
transitionContext
:
UIViewControllerContextTransitioning
)
{
let
fromView
:
UIView
=
transitionContext
.
view
(
forKey
:
UITransitionContextFromViewKey
)
!
let
toView
:
UIView
=
transitionContext
.
view
(
forKey
:
UITransitionContextToViewKey
)
!
toView
.
alpha
=
0
...
...
@@ -39,7 +39,7 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl
transitionContext
.
containerView
()
.
addSubview
(
fromView
)
transitionContext
.
containerView
()
.
addSubview
(
toView
)
UIView
.
animate
(
withDuration
:
transitionDuration
(
transitionContext
),
UIView
.
animate
(
withDuration
:
transitionDuration
(
using
:
transitionContext
),
animations
:
{
_
in
toView
.
alpha
=
1
fromView
.
alpha
=
0
...
...
@@ -48,7 +48,7 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl
}
}
public
func
transitionDuration
(
_
transitionContext
:
UIViewControllerContextTransitioning
?)
->
TimeInterval
{
public
func
transitionDuration
(
using
transitionContext
:
UIViewControllerContextTransitioning
?)
->
TimeInterval
{
return
0.35
}
}
...
...
Sources/iOS/Capture.swift
View file @
dd1a97c2
...
...
@@ -347,7 +347,7 @@ public class Capture : View, UIGestureRecognizerDelegate {
internal
func
startTimer
()
{
timer
?
.
invalidate
()
timer
=
Timer
(
timeInterval
:
0.5
,
target
:
self
,
selector
:
#selector(
updateTimer
)
,
userInfo
:
nil
,
repeats
:
true
)
RunLoop
.
main
()
.
add
(
timer
!
,
forMode
:
.
commonModes
)
RunLoop
.
main
.
add
(
timer
!
,
forMode
:
.
commonModes
)
(
delegate
as?
CaptureDelegate
)?
.
captureDidStartRecordTimer
?(
capture
:
self
)
}
...
...
Sources/iOS/CaptureSession.swift
View file @
dd1a97c2
...
...
@@ -721,10 +721,10 @@ public class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
*/
private
func
uniqueURL
()
->
NSURL
?
{
do
{
let
directory
:
NSURL
=
try
FileManager
.
default
()
.
urlForDirectory
(
.
documentDirectory
,
in
:
.
userDomainMask
,
appropriateFor
:
nil
,
create
:
true
)
let
directory
:
NSURL
=
try
FileManager
.
default
.
urlForDirectory
(
.
documentDirectory
,
in
:
.
userDomainMask
,
appropriateFor
:
nil
,
create
:
true
)
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateStyle
=
.
full
Style
dateFormatter
.
timeStyle
=
.
full
Style
dateFormatter
.
dateStyle
=
.
full
dateFormatter
.
timeStyle
=
.
full
return
directory
.
appendingPathComponent
(
dateFormatter
.
string
(
from
:
NSDate
()
as
Date
)
+
".mov"
)
}
catch
let
e
as
NSError
{
delegate
?
.
captureSessionCreateMovieFileFailedWithError
?(
captureSession
:
self
,
error
:
e
)
...
...
Sources/iOS/Layer.swift
View file @
dd1a97c2
...
...
@@ -291,7 +291,6 @@ public class Layer: CAShapeLayer {
- Parameter animation: A CAAnimation instance.
*/
public
func
animate
(
animation
:
CAAnimation
)
{
animation
.
delegate
=
self
if
let
a
=
animation
as?
CABasicAnimation
{
a
.
fromValue
=
(
nil
==
presentation
()
?
self
:
presentation
()
!
)
.
value
(
forKeyPath
:
a
.
keyPath
!
)
}
...
...
@@ -312,7 +311,7 @@ public class Layer: CAShapeLayer {
because it was completed or interrupted. True if completed, false
if interrupted.
*/
public
override
func
animationDidStop
(
_
animation
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
func
animationDidStop
(
_
animation
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
=
animation
as?
CAPropertyAnimation
{
if
let
b
=
a
as?
CABasicAnimation
{
if
let
v
=
b
.
toValue
{
...
...
Sources/iOS/Material+UIImage.swift
View file @
dd1a97c2
...
...
@@ -167,7 +167,7 @@ public extension UIImage {
has been retrieved.
*/
public
class
func
contentsOfURL
(
url
:
URL
,
completion
:
((
image
:
UIImage
?,
error
:
NSError
?)
->
Void
))
{
URLSession
.
shared
()
.
dataTask
(
with
:
URLRequest
(
url
:
url
))
{
(
data
:
Data
?,
response
:
URLResponse
?,
error
:
NSError
?)
in
URLSession
.
shared
.
dataTask
(
with
:
URLRequest
(
url
:
url
))
{
(
data
:
Data
?,
response
:
URLResponse
?,
error
:
NSError
?)
in
DispatchQueue
.
main
.
async
{
if
let
v
=
error
{
completion
(
image
:
nil
,
error
:
v
)
...
...
@@ -175,6 +175,6 @@ public extension UIImage {
completion
(
image
:
UIImage
(
data
:
v
),
error
:
nil
)
}
}
}
.
resume
()
}
.
resume
()
}
}
Sources/iOS/Material.swift
View file @
dd1a97c2
...
...
@@ -252,7 +252,7 @@ public extension UIView {
- Parameter animation: A CAAnimation instance.
*/
public
func
animate
(
animation
:
CAAnimation
)
{
animation
.
delegate
=
self
//
animation.delegate = self
if
let
a
=
animation
as?
CABasicAnimation
{
a
.
fromValue
=
(
nil
==
layer
.
presentation
()
?
layer
:
layer
.
presentation
()
!
)
.
value
(
forKeyPath
:
a
.
keyPath
!
)
}
...
...
@@ -273,7 +273,7 @@ public extension UIView {
because it was completed or interrupted. True if completed, false
if interrupted.
*/
public
override
func
animationDidStop
(
_
animation
:
CAAnimation
,
finished
flag
:
Bool
)
{
public
func
animationDidStop
(
_
animation
:
CAAnimation
,
finished
flag
:
Bool
)
{
if
let
a
=
animation
as?
CAPropertyAnimation
{
if
let
b
=
a
as?
CABasicAnimation
{
if
let
v
=
b
.
toValue
{
...
...
Sources/iOS/MaterialCollectionViewLayout.swift
View file @
dd1a97c2
...
...
@@ -86,7 +86,7 @@ public class MaterialCollectionViewLayout: UICollectionViewLayout {
public
override
func
layoutAttributesForItem
(
at
indexPath
:
IndexPath
)
->
UICollectionViewLayoutAttributes
?
{
let
attributes
=
UICollectionViewLayoutAttributes
(
forCellWith
:
indexPath
)
let
item
:
MaterialDataSourceItem
=
dataSourceItems
!
[
indexPath
.
item
!
]
let
item
:
MaterialDataSourceItem
=
dataSourceItems
!
[
indexPath
.
item
]
if
0
<
itemSize
.
width
&&
0
<
itemSize
.
height
{
attributes
.
frame
=
CGRect
(
x
:
offset
.
x
,
y
:
offset
.
y
,
width
:
itemSize
.
width
-
contentInset
.
left
-
contentInset
.
right
,
height
:
itemSize
.
height
-
contentInset
.
top
-
contentInset
.
bottom
)
...
...
Sources/iOS/TextView.swift
View file @
dd1a97c2
...
...
@@ -333,7 +333,7 @@ public class TextView: UITextView {
/// Prepares the Notification handlers.
private
func
prepareNotificationHandlers
()
{
let
defaultCenter
=
NotificationCenter
.
default
()
let
defaultCenter
=
NotificationCenter
.
default
defaultCenter
.
addObserver
(
self
,
selector
:
#selector(
handleTextViewTextDidBegin
)
,
name
:
NSNotification
.
Name
.
UITextViewTextDidBeginEditing
,
object
:
self
)
defaultCenter
.
addObserver
(
self
,
selector
:
#selector(
handleTextViewTextDidChange
)
,
name
:
NSNotification
.
Name
.
UITextViewTextDidChange
,
object
:
self
)
defaultCenter
.
addObserver
(
self
,
selector
:
#selector(
handleTextViewTextDidEnd
)
,
name
:
NSNotification
.
Name
.
UITextViewTextDidEndEditing
,
object
:
self
)
...
...
@@ -341,7 +341,7 @@ public class TextView: UITextView {
/// Removes the Notification handlers.
private
func
removeNotificationHandlers
()
{
let
defaultCenter
=
NotificationCenter
.
default
()
let
defaultCenter
=
NotificationCenter
.
default
defaultCenter
.
removeObserver
(
self
,
name
:
NSNotification
.
Name
.
UITextViewTextDidBeginEditing
,
object
:
self
)
defaultCenter
.
removeObserver
(
self
,
name
:
NSNotification
.
Name
.
UITextViewTextDidChange
,
object
:
self
)
defaultCenter
.
removeObserver
(
self
,
name
:
NSNotification
.
Name
.
UITextViewTextDidEndEditing
,
object
:
self
)
...
...
Sources/iOS/View.swift
View file @
dd1a97c2
...
...
@@ -259,7 +259,8 @@ public class View: UIView {
/// Prepares the visualLayer property.
internal
func
prepareVisualLayer
()
{
visualLayer
.
zPosition
=
0
visualLayer
=
CAShapeLayer
()
visualLayer
.
zPosition
=
0
visualLayer
.
masksToBounds
=
true
layer
.
addSublayer
(
visualLayer
)
}
...
...
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