var cycles = 0
, поставьте условие if i + 1 > exersiseName.count
первым и модифицируйте следующим образом:if i + 1 > exersiseName.count { //Конец цикла
count+=1
if (count >= sets) {
timerLabel.text = "0"
timer.invalidate()
timerRunning = false
}else{
i = 0
}
} //важно: не надо ставить здесь else
if ....
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
...
let userDefaults = NSUserDefaults.standardUserDefaults()
if var numberOfLaunches = userDefaults.objectForKey("numberOfLaunches") as? Int {
numberOfLaunches++
userDefaults.setInteger(numberOfLaunches, forKey: "numberOfLaunches")
} else {
let n = 1
userDefaults.setInteger(n, forKey: "numberOfLaunches")
}
print(userDefaults.objectForKey("numberOfLaunches") as! Int)
return true
}
But how does Shazam really work? Shazam’s algorithm was revealed to world by its inventor Avery Li-Chung Wang in 2003. In this article we’ll go over the fundamentals of Shazam’s music recognition algorithm.
//располагаем текст сверху слева
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
[button setContentVerticalAlignment:UIControlContentVerticalAlignmentTop];
//двигаем текст вниз и вправо на 10 пикселей
[button setTitleEdgeInsets:UIEdgeInsetsMake(10.0f, 10.0f, 0.0f, 0.0f)];
willMoveToSuperview:
didMoveToSuperview