<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.phidgets.com/docs/index.php?action=history&amp;feed=atom&amp;title=Template%3APT3_OBJC_IOS_XCODE</id>
	<title>Template:PT3 OBJC IOS XCODE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.phidgets.com/docs/index.php?action=history&amp;feed=atom&amp;title=Template%3APT3_OBJC_IOS_XCODE"/>
	<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Template:PT3_OBJC_IOS_XCODE&amp;action=history"/>
	<updated>2026-05-06T23:05:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Template:PT3_OBJC_IOS_XCODE&amp;diff=34851&amp;oldid=prev</id>
		<title>Mparadis at 21:40, 17 December 2024</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Template:PT3_OBJC_IOS_XCODE&amp;diff=34851&amp;oldid=prev"/>
		<updated>2024-12-17T21:40:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:40, 17 December 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;First, make sure you have the following installed:&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;First, make sure you have the following installed:&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;● Phidgets Drivers for &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;MacOS &lt;/del&gt;on your development machine &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(see Part 1 of this user guide)&lt;/del&gt;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;● &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;span&amp;gt;[https://www.phidgets.com/docs/OS_-_macOS &lt;/ins&gt;Phidgets Drivers for &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;macOS]&amp;lt;/span&amp;gt; &lt;/ins&gt;on your development machine&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;● &amp;lt;span&amp;gt;[https://developer.apple.com/xcode/ Xcode]&amp;lt;/span&amp;gt; from the Mac App Store&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;● &amp;lt;span&amp;gt;[https://developer.apple.com/xcode/ Xcode]&amp;lt;/span&amp;gt; from the Mac App Store&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mparadis</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Template:PT3_OBJC_IOS_XCODE&amp;diff=32425&amp;oldid=prev</id>
		<title>Mparadis: Created page with &quot;&lt;div class=&quot;phd-slide-deck&quot; data-deck=&quot;PT3_OBJC_IOS_XCODE&quot;&gt; &lt;div class=&quot;phd-slide-deck-header&quot;&gt;&lt;h3&gt;Language - Objective C&lt;/h3&gt;&lt;/div&gt; &lt;div class=&quot;phd-slides&quot;&gt; &lt;div class=&quot;phd-s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Template:PT3_OBJC_IOS_XCODE&amp;diff=32425&amp;oldid=prev"/>
		<updated>2021-03-08T21:46:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;div class=&amp;quot;phd-slide-deck&amp;quot; data-deck=&amp;quot;PT3_OBJC_IOS_XCODE&amp;quot;&amp;gt; &amp;lt;div class=&amp;quot;phd-slide-deck-header&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;Language - Objective C&amp;lt;/h3&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;div class=&amp;quot;phd-slides&amp;quot;&amp;gt; &amp;lt;div class=&amp;quot;phd-s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;phd-slide-deck&amp;quot; data-deck=&amp;quot;PT3_OBJC_IOS_XCODE&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide-deck-header&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;Language - Objective C&amp;lt;/h3&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slides&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;iOS with Xcode&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panels&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-center phd-flex-column-justify-middle&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/200x-/50/xcode.jpg&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-left phd-flex-column-justify-top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Welcome to using Phidgets with Objective C! By using Objective C, you will have access to the complete Phidget22 API, including events.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Xcode is an IDE provided by Apple that can be used to develop code in a wide variety of programming languages, including Objective C.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Requirements&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;First, make sure you have the following installed:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● Phidgets Drivers for MacOS on your development machine (see Part 1 of this user guide)&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● &amp;lt;span&amp;gt;[https://developer.apple.com/xcode/ Xcode]&amp;lt;/span&amp;gt; from the Mac App Store&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next, download and unpack the Phidget libraries for iOS development&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● &amp;lt;span&amp;gt;[https://www.phidgets.com/downloads/phidget22/libraries/ios/Phidget22_iOS.zip Phidget iOS Libraries]&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You will later need to reference these files from your Xcode project in order to use Phidgets.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next, download the Objective-C example:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● &amp;lt;span&amp;gt;[https://www.phidgets.com/?view=code_samples&amp;amp;lang=Objective-C Objective-C Example]&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Unpack the Objective-C example and navigate to &amp;lt;b&amp;gt;Phidget.xcodeproj&amp;lt;/b&amp;gt;. Open the file in Xcode:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/Objectivec_open.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;With &amp;lt;b&amp;gt;Phidgets&amp;lt;/b&amp;gt; as your target, navigate to Build Settings and find the &amp;lt;b&amp;gt;Header Search Paths&amp;lt;/b&amp;gt; setting:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/Ios_header.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The header file phidget22.h was included in the Phidget iOS libraries download. Add a reference to the folder that contains phidget22.h under the&lt;br /&gt;
&amp;lt;b&amp;gt;Header Search Paths&amp;lt;/b&amp;gt; setting:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x325/50/Ios_header_path.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next, find the &amp;lt;b&amp;gt;Other Linker Flags&amp;lt;/b&amp;gt; setting:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/800x-/50/Ios_linker.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Add a reference to the Phidget libraries that were included in the Phidget iOS libraries download:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x350/50/Ios_linker_path.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Use Our Examples&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Now that the library files are linked, simply select the type of device you would like the application to run on and press play:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x325/50/Ios_simulator.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The application will detect any servers that are currently online and have Phidgets connected. Here is an example output:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panels&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-center phd-flex-column-justify-top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x300/50/Ios_PhidgetApp_MainScreen.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-left phd-flex-column-justify-top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
First, confirm that the Phidgets Example is working. Then, run the example for your specific device by selecting your server and then continue to navigate&lt;br /&gt;
through the hierarchy until you reach your device. After tapping your device, the example will show automatically. Currently, we have example programs for the&lt;br /&gt;
following classes:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;DigitalInput&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;DigitalOutput&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;VoltageInput&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;VoltageRatioInput&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here is an example of what the VoltageInput example looks like:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panels&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-center phd-flex-column-justify-top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x300/50/Ios_example_run.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-panel phd-flex-column-align-left phd-flex-column-justify-top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
You should now have the example up and running for your device. Play around with the device and experiment with some of the functionality. When you are ready,&lt;br /&gt;
the next step is configuring your project and writing your own code!&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Configure Your Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
When you are building a project from scratch, or adding Phidgets to an existing project, you&amp;#039;ll need to configure your development environment to properly link&lt;br /&gt;
the Phidget iOS library. To begin, create a new Xcode project:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x325/50/Cocoa_CreateProject.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Configure Your Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Select an iOS application. For this tutorial&amp;#039;s purposes, we will use a Single View Application:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x350/50/IOS_SingleView.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Configure Your Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Name the project, select Objective-C as the language, and choose which devices will be supported:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-lazy-image&amp;quot; data-src=&amp;quot;https://www.phidgets.com/decks/PT3_OBJC_IOS_XCODE/-x350/50/IOS_NameProject_objc.png&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Configure Your Project&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Now that your project is created, you need to add references to the Phidget iOS libraries in the same way you added them to run our example code earlier in this&lt;br /&gt;
guide.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;After you have linked the Phidget iOS libraries, simply add a reference to phidget22.h in your header file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;#import &amp;lt;Phidget22/phidget22.h&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Success! The project now has access to Phidgets and we are ready to begin coding.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Remember: your main reference for writing Objective C code will be:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● The &amp;lt;span&amp;gt;[https://www.phidgets.com/?view=api Phidget22 API]&amp;lt;/span&amp;gt; Manual (select &amp;#039;C&amp;#039; as the language)&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;● Objective C &amp;lt;span&amp;gt;[https://www.phidgets.com/?view=code_samples&amp;amp;lang=Objective-C example code]&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step One: Initialize and Open&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You will need to declare your Phidget object in your code. For example, we can declare a digital input object like this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;PhidgetDigitalInput ch;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next, the Phidget object needs to be initialized and opened.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
PhidgetDigitalInput_create(&amp;amp;ch);&lt;br /&gt;
Phidget_open((PhidgetHandle)ch);&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step One: Initialize and Open&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;We won&amp;#039;t go into detail on it in this guide, but this is the previous code with error handling:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
PhidgetReturnCode res;&lt;br /&gt;
const char* errorString;&lt;br /&gt;
&lt;br /&gt;
res = PhidgetDigitalInput_create(&amp;amp;ch);&lt;br /&gt;
if(res != EPHIDGET_OK){&lt;br /&gt;
  Phidget_getErrorDescription ( returnValue, &amp;amp;errorString );&lt;br /&gt;
  NSLog(@&amp;quot;Handle error here&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
res = Phidget_open((PhidgetHandle)ch);&lt;br /&gt;
if(res != EPHIDGET_OK){&lt;br /&gt;
  Phidget_getErrorDescription ( returnValue, &amp;amp;errorString );&lt;br /&gt;
   NSLog(@&amp;quot;Handle error here&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step Two: Wait for Attachment of the Phidget&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Simply calling open does not guarantee you can use the Phidget immediately. To use a Phidget, it must be plugged in (attached). We can handle this by using&lt;br /&gt;
event driven programming and tracking the attach events. Alternatively, we can modify our code so we wait for an attachment:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
PhidgetDigitalInput_create(&amp;amp;ch);&lt;br /&gt;
Phidget_openWaitForAttachment(ch, 5000);&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Waiting for attachment will block indefinitely until a connection is made, or until the timeout value is exceeded.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To use events to handle attachments, we have to modify our code slightly:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
PhidgetDigitalInput_create(&amp;amp;ch);&lt;br /&gt;
Phidget_setOnAttachHandler((PhidgetHandle)ch,gotAttach,(__bridge void*)self);&lt;br /&gt;
Phidget_open((PhidgetHandle)ch);&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step Two: Wait for Attachment of the Phidget&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Next, we have to declare the function that will be called when an attach event is fired - in this case the function &amp;lt;b&amp;gt;gotAttach&amp;lt;/b&amp;gt; will be called:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
static void gotAttach(PhidgetHandle phid, void *context){&lt;br /&gt;
    [(__bridge id)context performSelectorOnMainThread:@selector(deviceAttached)&lt;br /&gt;
                                           withObject:nil&lt;br /&gt;
                                        waitUntilDone:NO];&lt;br /&gt;
}&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step Three: Do Things with the Phidget&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
We recommend the use of event driven programming when working with Phidgets. In a similar way to handling an attach event as described above, we can also add an&lt;br /&gt;
event handler for a state change event:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
PhidgetDigitalInput_create(&amp;amp;ch);&lt;br /&gt;
Phidget_setOnAttachHandler((PhidgetHandle)ch,gotAttach,(__bridge void*)self);&lt;br /&gt;
PhidgetDigitalInput_setOnStateChangeHandler(ch, gotStateChange, (__bridge void*)self);&lt;br /&gt;
Phidget_open((PhidgetHandle)ch);&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This code will connect a function and an event. In this case, the &amp;lt;b&amp;gt;gotStateChange&amp;lt;/b&amp;gt; function will be called when there has been a change to the devices&lt;br /&gt;
input. Next, we need to create the &amp;lt;b&amp;gt;gotStateChange&amp;lt;/b&amp;gt; function.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
void gotStateChange(PhidgetDigitalInputHandle phid, void *context, int state){&lt;br /&gt;
        [(__bridge id)context performSelectorOnMainThread:@selector(onStateChangeHandler:)&lt;br /&gt;
                                               withObject:[NSNumber numberWithInt:state]&lt;br /&gt;
                                            waitUntilDone:NO];&lt;br /&gt;
}&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Above, the onStateChangeHandler method is invoked on the main thread. Event data is stored as an NSNumber.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step Three: Do Things with the Phidget&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The method &amp;lt;b&amp;gt;onStateChangeHandler&amp;lt;/b&amp;gt; is defined as follows:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
- (void)onStateChangeHandler:(NSNumber *)state{&lt;br /&gt;
    if(state.intValue)&lt;br /&gt;
        stateTextField.stringValue = @&amp;quot;True&amp;quot;;&lt;br /&gt;
    else&lt;br /&gt;
        stateTextField.stringValue = @&amp;quot;False&amp;quot;;&lt;br /&gt;
}&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If events do not suit your needs, you can also poll the device directly for data using code like this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
int state;&lt;br /&gt;
&lt;br /&gt;
PhidgetDigitalInput_getState(ch, &amp;amp;state);&lt;br /&gt;
stateTextField.stringValue = [NSString stringWithFormat:@&amp;quot;%@&amp;quot;, state ? @&amp;quot;True&amp;quot; : @&amp;quot;False&amp;quot;];&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;Write Code&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Step Four: Close and Delete&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;At the end of your program, be sure to close and delete your device:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre data-syntax-language=&amp;quot;objectivec&amp;quot;&amp;gt;&lt;br /&gt;
Phidget_close((PhidgetHandle)ch);&lt;br /&gt;
PhidgetDigitalInput_delete(&amp;amp;ch);&amp;lt;/pre&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-slide&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt;What&amp;#039;s Next?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;{{Slide_Deck_PT3_Outro}}&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-navigation-buttons&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-simple-button phd-to-slide-button&amp;quot; data-navigation-direction=&amp;quot;prev&amp;quot;&amp;gt;«&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-progress-container&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-progress-bar&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-progress-slide-info&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;phd-simple-button phd-to-slide-button&amp;quot; data-navigation-direction=&amp;quot;next&amp;quot;&amp;gt;»&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div hidden class=&amp;quot;phd-hidden-breadcrumb-label&amp;quot; data-label=&amp;quot;Xcode&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mparadis</name></author>
	</entry>
</feed>