scenekitにボタンを追加することってできないんですか?
「scenekitに」というのが「SCNSceneに」という意味でしたら追加は出来ませんが、そうではなくて、「SceneKitを使った画面内に」という意味でしたら普通に追加できます。
swift
1class GameViewController: UIViewController {
2
3 override func viewDidLoad() {
4 super.viewDidLoad()
5 :
6 //ボタン追加
7 let button = UIButton(type: .Custom)
8 button.frame.size = CGSize(width: 100, height: 100)
9 button.center = self.view.center
10 button.setTitle("BUTTON", forState: .Normal)
11 button.setTitleColor(UIColor.blackColor(), forState: .Normal)
12 button.backgroundColor = UIColor.orangeColor()
13 button.addTarget(self, action: #selector(GameViewController.pushedButton(_:)), forControlEvents: .TouchUpInside)
14 self.view.addSubview(button)
15 }
16
17 func pushedButton(sender: UIButton) {
18 print("pushed")
19 }
20 :
21}
いたって普通です。Swift2です。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。