6.7 Sample Project Tutorial 25
• Create the 5 IBAction for the buttons, and link them to the "Touch Up Inside" event on the storyboard buttons
#import <UIKit/UIKit.h>
#import <IDTech/IDTech.h>
@interface ViewController : UIViewController<IDT_NEO2_Delegate>
{
IBOutlet UITextView
*
lcdTextView;
IBOutlet UITextView
*
logTextView;
IBOutlet UILabel
*
connectedLabel;
}
-(IBAction) getFirmware:(id)sender;
-(IBAction) startBLE:(id)sender;
-(IBAction) startTransaction:(id)sender;
-(IBAction) completeEMV:(id)sender;
-(IBAction) cancelTransaction:(id)sender;
@property(nonatomic, strong) UITextView
*
lcdTextView;
@property(nonatomic, strong) UITextView
*
logTextView;
@property(nonatomic, strong) UILabel
*
connectedLabel;
@end
Storyboard Source Code
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121"
systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES"
useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController"
>
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left"
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NEO2 Disconnected" textAlignment="center"
lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO"
translatesAutoresizingMaskIntoConstraints="NO" id="eDI-cL-7k6">
<rect key="frame" x="16" y="20" width="378" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="GlQ-61-SfD"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1"
colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left"
horizontalHuggingPriority="251" verticalHuggingPriority="251" text="EMV LCD DISPLAY" textAlignment="center" lineBreakMode
="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO"
translatesAutoresizingMaskIntoConstraints="NO" id="oIl-91-J9y">
<rect key="frame" x="16" y="227" width="378" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="cli-EH-4sy"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1"
colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="
scaleToFill" editable="NO" text="LCD DISPLAY INFO" textAlignment="center" translatesAutoresizingMaskIntoConstraints="
NO" id="XfN-t5-Cxv">
<rect key="frame" x="16" y="256" width="378" height="128"/>
IDTech iOS SDK Guide for NEO2 #80152802-001