Commit dd1a97c2 by Daniel Dahan

latest updated for Xcode 8 beta 2

parent 15cbc145
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
import UIKit import UIKit
public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControllerAnimatedTransitioning { public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControllerAnimatedTransitioning {
public func animateTransition(_ transitionContext: UIViewControllerContextTransitioning) { public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let fromView : UIView = transitionContext.view(forKey: UITransitionContextFromViewKey)! let fromView : UIView = transitionContext.view(forKey: UITransitionContextFromViewKey)!
let toView : UIView = transitionContext.view(forKey: UITransitionContextToViewKey)! let toView : UIView = transitionContext.view(forKey: UITransitionContextToViewKey)!
toView.alpha = 0 toView.alpha = 0
...@@ -39,7 +39,7 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl ...@@ -39,7 +39,7 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl
transitionContext.containerView().addSubview(fromView) transitionContext.containerView().addSubview(fromView)
transitionContext.containerView().addSubview(toView) transitionContext.containerView().addSubview(toView)
UIView.animate(withDuration: transitionDuration(transitionContext), UIView.animate(withDuration: transitionDuration(using: transitionContext),
animations: { _ in animations: { _ in
toView.alpha = 1 toView.alpha = 1
fromView.alpha = 0 fromView.alpha = 0
...@@ -48,7 +48,7 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl ...@@ -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 return 0.35
} }
} }
......
...@@ -347,7 +347,7 @@ public class Capture : View, UIGestureRecognizerDelegate { ...@@ -347,7 +347,7 @@ public class Capture : View, UIGestureRecognizerDelegate {
internal func startTimer() { internal func startTimer() {
timer?.invalidate() timer?.invalidate()
timer = Timer(timeInterval: 0.5, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true) 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) (delegate as? CaptureDelegate)?.captureDidStartRecordTimer?(capture: self)
} }
......
...@@ -721,10 +721,10 @@ public class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -721,10 +721,10 @@ public class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
*/ */
private func uniqueURL() -> NSURL? { private func uniqueURL() -> NSURL? {
do { 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() let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .fullStyle dateFormatter.dateStyle = .full
dateFormatter.timeStyle = .fullStyle dateFormatter.timeStyle = .full
return directory.appendingPathComponent(dateFormatter.string(from: NSDate() as Date) + ".mov") return directory.appendingPathComponent(dateFormatter.string(from: NSDate() as Date) + ".mov")
} catch let e as NSError { } catch let e as NSError {
delegate?.captureSessionCreateMovieFileFailedWithError?(captureSession: self, error: e) delegate?.captureSessionCreateMovieFileFailedWithError?(captureSession: self, error: e)
......
...@@ -291,7 +291,6 @@ public class Layer: CAShapeLayer { ...@@ -291,7 +291,6 @@ public class Layer: CAShapeLayer {
- Parameter animation: A CAAnimation instance. - Parameter animation: A CAAnimation instance.
*/ */
public func animate(animation: CAAnimation) { public func animate(animation: CAAnimation) {
animation.delegate = self
if let a = animation as? CABasicAnimation { if let a = animation as? CABasicAnimation {
a.fromValue = (nil == presentation() ? self : presentation()!).value(forKeyPath: a.keyPath!) a.fromValue = (nil == presentation() ? self : presentation()!).value(forKeyPath: a.keyPath!)
} }
...@@ -312,7 +311,7 @@ public class Layer: CAShapeLayer { ...@@ -312,7 +311,7 @@ public class Layer: CAShapeLayer {
because it was completed or interrupted. True if completed, false because it was completed or interrupted. True if completed, false
if interrupted. 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 a = animation as? CAPropertyAnimation {
if let b = a as? CABasicAnimation { if let b = a as? CABasicAnimation {
if let v = b.toValue { if let v = b.toValue {
......
...@@ -167,7 +167,7 @@ public extension UIImage { ...@@ -167,7 +167,7 @@ public extension UIImage {
has been retrieved. has been retrieved.
*/ */
public class func contentsOfURL(url: URL, completion: ((image: UIImage?, error: NSError?) -> Void)) { 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 { DispatchQueue.main.async {
if let v = error { if let v = error {
completion(image: nil, error: v) completion(image: nil, error: v)
......
...@@ -252,7 +252,7 @@ public extension UIView { ...@@ -252,7 +252,7 @@ public extension UIView {
- Parameter animation: A CAAnimation instance. - Parameter animation: A CAAnimation instance.
*/ */
public func animate(animation: CAAnimation) { public func animate(animation: CAAnimation) {
animation.delegate = self // animation.delegate = self
if let a = animation as? CABasicAnimation { if let a = animation as? CABasicAnimation {
a.fromValue = (nil == layer.presentation() ? layer : layer.presentation()!).value(forKeyPath: a.keyPath!) a.fromValue = (nil == layer.presentation() ? layer : layer.presentation()!).value(forKeyPath: a.keyPath!)
} }
...@@ -273,7 +273,7 @@ public extension UIView { ...@@ -273,7 +273,7 @@ public extension UIView {
because it was completed or interrupted. True if completed, false because it was completed or interrupted. True if completed, false
if interrupted. 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 a = animation as? CAPropertyAnimation {
if let b = a as? CABasicAnimation { if let b = a as? CABasicAnimation {
if let v = b.toValue { if let v = b.toValue {
......
...@@ -86,7 +86,7 @@ public class MaterialCollectionViewLayout: UICollectionViewLayout { ...@@ -86,7 +86,7 @@ public class MaterialCollectionViewLayout: UICollectionViewLayout {
public override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { public override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath) let attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath)
let item: MaterialDataSourceItem = dataSourceItems![indexPath.item!] let item: MaterialDataSourceItem = dataSourceItems![indexPath.item]
if 0 < itemSize.width && 0 < itemSize.height { 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) attributes.frame = CGRect(x: offset.x, y: offset.y, width: itemSize.width - contentInset.left - contentInset.right, height: itemSize.height - contentInset.top - contentInset.bottom)
......
...@@ -333,7 +333,7 @@ public class TextView: UITextView { ...@@ -333,7 +333,7 @@ public class TextView: UITextView {
/// Prepares the Notification handlers. /// Prepares the Notification handlers.
private func prepareNotificationHandlers() { 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(handleTextViewTextDidBegin), name: NSNotification.Name.UITextViewTextDidBeginEditing, object: self)
defaultCenter.addObserver(self, selector: #selector(handleTextViewTextDidChange), name: NSNotification.Name.UITextViewTextDidChange, 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) defaultCenter.addObserver(self, selector: #selector(handleTextViewTextDidEnd), name: NSNotification.Name.UITextViewTextDidEndEditing, object: self)
...@@ -341,7 +341,7 @@ public class TextView: UITextView { ...@@ -341,7 +341,7 @@ public class TextView: UITextView {
/// Removes the Notification handlers. /// Removes the Notification handlers.
private func removeNotificationHandlers() { 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.UITextViewTextDidBeginEditing, object: self)
defaultCenter.removeObserver(self, name: NSNotification.Name.UITextViewTextDidChange, object: self) defaultCenter.removeObserver(self, name: NSNotification.Name.UITextViewTextDidChange, object: self)
defaultCenter.removeObserver(self, name: NSNotification.Name.UITextViewTextDidEndEditing, object: self) defaultCenter.removeObserver(self, name: NSNotification.Name.UITextViewTextDidEndEditing, object: self)
......
...@@ -259,6 +259,7 @@ public class View: UIView { ...@@ -259,6 +259,7 @@ public class View: UIView {
/// Prepares the visualLayer property. /// Prepares the visualLayer property.
internal func prepareVisualLayer() { internal func prepareVisualLayer() {
visualLayer = CAShapeLayer()
visualLayer.zPosition = 0 visualLayer.zPosition = 0
visualLayer.masksToBounds = true visualLayer.masksToBounds = true
layer.addSublayer(visualLayer) layer.addSublayer(visualLayer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment