From 72fce0f666b9a8395dc2706899b96654ed25e96d Mon Sep 17 00:00:00 2001 From: Edward Jewson Date: Tue, 15 Nov 2016 21:05:21 +0100 Subject: [PATCH] Change access modifiers in Animation (#44) --- Source/Animation.swift | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Animation.swift b/Source/Animation.swift index 92c1fc8..465232a 100644 --- a/Source/Animation.swift +++ b/Source/Animation.swift @@ -8,12 +8,12 @@ import UIKit -public class Animation where T.ValueType == T { +open class Animation where T.ValueType == T { private let filmstrip = Filmstrip() - + public init() {} - - public subscript(time: CGFloat) -> T { + + open subscript(time: CGFloat) -> T { get { return filmstrip[time] } @@ -21,25 +21,25 @@ public class Animation where T.ValueType == T { addKeyframe(time, value: newValue) } } - - public func addKeyframe(_ time: CGFloat, value: T) { + + open func addKeyframe(_ time: CGFloat, value: T) { if !checkValidity(value) {return} filmstrip[time] = value } - - public func addKeyframe(_ time: CGFloat, value: T, easing: @escaping EasingFunction) { + + open func addKeyframe(_ time: CGFloat, value: T, easing: @escaping EasingFunction) { if !checkValidity(value) {return} filmstrip.setValue(value, atTime: time, easing: easing) } - - public func hasKeyframes() -> Bool { + + open func hasKeyframes() -> Bool { return !filmstrip.isEmpty } - - public func validateValue(_ value: T) -> Bool { + + open func validateValue(_ value: T) -> Bool { return true } - + private func checkValidity(_ value: T) -> Bool { let valid = validateValue(value) assert(valid, "The keyframe value is invalid for this type of animation.")