質問編集履歴
2
一部手順に誤りがあったので修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,17 +12,17 @@
|
|
12
12
|
|
13
13
|
(1)共通パーツ「testView(xib,swift)」製作
|
14
14
|
|
15
|
-
|
15
|
+
・testView.xib作成
|
16
16
|
|
17
17
|
Xcodeにて、File->New->File->UserInterfaceよりViewを選択しUILabelを配置
|
18
18
|
|
19
|
-
|
19
|
+
・testView.swift作成
|
20
20
|
|
21
21
|
Xcodeにて、File->New->File->CocoaTouchClassのSubclassにUIViewで"testView"作成し以下のコードを記載
|
22
22
|
|
23
|
-
|
23
|
+
・XcodeにてtestView.xibのFile'sOwnerにtestViewを設定
|
24
24
|
|
25
|
-
|
25
|
+
・XcodeにてtestView.xibにUILabelを配置し、ドラッグドロップでtestView.swiftにIBOutletを設定
|
26
26
|
|
27
27
|
```swift
|
28
28
|
|
@@ -76,11 +76,13 @@
|
|
76
76
|
|
77
77
|
Xcodeにて、File->New->File->CocoaTouchClassのSubclassにUIViewControllerで"testMainViewController"を作成し以下のコードを記載
|
78
78
|
|
79
|
-
|
79
|
+
・XcodeのStoryBoadにてViewControllerにclassにtestMainViewControllerを設定
|
80
80
|
|
81
|
-
UILabelを配置
|
81
|
+
UILabelを配置
|
82
82
|
|
83
|
+
・xcodeで配置したUILabelのclassにtestViewを設定
|
84
|
+
|
83
|
-
|
85
|
+
・XcodeのStoryBoadにてUILabelをドラッグドロップでtestMainViewController.swiftにIBOutletを設定[testViewParent]
|
84
86
|
|
85
87
|
|
86
88
|
|
1
図も添付しましたm(_ _)m
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,6 +68,8 @@
|
|
68
68
|
|
69
69
|
```
|
70
70
|
|
71
|
+
![イメージ説明](18a0fab7095b44cbc23ff6f569b3facb.png)
|
72
|
+
|
71
73
|
|
72
74
|
|
73
75
|
(2)testMainViewController(ViewController)を作成し、以下に記述
|
@@ -125,3 +127,5 @@
|
|
125
127
|
}
|
126
128
|
|
127
129
|
```
|
130
|
+
|
131
|
+
![イメージ説明](f77ec78bde0c3c4f4b85dd8b60e8f7b5.png)
|