This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let animationDelay = 0.5 // tweak this to speed up / slow down animation | |
var hiddenDots = 3 | |
func animateDots() { | |
if let str = label.text { | |
let range = NSRange(location: str.count - hiddenDots, length: hiddenDots) | |
let string = NSMutableAttributedString(string: str) | |
string.addAttribute(.foregroundColor, value: UIColor.clear, range: range) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Write a function average that takes two numbers as input (parameters), | |
and returns the average of those numbers.*/ | |
function average(num1, num2) { | |
return (num1 + num2) / 2; | |
} | |
/*Write a function greeter that takes a name as an argument and greets | |
that name by returning something along the lines of "Hello, <name>!"*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Pair Programming Practice. Submit a link to your gist here when you are done: | |
https://goo.gl/forms/mPumIHpIKF3W1gjt2 | |
*/ | |
/** | |
EXERCISE ONE | |
What is wrong with the following definitions of square? Write a sentence or two describing the issue(s); then, | |
try copying the erroneous examples into a console one-at-a-time and observing the error(s) generated (you may | |
have to attempt to invoke the functions to see the error). What errors are produced (if any) for each erroneous |