Skip to content

Commit 050f401

Browse files
committed
Rename all IBOutlets
1 parent 0428d8e commit 050f401

File tree

5 files changed

+43
-32
lines changed

5 files changed

+43
-32
lines changed

Design/SwiftWeather.sketch

0 Bytes
Binary file not shown.

SwiftWeather/Base.lproj/Main.storyboard

+18-7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
105105
</userDefinedRuntimeAttribute>
106106
<userDefinedRuntimeAttribute type="string" keyPath="timeText" value="12:00"/>
107+
<userDefinedRuntimeAttribute type="string" keyPath="icon" value=""/>
108+
<userDefinedRuntimeAttribute type="string" keyPath="temperature" value="10"/>
107109
</userDefinedRuntimeAttributes>
108110
<variation key="heightClass=compact" fixedFrame="YES">
109111
<rect key="frame" x="0.0" y="0.0" width="56.5" height="112.5"/>
@@ -118,6 +120,9 @@
118120
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
119121
</userDefinedRuntimeAttribute>
120122
<userDefinedRuntimeAttribute type="string" keyPath="timeText" value="14:00"/>
123+
<userDefinedRuntimeAttribute type="string" keyPath="icon" value=""/>
124+
<userDefinedRuntimeAttribute type="string" keyPath="time" value="14:00"/>
125+
<userDefinedRuntimeAttribute type="string" keyPath="temperature" value="8"/>
121126
</userDefinedRuntimeAttributes>
122127
<variation key="heightClass=compact" fixedFrame="YES">
123128
<rect key="frame" x="86.5" y="0.0" width="56" height="112.5"/>
@@ -140,6 +145,9 @@
140145
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
141146
</userDefinedRuntimeAttribute>
142147
<userDefinedRuntimeAttribute type="string" keyPath="timeText" value="17:00"/>
148+
<userDefinedRuntimeAttribute type="string" keyPath="icon" value=""/>
149+
<userDefinedRuntimeAttribute type="string" keyPath="time" value="17:00"/>
150+
<userDefinedRuntimeAttribute type="string" keyPath="temperature" value="12"/>
143151
</userDefinedRuntimeAttributes>
144152
</view>
145153
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mjK-Yg-kU1" customClass="ForecastView" customModule="SwiftWeather" customModuleProvider="target">
@@ -151,6 +159,9 @@
151159
<color key="value" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
152160
</userDefinedRuntimeAttribute>
153161
<userDefinedRuntimeAttribute type="string" keyPath="timeText" value="20:00"/>
162+
<userDefinedRuntimeAttribute type="string" keyPath="icon" value=""/>
163+
<userDefinedRuntimeAttribute type="string" keyPath="time" value="20:00"/>
164+
<userDefinedRuntimeAttribute type="string" keyPath="temperature" value="4"/>
154165
</userDefinedRuntimeAttributes>
155166
</view>
156167
</subviews>
@@ -239,13 +250,13 @@
239250
</constraints>
240251
</view>
241252
<connections>
242-
<outlet property="icon" destination="hId-DS-ttH" id="5El-Md-alk"/>
243-
<outlet property="location" destination="COR-kZ-hOu" id="Jfd-NG-sB9"/>
244-
<outlet property="temperature" destination="lFc-pa-Aur" id="vI1-dL-cWd"/>
245-
<outletCollection property="forecasts" destination="y4d-hQ-IEP" collectionClass="NSMutableArray" id="mF5-bA-7Yo"/>
246-
<outletCollection property="forecasts" destination="X03-jw-bPo" collectionClass="NSMutableArray" id="cCg-FO-8S7"/>
247-
<outletCollection property="forecasts" destination="8G3-c1-MSy" collectionClass="NSMutableArray" id="0zT-MU-FbZ"/>
248-
<outletCollection property="forecasts" destination="mjK-Yg-kU1" collectionClass="NSMutableArray" id="wKk-E8-dIH"/>
253+
<outlet property="iconLabel" destination="hId-DS-ttH" id="LPc-4x-ucb"/>
254+
<outlet property="locationLabel" destination="COR-kZ-hOu" id="ksQ-LM-5Vo"/>
255+
<outlet property="temperatureLabel" destination="lFc-pa-Aur" id="3ka-Ce-vTD"/>
256+
<outletCollection property="forecastViews" destination="y4d-hQ-IEP" collectionClass="NSMutableArray" id="lX3-ak-UIi"/>
257+
<outletCollection property="forecastViews" destination="X03-jw-bPo" collectionClass="NSMutableArray" id="4an-ne-Yc5"/>
258+
<outletCollection property="forecastViews" destination="8G3-c1-MSy" collectionClass="NSMutableArray" id="YFy-Ee-oNH"/>
259+
<outletCollection property="forecastViews" destination="mjK-Yg-kU1" collectionClass="NSMutableArray" id="k54-Ye-toO"/>
249260
</connections>
250261
</viewController>
251262
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>

SwiftWeather/ForecastView.swift

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import UIKit
1212
// Our custom view from the XIB file
1313
var view: UIView!
1414

15-
@IBOutlet weak var time: UILabel!
16-
@IBOutlet weak var icon: UILabel!
17-
@IBOutlet weak var temperature: UILabel!
15+
@IBOutlet weak var timeLabel: UILabel!
16+
@IBOutlet weak var iconLabel: UILabel!
17+
@IBOutlet weak var temperatureLabel: UILabel!
1818

1919
// MARK: - init
2020
override init(frame: CGRect) {
@@ -39,63 +39,63 @@ import UIKit
3939
}
4040

4141
// MARK: - IBInspectable
42-
@IBInspectable var timeText: String? {
42+
@IBInspectable var time: String? {
4343
get {
44-
return time.text
44+
return timeLabel.text
4545
}
4646

4747
set {
48-
time.text = newValue
48+
timeLabel.text = newValue
4949
}
5050
}
5151

52-
@IBInspectable var iconText: String? {
52+
@IBInspectable var icon: String? {
5353
get {
54-
return icon.text
54+
return iconLabel.text
5555
}
5656

5757
set {
58-
icon.text = newValue
58+
iconLabel.text = newValue
5959
}
6060
}
6161

62-
@IBInspectable var temperatureText: String? {
62+
@IBInspectable var temperature: String? {
6363
get {
64-
return temperature.text
64+
return temperatureLabel.text
6565
}
6666

6767
set {
68-
temperature.text = newValue
68+
temperatureLabel.text = newValue
6969
}
7070
}
7171

7272
@IBInspectable var timeColor: UIColor {
7373
get {
74-
return time.textColor
74+
return timeLabel.textColor
7575
}
7676

7777
set {
78-
time.textColor = newValue
78+
timeLabel.textColor = newValue
7979
}
8080
}
8181

8282
@IBInspectable var iconColor: UIColor {
8383
get {
84-
return icon.textColor
84+
return iconLabel.textColor
8585
}
8686

8787
set {
88-
icon.textColor = newValue
88+
iconLabel.textColor = newValue
8989
}
9090
}
9191

9292
@IBInspectable var temperatureColor: UIColor {
9393
get {
94-
return temperature.textColor
94+
return temperatureLabel.textColor
9595
}
9696

9797
set {
98-
temperature.textColor = newValue
98+
temperatureLabel.textColor = newValue
9999
}
100100
}
101101

SwiftWeather/ForecastView.xib

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<objects>
1313
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ForecastView" customModule="SwiftWeather" customModuleProvider="target">
1414
<connections>
15-
<outlet property="icon" destination="FBM-RY-zwQ" id="uB8-oG-vxx"/>
16-
<outlet property="temperature" destination="6xK-hW-gim" id="PPN-gB-HNZ"/>
17-
<outlet property="time" destination="dWn-ZV-dZz" id="gZZ-Tg-TRZ"/>
15+
<outlet property="iconLabel" destination="FBM-RY-zwQ" id="lTz-7J-bkC"/>
16+
<outlet property="temperatureLabel" destination="6xK-hW-gim" id="fWn-n6-waY"/>
17+
<outlet property="timeLabel" destination="dWn-ZV-dZz" id="mpF-lZ-cXC"/>
1818
</connections>
1919
</placeholder>
2020
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>

SwiftWeather/WeatherViewController.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import UIKit
1010

1111
class WeatherViewController: UIViewController {
1212

13-
@IBOutlet weak var location: UILabel!
14-
@IBOutlet weak var icon: UILabel!
15-
@IBOutlet weak var temperature: UILabel!
16-
@IBOutlet var forecasts: [ForecastView]!
13+
@IBOutlet weak var locationLabel: UILabel!
14+
@IBOutlet weak var iconLabel: UILabel!
15+
@IBOutlet weak var temperatureLabel: UILabel!
16+
@IBOutlet var forecastViews: [ForecastView]!
1717

1818
override func viewDidLoad() {
1919
super.viewDidLoad()

0 commit comments

Comments
 (0)