Skip to content

Commit

Permalink
Change access modifiers in Animation (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardjewson authored and Max Meyers committed Nov 15, 2016
1 parent 5f291c4 commit 72fce0f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Source/Animation.swift
Expand Up @@ -8,38 +8,38 @@

import UIKit

public class Animation<T: Interpolatable> where T.ValueType == T {
open class Animation<T: Interpolatable> where T.ValueType == T {
private let filmstrip = Filmstrip<T>()

public init() {}
public subscript(time: CGFloat) -> T {

open subscript(time: CGFloat) -> T {
get {
return filmstrip[time]
}
set {
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.")
Expand Down

0 comments on commit 72fce0f

Please sign in to comment.