Skip to content

Commit 4faa371

Browse files
committed
Merge pull request #112 from Redth/master
Updated iOS Unified API Support
2 parents b966bf7 + 8886c5d commit 4faa371

11 files changed

+68
-61
lines changed

component/component.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%YAML 1.2
22
---
33
name: ModernHttpClient
4-
version: 2.1.4
4+
version: 2.1.5
55
id: "modernhttpclient"
66
publisher: Paul Betts
77
publisher-url: http://blog.paulbetts.org/
@@ -21,7 +21,7 @@ libraries:
2121
- ../build/MonoAndroid/OkHttp.dll
2222
- ../build/MonoAndroid/ModernHttpClient.dll
2323
samples:
24-
- name: "HttpClient.iOS Classic API Sample"
24+
- name: "HttpClient.iOS Unified API Sample"
2525
path: ../samples/HttpClient.iOS/HttpClient.iOS.sln
2626
- name: "HttpClient.Android Sample"
2727
path: ../samples/HttpClient.Android/HttpClient.Android.sln

samples/HttpClient.iOS/DotNet.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
using System;
1010
using System.Net;
11-
using MonoTouch.Foundation;
11+
using Foundation;
1212
using System.Security.Cryptography.X509Certificates;
1313
using System.Diagnostics;
1414

samples/HttpClient.iOS/HttpClient.csproj

+12-9
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
6-
<ProductVersion>9.0.21022</ProductVersion>
6+
<ProductVersion>8.0.30703</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
88
<ProjectGuid>{A7833601-70B7-4E22-8CEC-0B822863286D}</ProjectGuid>
9-
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
9+
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1010
<OutputType>Exe</OutputType>
1111
<AssemblyName>HttpClient</AssemblyName>
12+
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
13+
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
1214
</PropertyGroup>
1315
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
1416
<DebugSymbols>True</DebugSymbols>
@@ -23,7 +25,7 @@
2325
<MtouchSdkVersion>7.0</MtouchSdkVersion>
2426
<MtouchI18n>
2527
</MtouchI18n>
26-
<MtouchArch>ARMv7</MtouchArch>
28+
<MtouchArch>ARMv7, ARM64</MtouchArch>
2729
</PropertyGroup>
2830
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
2931
<DebugType>none</DebugType>
@@ -47,7 +49,7 @@
4749
</IpaPackageName>
4850
<MtouchI18n>
4951
</MtouchI18n>
50-
<MtouchArch>ARMv7</MtouchArch>
52+
<MtouchArch>ARMv7, ARM64</MtouchArch>
5153
</PropertyGroup>
5254
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
5355
<DebugType>none</DebugType>
@@ -56,16 +58,17 @@
5658
<ErrorReport>prompt</ErrorReport>
5759
<WarningLevel>4</WarningLevel>
5860
<CodesignKey>iPhone Developer</CodesignKey>
61+
<MtouchArch>ARMv7, ARM64</MtouchArch>
5962
</PropertyGroup>
6063
<ItemGroup>
6164
<Reference Include="System" />
6265
<Reference Include="System.Xml" />
6366
<Reference Include="System.Core" />
64-
<Reference Include="monotouch" />
6567
<Reference Include="System.Xml.Linq" />
6668
<Reference Include="System.Net.Http" />
67-
<Reference Include="ModernHttpClient.iOS">
68-
<HintPath>..\..\build\MonoTouch\ModernHttpClient.dll</HintPath>
69+
<Reference Include="Xamarin.iOS" />
70+
<Reference Include="ModernHttpClient">
71+
<HintPath>..\..\build\Xamarin.iOS10\ModernHttpClient.dll</HintPath>
6972
</Reference>
7073
</ItemGroup>
7174
<ItemGroup>
@@ -78,9 +81,8 @@
7881
<Compile Include="NetHttp.cs" />
7982
</ItemGroup>
8083
<ItemGroup>
81-
<InterfaceDefinition Include="MainWindow.xib" xmlns="" />
84+
<InterfaceDefinition Include="MainWindow.xib" />
8285
</ItemGroup>
83-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
8486
<ItemGroup>
8587
<None Include="Info.plist" />
8688
</ItemGroup>
@@ -108,4 +110,5 @@
108110
<ItemGroup>
109111
<ITunesArtwork Include="Resources\iTunesArtwork.png" />
110112
</ItemGroup>
113+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
111114
</Project>

samples/HttpClient.iOS/Main.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
using System;
88
using System.IO;
99
using System.Linq;
10-
using System.Drawing;
11-
using MonoTouch.Foundation;
12-
using MonoTouch.UIKit;
10+
using CoreGraphics;
11+
using Foundation;
12+
using UIKit;
1313
using System.Net.Http;
1414
using System.Xml;
1515
using System.Xml.XPath;
@@ -86,10 +86,10 @@ public void RenderStream (Stream stream)
8686
InvokeOnMainThread (delegate {
8787
var view = new UIViewController ();
8888
view.View.BackgroundColor = UIColor.White;
89-
var label = new UILabel (new RectangleF (20, 60, 300, 80)){
89+
var label = new UILabel (new CGRect (20, 60, 300, 80)){
9090
Text = "The HTML returned by the server:"
9191
};
92-
var tv = new UITextView (new RectangleF (20, 140, 300, 400)){
92+
var tv = new UITextView (new CGRect (20, 140, 300, 400)){
9393
Text = reader.ReadToEnd ()
9494
};
9595
view.Add (label);

samples/HttpClient.iOS/MainWindow.xib.designer.cs

+17-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/HttpClient.iOS/TableViewRocks.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
using System;
3-
using MonoTouch.UIKit;
4-
using MonoTouch.Foundation;
3+
using UIKit;
4+
using Foundation;
55

66
namespace HttpClient
77
{
@@ -28,12 +28,12 @@ public string [] Source {
2828
}
2929
}
3030

31-
public override int NumberOfSections (UITableView tableView)
31+
public override nint NumberOfSections (UITableView tableView)
3232
{
3333
return 1;
3434
}
3535

36-
public override int RowsInSection (UITableView tableView, int section)
36+
public override nint RowsInSection (UITableView tableView, nint section)
3737
{
3838
return source.Length;
3939
}

src/Playground.iOS/AppDelegate.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using MonoTouch.Foundation;
5-
using MonoTouch.UIKit;
4+
using Foundation;
5+
using UIKit;
66

77
namespace Playground.iOS
88
{

src/Playground.iOS/Main.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using MonoTouch.Foundation;
5-
using MonoTouch.UIKit;
4+
using Foundation;
5+
using UIKit;
66

77
namespace Playground.iOS
88
{

src/Playground.iOS/Playground.iOS.csproj

+12-8
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
<ProductVersion>8.0.30703</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
88
<ProjectGuid>{2CE837CD-9B97-4058-9156-339697EEE228}</ProjectGuid>
9-
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
9+
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1010
<OutputType>Exe</OutputType>
1111
<RootNamespace>Playground.iOS</RootNamespace>
1212
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
1313
<AssemblyName>PlaygroundiOS</AssemblyName>
14+
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
15+
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
1416
</PropertyGroup>
1517
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
1618
<DebugSymbols>true</DebugSymbols>
@@ -28,7 +30,7 @@
2830
<MtouchUseRefCounting>true</MtouchUseRefCounting>
2931
<MtouchI18n>
3032
</MtouchI18n>
31-
<MtouchArch>i386</MtouchArch>
33+
<MtouchArch>i386, ARM64</MtouchArch>
3234
</PropertyGroup>
3335
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
3436
<DebugType>full</DebugType>
@@ -56,7 +58,7 @@
5658
</IpaPackageName>
5759
<MtouchI18n>
5860
</MtouchI18n>
59-
<MtouchArch>ARMv7</MtouchArch>
61+
<MtouchArch>ARMv7, ARM64</MtouchArch>
6062
<MtouchSdkVersion>8.0</MtouchSdkVersion>
6163
</PropertyGroup>
6264
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
@@ -68,6 +70,7 @@
6870
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
6971
<ConsolePause>false</ConsolePause>
7072
<CodesignKey>iPhone Developer</CodesignKey>
73+
<MtouchArch>ARMv7, ARM64</MtouchArch>
7174
</PropertyGroup>
7275
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
7376
<DebugType>full</DebugType>
@@ -80,6 +83,7 @@
8083
<BuildIpa>true</BuildIpa>
8184
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
8285
<CodesignKey>iPhone Distribution</CodesignKey>
86+
<MtouchArch>ARMv7, ARM64</MtouchArch>
8387
</PropertyGroup>
8488
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
8589
<DebugType>full</DebugType>
@@ -91,16 +95,17 @@
9195
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
9296
<ConsolePause>false</ConsolePause>
9397
<CodesignProvision>Automatic:AppStore</CodesignProvision>
98+
<MtouchArch>ARMv7, ARM64</MtouchArch>
9499
</PropertyGroup>
95100
<ItemGroup>
96101
<Reference Include="System" />
97102
<Reference Include="System.Xml" />
98103
<Reference Include="System.Core" />
99-
<Reference Include="monotouch" />
100104
<Reference Include="System.Net.Http" />
101105
<Reference Include="Newtonsoft.Json">
102106
<HintPath>..\..\ext\monotouch\Newtonsoft.Json.dll</HintPath>
103107
</Reference>
108+
<Reference Include="Xamarin.iOS" />
104109
</ItemGroup>
105110
<ItemGroup>
106111
<Folder Include="Resources\" />
@@ -120,12 +125,11 @@
120125
<ItemGroup>
121126
<InterfaceDefinition Include="Playground_iOSViewController.xib" />
122127
</ItemGroup>
123-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
124128
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
125129
<ItemGroup>
126-
<ProjectReference Include="..\ModernHttpClient\ModernHttpClient.iOS.csproj">
127-
<Project>{0F2A1CC8-4168-4CB4-B334-28C28BA51ECB}</Project>
128-
<Name>ModernHttpClient.iOS</Name>
130+
<ProjectReference Include="..\ModernHttpClient\ModernHttpClient.iOS64.csproj">
131+
<Project>{6941F069-AC02-40EE-BBF3-9FE3331030EF}</Project>
132+
<Name>ModernHttpClient.iOS64</Name>
129133
</ProjectReference>
130134
</ItemGroup>
131135
</Project>

src/Playground.iOS/Playground_iOSViewController.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using System.Drawing;
3-
using MonoTouch.Foundation;
4-
using MonoTouch.UIKit;
2+
using CoreGraphics;
3+
using Foundation;
4+
using UIKit;
55
using System.Net.Http;
66
using System.Threading;
77
using System.Diagnostics;
@@ -54,7 +54,7 @@ public Playground_iOSViewController () : base ("Playground_iOSViewController", n
5454
CancellationTokenSource currentToken;
5555
HttpResponseMessage resp;
5656

57-
partial void cancelIt (MonoTouch.Foundation.NSObject sender)
57+
partial void cancelIt (Foundation.NSObject sender)
5858
{
5959
this.currentToken.Cancel();
6060
if (resp != null) resp.Content.Dispose();
@@ -70,7 +70,7 @@ void HandleDownloadProgress(long bytes, long totalBytes, long totalBytesExpected
7070
});
7171
}
7272

73-
async partial void doIt (MonoTouch.Foundation.NSObject sender)
73+
async partial void doIt (Foundation.NSObject sender)
7474
{
7575
var handler = new NativeMessageHandler();
7676
var client = new HttpClient(handler);

src/Playground.iOS/Playground_iOSViewController.designer.cs

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)