Skip to content

Commit 94081c5

Browse files
committed
Updates for Swift 5 compatibility
1 parent 0da1ec2 commit 94081c5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Sources/MotionGroup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public class MotionGroup: Moveable, MoveableCollection, TempoDriven, MotionUpdat
555555
public func remove(_ motion: Moveable) {
556556

557557
// first grab the index of the object in the motions array so we can remove the corresponding tempoOverrides value
558-
let index = motions.index {
558+
let index = motions.firstIndex {
559559
$0 == motion
560560
}
561561
if let motion_index = index {

Sources/MotionMachine.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public protocol ValueAssistant {
335335

336336
public extension ValueAssistant {
337337

338-
public func retrieveCurrentObjectValue(forProperty property: PropertyData) -> Double? {
338+
func retrieveCurrentObjectValue(forProperty property: PropertyData) -> Double? {
339339

340340
guard let unwrapped_object = property.targetObject else { return nil }
341341

@@ -355,7 +355,7 @@ public extension ValueAssistant {
355355
// utility methods for ValueAssistant
356356
public extension ValueAssistant {
357357

358-
public func applyTo(value: inout Double, newValue: Double) {
358+
func applyTo(value: inout Double, newValue: Double) {
359359
if (additive) {
360360
value += (newValue * additiveWeighting)
361361
} else {
@@ -364,15 +364,15 @@ public extension ValueAssistant {
364364

365365
}
366366

367-
public func applyTo(value: inout CGFloat, newValue: CGFloat) {
367+
func applyTo(value: inout CGFloat, newValue: CGFloat) {
368368
if (additive) {
369369
value += (newValue * CGFloat(additiveWeighting))
370370
} else {
371371
value = newValue
372372
}
373373
}
374374

375-
public func lastComponent(forPath path: String) -> String {
375+
func lastComponent(forPath path: String) -> String {
376376
let components = path.components(separatedBy: ".")
377377
return components.last!
378378
}

Sources/MotionSequence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public class MotionSequence: Moveable, MoveableCollection, TempoDriven, MotionUp
574574
public func remove(_ sequenceStep: Moveable) {
575575

576576
// first grab the index of the object in the motions array so we can remove the corresponding tempoOverrides value
577-
let index = steps.index {
577+
let index = steps.firstIndex {
578578
$0 == sequenceStep
579579
}
580580

0 commit comments

Comments
 (0)