瘋狂購物 App — UIStepper 和數字變字串練習
Published in
2 min readApr 26, 2019
實現以 UIStepper 元件設定購買數量,算出總額,
想買+1 / 不想買-1 / 可以清除反悔 / 也可以鼓起勇氣結帳
— —宣傳物有規定,出現酒的圖片就要加警語,用唸的更有誠意吧 ——
import AVFoundation
let utterance = AVSpeechUtterance(string: “未成年請勿飲酒。喝酒不開車,開車不喝酒。飲酒過量,有害健康。”)
utterance.voice = AVSpeechSynthesisVoice(language:”zh-TW”)
utterance.rate = 0.7
let synthesizer = AVSpeechSynthesizer()
synthesizer.speak(utterance)