7.8 Sample Project Tutorial
•
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,
@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"
<document
type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117"
systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"
useTraitCollections="YES"
<dependencies>
<deployment identifier="iOS"/>
<plugIn
identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
<capability
name="Constraints to layout margins"
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController
customModuleProvider="target"
<layoutGuides>
</layoutGuides>
<view
translatesAutoresizingMaskIntoConstraints="NO"
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disconnected" textAlignment="center"
tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO"
translatesAutoresizingMaskIntoConstraints="NO"
colorSpace="calibratedRGB"/>
colorSpace="calibratedRGB"/>
id="ZFI-2h-07z">
contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="midd
translatesAutoresizingMaskIntoConstraints="NO"
ewS-6U-IbJ"/>
IDTech iOS SDK Guide for NEO2 #80152802-001
IDT_NEO2_Delegate
standalone="no"?>
initialViewController="BYZ-38-t0r">
id="BYZ-38-t0r" customClass="ViewController" customModule="NEO2_Tutorial"
sceneMemberID="viewController">
<viewControllerLayoutGuide
<viewControllerLayoutGuide
key="view" contentMode="scaleToFill"
<rect
key="frame" x="0.0" y="0.0" width="600"
<autoresizingMask
key="autoresizingMask" widthSizable="YES"
<subviews>
<navigationBar
contentMode="scaleToFill"
<rect
key="frame" x="0.0" y="20" width="600"
<items>
<navigationItem
</items>
</navigationBar>
<label
opaque="NO" userInteractionEnabled="NO" contentMode="left"
<rect
key="frame" x="0.0" y="64" width="600"
<color
key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1"
<fontDescription
key="fontDescription" type="system"
<color
key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1"
<nil key="highlightedColor"/>
</label>
<view
contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO"
<rect
key="frame" x="0.0" y="84" width="600"
<subviews>
<button
opaque="NO" contentMode="scaleToFill"
<rect
key="frame" x="8" y="8" width="112"
<constraints>
<constraint
{
version="10085"/>
minToolsVersion="6.0"/>
type="top"
id="y3c-jy-aDJ"/>
type="bottom"
id="wfy-db-euE"/>
id="8bC-Xf-vdC">
height="600"/>
id="etO-Zq-HWr">
height="44"/>
title="NEO2 Tutorial"
id="gtg-5k-9F0"/>
id="rZO-0f-qR3">
height="21"/>
height="114"/>
id="tU5-uw-pz7">
firstAttribute="width" constant="112" id="
49
heightSizable="YES"/>
pointSize="17"/>
height="30"/>
lineBreak
Need help?
Do you have a question about the NEO2 and is the answer not in the manual?