[
はて?
いらない接続を解除すると消えるようだが、消えんぞ。
随机应变 ABCD: Always Be Coding and … : хороший
[
はて?
いらない接続を解除すると消えるようだが、消えんぞ。
#selector(self.hoge)がエラーになる。
func update()を@objc func update()とするとエラーが解消してbuild出来る。
@objc func update(){
print(Date.timeIntervalSinceReferenceDate)
}
@IBAction func startTimer(_ sender: Any) {
Timer.scheduledTimer(
timeInterval: 0.01,
target: self,
selector: #selector(self.update),
userInfo: nil,
repeats: true)
}
@IBAction func stopTimer(_ sender: Any) {
}
@IBAction func resetTimer(_ sender: Any) {
}
Helvetica Neueだと、数値が均等になるらしい。

override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
if identifier == "showResult" {
guard self.nameText.text != "" else {
let alertController = UIAlertController(title: "Error", message: "Please enter your name", preferredStye: alert)
let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
return false
}
return true
}
return true
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let identifier = segue.identifier else {
return
}
if identifier == "showResult"{
let resultVC = segue.destination as! ResultViewController
resultVC.myName = self.nameText.text!
}
}
iphone8のemulatorの立ちあがりが異常に遅いんだが。。。
あれ?



失敗してるーーーーーーーーーーーーーー
あ、いいのか
Sierraを入れられず、mac book買い換えないとダメかと思いmac bookを物色していましたが、ストレージ周りをいろいろ整理していたら、何故かいけましたね。一安心。今日が日曜でなければ一杯飲んでたところ。
Xcodeが最新でないと、swiftの書き方だけでなく、あらゆる面で死活問題でしたので。。。

強制停止はcomand + option + esc

x-code 9.3.1 入りました。半日かかった。ヒャッホー

file -> new -> file -> cocoa file

新しく作ったcocoa classをview controllerと紐づける

ふむふむ
prepare func
class ViewController: UIViewController {
@IBOutlet weak var nameText: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
ovrride func prepare(for seque: UIStoryboardSeque, sender: Any?)
{
let resultVC = seque.destination as! ResultViewController
resultVC.myName = self.nameText.text!
}
}
editor -> embed in -> navigation controller

@IBAction func getOmikuji(sender: AnyObject) {
// 0 - n
// arc4random_uniform(n + 1)
let random = arc4random_uniform(10)
self.myLabel.text = String(random)
}
おーおーお

@IBOutlet weak var myLabel: UILabel!
@IBAction func getOmikuji(sender: AnyObject) {
// 0 - n
// arc4random_uniform(n + 1)
let results = ["大吉", "中吉","吉", "大凶"]
let random = arc4random_uniform(UInt32(results.count))
self.myLabel.text = results[Int(random)]
}
override func viewDidLoad() {
super.viewDidLoad()
// myLabel.layer.borderColor = UIColor.orange.cgColor
// myLabel.layer.borderWidth = 5
// myLabel.layer.cornerRadius = 50
myLabel.layer.masksToBounds = true
myLabel.layer.cornerRadius = myLabel.bounds.width / 2
// Do any additional setup after loading the view, typically from a nib.
}

conmand + “=” でフォントサイズを調整する

comand + option + “0”
-> utility areaを消す
