7.8 Sample Project Tutorial 49
• Amend the View Controller Interface
• Create an IBOutlet for the two UITextView and link it as a Referencing Outlet to the UITextView on the story-
board
• Create an IBOutlet for the UILabel and link it as a Referencing Outlet to the UILabel on the storyboard
• Create the 5 IBAction for the buttons, and link them to the "Touch Up Inside" event on the storyboard buttons
import UIKit
class ViewController: UIViewController, IDT_NEO2_Delegate {
@IBOutlet weak var connectionStatus: UILabel!
@IBOutlet weak var lcdTextView: UITextView!
@IBOutlet weak var logTextView: UITextView!
@IBAction func getFirmware(sender: UIButton) {}
@IBAction func startMSR_CTLS(sender: UIButton) {}
@IBAction func startICCEMV(sender: UIButton) {}
@IBAction func completeICCEMV(sender: UIButton) {}
@IBAction func cancelTransaction(sender: UIButton) {}
}
Storyboard Source Code
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117"
systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"
useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="NEO2_Tutorial"
customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<navigationBar contentMode="scaleToFill"
translatesAutoresizingMaskIntoConstraints="NO" id="etO-Zq-HWr">
<rect key="frame" x="0.0" y="20" width="600" height="44"/>
<items>
<navigationItem title="NEO2 Tutorial" id="gtg-5k-9F0"/>
</items>
</navigationBar>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left"
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disconnected" textAlignment="center" lineBreakMode="
tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO"
translatesAutoresizingMaskIntoConstraints="NO" id="rZO-0f-qR3">
<rect key="frame" x="0.0" y="64" width="600" height="21"/>
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1"
colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1"
colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO"
id="ZFI-2h-07z">
<rect key="frame" x="0.0" y="84" width="600" height="114"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill"
contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation"
translatesAutoresizingMaskIntoConstraints="NO" id="tU5-uw-pz7">
<rect key="frame" x="8" y="8" width="112" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="112" id="
ewS-6U-IbJ"/>
IDTech iOS SDK Guide for NEO2 #80152802-001