class は ViewController でsubClass は UIViewController でいいでしょうか?
class
は自分で付けたい名前をつければよいです。
例: 設定する画面を作るならSettingViewController
とか。
ViewController
は最初から作られているファイル名と同じなので、同じ名前で作成しようとすると置き換えるか聞かれます。
subClass
は新しい画面を追加したいのでしたらUIViewController
で大丈夫です。
2、ファイルを作成した時、
こちらはsubClass
をUIViewController
にした場合viewDidLoad()
、didReceiveMemoryWarning()
作成されていると思います。
通常は以下の状態で作成されると思います。
※ class → ViewController1、 subClass → UIViewControllerで作成した場合
サブクラスがUIViewController
になっていないかもしれません。
swift
1import UIKit
2
3class ViewController1: UIViewController {
4
5 override func viewDidLoad() {
6 super.viewDidLoad()
7 // Do any additional setup after loading the view.
8 }
9
10 override func didReceiveMemoryWarning() {
11 super.didReceiveMemoryWarning()
12 // Dispose of any resources that can be recreated.
13 }
14
15 /*
16 // MARK: - Navigation
17
18 // In a storyboard-based application, you will often want to do a little preparation before navigation
19 override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
20 // Get the new view controller using segue.destinationViewController.
21 // Pass the selected object to the new view controller.
22 }
23 */
24}
25
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/28 04:59