Intro to App Development Lesson 7 Boogiebot Errors

Hello all,


I'm having issues with the boogiebot lesson of the the App Development Curriculum. Right from the begining there are errors once I show the Assistance Editor window. It doesn't show anything and there are 3 errors that show up. The first two correct with a couple simple clicks but the third I have no idea how to correct. Below is what is shown on the screen already there.


if (savePanel.runModal() == .OK) {
                    if var path = savePanel.url {
                        if (path.pathExtension != "gif") {
                            path = path.appendingPathExtension("gif")
                        }
                        try data.write(to: path, options: [])
                        print("Saved to \(path)")
                    }
                }


Line 01 has the error message: Type of expression is ambiguous without more context.


How do I correct this?


Thank you.

Replies

}
                animation.fromValue = layer.value(forKey: animation.keyPath!)
                animation.duration = moveDuration
                animation.toValue = move.toValue
                animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
                layer.setValue(animation.toValue, forKey: animation.keyPath!)
                layer.add(animation, forKey: animation.keyPath)
            }


hi, im having an issue with boogiebot as well, im using the new xcode 10.

the error shows this: kCAMediaTimingFunctionLinear' has been renamed to 'CAMediaTimingFunctionName.linear'


i just started using xcode so im a total beginner. would appreciate if someone can look into it. thanks in advance!

the error shows this

Such errors are usually accompanied by a fix-it that updates your source code to use the new name. Click on the error icon (the small red stop sign) to see that fix-it.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

still having the error.

the fix-it doesnt help at all on this case.

cause after following the hint. a new error came up.


'CAMediaTimingFunctionLinear'; did you mean 'kCAMediaTimingFunctionLinear'?

Need to use CAMediaTimingFunctionName.linear


Seem you are using CAMediaTimingFunctionLinear

its working now! thank you so much!!

Great.


Don't forget to close the therad.