52 Core Implementation NEO2: Swift
<constraint firstItem="MFI-aU-Awe" firstAttribute="leading" secondItem=
"Y4B-gd-hVo" secondAttribute="leading" constant="8" id="JT5-MI-88R"/>
<constraint firstItem="8IP-lE-FQE" firstAttribute="top" secondItem="
Y4B-gd-hVo" secondAttribute="top" id="QDs-Pg-soH"/>
<constraint firstItem="RTX-Hq-mMT" firstAttribute="leading" secondItem=
"Y4B-gd-hVo" secondAttribute="leading" constant="8" id="X2o-dk-ffd"/>
<constraint firstItem="RTX-Hq-mMT" firstAttribute="height" secondItem="
MFI-aU-Awe" secondAttribute="height" id="aOL-Ir-y48"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom"
customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="etO-Zq-HWr" firstAttribute="leading" secondItem="
8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-20" id="569-PZ-U8Q"/>
<constraint firstAttribute="trailingMargin" secondItem="rZO-0f-qR3"
secondAttribute="trailing" constant="-20" id="7Hr-mA-xXY"/>
<constraint firstItem="rZO-0f-qR3" firstAttribute="leading" secondItem="
8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-20" id="CDb-2X-s6Q"/>
<constraint firstAttribute="trailingMargin" secondItem="Y4B-gd-hVo"
secondAttribute="trailing" constant="-20" id="FoY-PQ-8gC"/>
<constraint firstAttribute="trailingMargin" secondItem="ZFI-2h-07z"
secondAttribute="trailing" constant="-20" id="HYU-Az-cXm"/>
<constraint firstItem="Y4B-gd-hVo" firstAttribute="top" secondItem="ZFI-2h-07z"
secondAttribute="bottom" constant="8" id="LZS-v7-y1M"/>
<constraint firstItem="ZFI-2h-07z" firstAttribute="top" secondItem="etO-Zq-HWr"
secondAttribute="bottom" constant="20" id="Pcm-zb-zXS"/>
<constraint firstAttribute="trailingMargin" secondItem="etO-Zq-HWr"
secondAttribute="trailing" constant="-20" id="S1d-up-ufn"/>
<constraint firstItem="Y4B-gd-hVo" firstAttribute="leading" secondItem="
8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-20" id="fxv-DL-Ql8"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="Y4B-gd-hVo"
secondAttribute="bottom" id="l4D-dJ-DrY"/>
<constraint firstItem="etO-Zq-HWr" firstAttribute="top" secondItem="y3c-jy-aDJ"
secondAttribute="bottom" id="pfJ-Fb-EWV"/>
<constraint firstItem="rZO-0f-qR3" firstAttribute="top" secondItem="etO-Zq-HWr"
secondAttribute="bottom" id="vXY-dJ-IM4"/>
<constraint firstItem="ZFI-2h-07z" firstAttribute="leading" secondItem="
8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-20" id="y5F-nP-7CB"/>
</constraints>
</view>
<connections>
<outlet property="connectionStatus" destination="rZO-0f-qR3" id="8PR-rE-l6S"/>
<outlet property="lcdTextView" destination="MFI-aU-Awe" id="Hzq-Kn-xTJ"/>
<outlet property="logTextView" destination="RTX-Hq-mMT" id="NRT-pZ-ik7"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="
firstResponder"/>
</objects>
<point key="canvasLocation" x="698" y="449"/>
</scene>
</scenes>
</document>
7.8.5 Step 5: Finalize the View Controller File
In the view controller file, perform the following:
• Set delegate and initialize IDT_NEO2 singleton object in the viewDidLoad method. To automatically
connect to BLE, enter the friendly name of the device Reference: Allocate/Initialize IDT_NEO2 Object
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
IDT_NEO2.sharedController().delegate = self
IDT_NEO2.sharedController().device_setBLEFriendlyName("VP-2722"); //set to
device ble name
IDT_NEO2.sharedController().device_enableBLEDeviceSearch(nil);
}
#80152504-001 IDTech iOS SDK Guide for NEO2