Skip to content

Commit bf738fa

Browse files
added Xamarin iOS sample
1 parent bf31cd5 commit bf738fa

12 files changed

+716
-0
lines changed

iOSClient/iOSClient.sln

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOSClient", "iOSClient\iOSClient.csproj", "{08B19331-8FBD-47C4-8473-3F74F3363E20}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|iPhoneSimulator = Debug|iPhoneSimulator
9+
Release|iPhone = Release|iPhone
10+
Release|iPhoneSimulator = Release|iPhoneSimulator
11+
Debug|iPhone = Debug|iPhone
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Debug|iPhone.ActiveCfg = Debug|iPhone
15+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Debug|iPhone.Build.0 = Debug|iPhone
16+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
17+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
18+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Release|iPhone.ActiveCfg = Release|iPhone
19+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Release|iPhone.Build.0 = Release|iPhone
20+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
21+
{08B19331-8FBD-47C4-8473-3F74F3363E20}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
22+
EndGlobalSection
23+
EndGlobal

iOSClient/iOSClient/AppDelegate.cs

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using Foundation;
2+
using UIKit;
3+
using System;
4+
5+
namespace iOSClient
6+
{
7+
// The UIApplicationDelegate for the application. This class is responsible for launching the
8+
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
9+
[Register ("AppDelegate")]
10+
public class AppDelegate : UIApplicationDelegate
11+
{
12+
// class-level declarations
13+
14+
public override UIWindow Window {
15+
get;
16+
set;
17+
}
18+
19+
public static Action<string> CallbackHandler { get; set;}
20+
21+
public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation)
22+
{
23+
CallbackHandler (url.AbsoluteString);
24+
CallbackHandler = null;
25+
26+
return true;
27+
}
28+
29+
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
30+
{
31+
// Override point for customization after application launch.
32+
// If not required for your application you can safely delete this method
33+
34+
return true;
35+
}
36+
37+
public override void OnResignActivation (UIApplication application)
38+
{
39+
// Invoked when the application is about to move from active to inactive state.
40+
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
41+
// or when the user quits the application and it begins the transition to the background state.
42+
// Games should use this method to pause the game.
43+
}
44+
45+
public override void DidEnterBackground (UIApplication application)
46+
{
47+
// Use this method to release shared resources, save user data, invalidate timers and store the application state.
48+
// If your application supports background exection this method is called instead of WillTerminate when the user quits.
49+
}
50+
51+
public override void WillEnterForeground (UIApplication application)
52+
{
53+
// Called as part of the transiton from background to active state.
54+
// Here you can undo many of the changes made on entering the background.
55+
}
56+
57+
public override void OnActivated (UIApplication application)
58+
{
59+
// Restart any tasks that were paused (or not yet started) while the application was inactive.
60+
// If the application was previously in the background, optionally refresh the user interface.
61+
}
62+
63+
public override void WillTerminate (UIApplication application)
64+
{
65+
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
66+
}
67+
}
68+
}
69+
70+
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
</dict>
6+
</plist>

iOSClient/iOSClient/Info.plist

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleName</key>
6+
<string>iOSClient</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>io.identitymodel.iosclient</string>
9+
<key>CFBundleShortVersionString</key>
10+
<string>1.0</string>
11+
<key>CFBundleVersion</key>
12+
<string>1.0</string>
13+
<key>LSRequiresIPhoneOS</key>
14+
<true/>
15+
<key>MinimumOSVersion</key>
16+
<string>9.0</string>
17+
<key>UIDeviceFamily</key>
18+
<array>
19+
<integer>1</integer>
20+
</array>
21+
<key>UILaunchStoryboardName</key>
22+
<string>LaunchScreen</string>
23+
<key>UIMainStoryboardFile</key>
24+
<string>Main</string>
25+
<key>UIRequiredDeviceCapabilities</key>
26+
<array>
27+
<string>armv7</string>
28+
</array>
29+
<key>UISupportedInterfaceOrientations</key>
30+
<array>
31+
<string>UIInterfaceOrientationPortrait</string>
32+
<string>UIInterfaceOrientationLandscapeLeft</string>
33+
<string>UIInterfaceOrientationLandscapeRight</string>
34+
</array>
35+
<key>XSAppIconAssets</key>
36+
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
37+
<key>CFBundleURLTypes</key>
38+
<array>
39+
<dict>
40+
<key>CFBundleURLSchemes</key>
41+
<array>
42+
<string>io.identitymodel.native</string>
43+
</array>
44+
</dict>
45+
</array>
46+
</dict>
47+
</plist>

iOSClient/iOSClient/Main.cs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using UIKit;
2+
3+
namespace iOSClient
4+
{
5+
public class Application
6+
{
7+
// This is the main entry point of the application.
8+
static void Main (string[] args)
9+
{
10+
// if you want to use a different Application Delegate class from "AppDelegate"
11+
// you can specify it here.
12+
UIApplication.Main (args, null, "AppDelegate");
13+
}
14+
}
15+
}

iOSClient/iOSClient/Main.storyboard

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
5+
</dependencies>
6+
<scenes>
7+
<!--View Controller-->
8+
<scene sceneID="tne-QT-ifu">
9+
<objects>
10+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
11+
<layoutGuides>
12+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
13+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
14+
</layoutGuides>
15+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
19+
<subviews>
20+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="3" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES">
21+
<rect key="frame" x="20" y="42" width="46" height="30"/>
22+
<state key="normal" title="Login">
23+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
24+
</state>
25+
</button>
26+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="4" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES">
27+
<rect key="frame" x="74" y="42" width="86" height="30"/>
28+
<state key="normal" title="Call API">
29+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
30+
</state>
31+
</button>
32+
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="7" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES">
33+
<rect key="frame" x="20" y="80" width="529" height="494"/>
34+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
35+
<fontDescription key="fontDescription" type="system" pointSize="14"/>
36+
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
37+
</textView>
38+
</subviews>
39+
</view>
40+
<connections>
41+
<outlet property="LoginButton" destination="3" id="name-outlet-3"/>
42+
<outlet property="CallApiButton" destination="4" id="name-outlet-4"/>
43+
<outlet property="OutputTextView" destination="7" id="name-outlet-7"/>
44+
</connections>
45+
</viewController>
46+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
47+
</objects>
48+
<point key="canvasLocation" x="0.0" y="0.0"/>
49+
</scene>
50+
</scenes>
51+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"images": [
3+
{
4+
"idiom": "iphone",
5+
"size": "29x29",
6+
"scale": "1x"
7+
},
8+
{
9+
"idiom": "iphone",
10+
"size": "29x29",
11+
"scale": "2x"
12+
},
13+
{
14+
"idiom": "iphone",
15+
"size": "29x29",
16+
"scale": "3x"
17+
},
18+
{
19+
"idiom": "iphone",
20+
"size": "40x40",
21+
"scale": "2x"
22+
},
23+
{
24+
"idiom": "iphone",
25+
"size": "40x40",
26+
"scale": "3x"
27+
},
28+
{
29+
"idiom": "iphone",
30+
"size": "57x57",
31+
"scale": "1x"
32+
},
33+
{
34+
"idiom": "iphone",
35+
"size": "57x57",
36+
"scale": "2x"
37+
},
38+
{
39+
"idiom": "iphone",
40+
"size": "60x60",
41+
"scale": "2x"
42+
},
43+
{
44+
"idiom": "iphone",
45+
"size": "60x60",
46+
"scale": "3x"
47+
},
48+
{
49+
"idiom": "ipad",
50+
"size": "29x29",
51+
"scale": "1x"
52+
},
53+
{
54+
"idiom": "ipad",
55+
"size": "29x29",
56+
"scale": "2x"
57+
},
58+
{
59+
"idiom": "ipad",
60+
"size": "40x40",
61+
"scale": "1x"
62+
},
63+
{
64+
"idiom": "ipad",
65+
"size": "40x40",
66+
"scale": "2x"
67+
},
68+
{
69+
"idiom": "ipad",
70+
"size": "50x50",
71+
"scale": "1x"
72+
},
73+
{
74+
"idiom": "ipad",
75+
"size": "50x50",
76+
"scale": "2x"
77+
},
78+
{
79+
"idiom": "ipad",
80+
"size": "72x72",
81+
"scale": "1x"
82+
},
83+
{
84+
"idiom": "ipad",
85+
"size": "72x72",
86+
"scale": "2x"
87+
},
88+
{
89+
"idiom": "ipad",
90+
"size": "76x76",
91+
"scale": "1x"
92+
},
93+
{
94+
"idiom": "ipad",
95+
"size": "76x76",
96+
"scale": "2x"
97+
},
98+
{
99+
"idiom": "car",
100+
"size": "120x120",
101+
"scale": "1x"
102+
},
103+
{
104+
"size": "24x24",
105+
"idiom": "watch",
106+
"scale": "2x",
107+
"role": "notificationCenter",
108+
"subtype": "38mm"
109+
},
110+
{
111+
"size": "27.5x27.5",
112+
"idiom": "watch",
113+
"scale": "2x",
114+
"role": "notificationCenter",
115+
"subtype": "42mm"
116+
},
117+
{
118+
"size": "29x29",
119+
"idiom": "watch",
120+
"role": "companionSettings",
121+
"scale": "2x"
122+
},
123+
{
124+
"size": "29x29",
125+
"idiom": "watch",
126+
"role": "companionSettings",
127+
"scale": "3x"
128+
},
129+
{
130+
"size": "40x40",
131+
"idiom": "watch",
132+
"scale": "2x",
133+
"role": "appLauncher",
134+
"subtype": "38mm"
135+
},
136+
{
137+
"size": "44x44",
138+
"idiom": "watch",
139+
"scale": "2x",
140+
"role": "longLook",
141+
"subtype": "42mm"
142+
},
143+
{
144+
"size": "86x86",
145+
"idiom": "watch",
146+
"scale": "2x",
147+
"role": "quickLook",
148+
"subtype": "38mm"
149+
},
150+
{
151+
"size": "98x98",
152+
"idiom": "watch",
153+
"scale": "2x",
154+
"role": "quickLook",
155+
"subtype": "42mm"
156+
}
157+
],
158+
"info": {
159+
"version": 1,
160+
"author": "xcode"
161+
}
162+
}

0 commit comments

Comments
 (0)