Skip to content

Commit

Permalink
Merge pull request #112 from Redth/master
Browse files Browse the repository at this point in the history
Updated iOS Unified API Support
  • Loading branch information
anaisbetts committed Dec 16, 2014
2 parents b966bf7 + 8886c5d commit 4faa371
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 61 deletions.
4 changes: 2 additions & 2 deletions component/component.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%YAML 1.2
---
name: ModernHttpClient
version: 2.1.4
version: 2.1.5
id: "modernhttpclient"
publisher: Paul Betts
publisher-url: http://blog.paulbetts.org/
Expand All @@ -21,7 +21,7 @@ libraries:
- ../build/MonoAndroid/OkHttp.dll
- ../build/MonoAndroid/ModernHttpClient.dll
samples:
- name: "HttpClient.iOS Classic API Sample"
- name: "HttpClient.iOS Unified API Sample"
path: ../samples/HttpClient.iOS/HttpClient.iOS.sln
- name: "HttpClient.Android Sample"
path: ../samples/HttpClient.Android/HttpClient.Android.sln
Expand Down
2 changes: 1 addition & 1 deletion samples/HttpClient.iOS/DotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using System;
using System.Net;
using MonoTouch.Foundation;
using Foundation;
using System.Security.Cryptography.X509Certificates;
using System.Diagnostics;

Expand Down
21 changes: 12 additions & 9 deletions samples/HttpClient.iOS/HttpClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A7833601-70B7-4E22-8CEC-0B822863286D}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<AssemblyName>HttpClient</AssemblyName>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>True</DebugSymbols>
Expand All @@ -23,7 +25,7 @@
<MtouchSdkVersion>7.0</MtouchSdkVersion>
<MtouchI18n>
</MtouchI18n>
<MtouchArch>ARMv7</MtouchArch>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
Expand All @@ -47,7 +49,7 @@
</IpaPackageName>
<MtouchI18n>
</MtouchI18n>
<MtouchArch>ARMv7</MtouchArch>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
Expand All @@ -56,16 +58,17 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Net.Http" />
<Reference Include="ModernHttpClient.iOS">
<HintPath>..\..\build\MonoTouch\ModernHttpClient.dll</HintPath>
<Reference Include="Xamarin.iOS" />
<Reference Include="ModernHttpClient">
<HintPath>..\..\build\Xamarin.iOS10\ModernHttpClient.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -78,9 +81,8 @@
<Compile Include="NetHttp.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainWindow.xib" xmlns="" />
<InterfaceDefinition Include="MainWindow.xib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
Expand Down Expand Up @@ -108,4 +110,5 @@
<ItemGroup>
<ITunesArtwork Include="Resources\iTunesArtwork.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
10 changes: 5 additions & 5 deletions samples/HttpClient.iOS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
using System;
using System.IO;
using System.Linq;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using CoreGraphics;
using Foundation;
using UIKit;
using System.Net.Http;
using System.Xml;
using System.Xml.XPath;
Expand Down Expand Up @@ -86,10 +86,10 @@ public void RenderStream (Stream stream)
InvokeOnMainThread (delegate {
var view = new UIViewController ();
view.View.BackgroundColor = UIColor.White;
var label = new UILabel (new RectangleF (20, 60, 300, 80)){
var label = new UILabel (new CGRect (20, 60, 300, 80)){
Text = "The HTML returned by the server:"
};
var tv = new UITextView (new RectangleF (20, 140, 300, 400)){
var tv = new UITextView (new CGRect (20, 140, 300, 400)){
Text = reader.ReadToEnd ()
};
view.Add (label);
Expand Down
34 changes: 17 additions & 17 deletions samples/HttpClient.iOS/MainWindow.xib.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions samples/HttpClient.iOS/TableViewRocks.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using UIKit;
using Foundation;

namespace HttpClient
{
Expand All @@ -28,12 +28,12 @@ public string [] Source {
}
}

public override int NumberOfSections (UITableView tableView)
public override nint NumberOfSections (UITableView tableView)
{
return 1;
}

public override int RowsInSection (UITableView tableView, int section)
public override nint RowsInSection (UITableView tableView, nint section)
{
return source.Length;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Playground.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;

namespace Playground.iOS
{
Expand Down
4 changes: 2 additions & 2 deletions src/Playground.iOS/Main.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;

namespace Playground.iOS
{
Expand Down
20 changes: 12 additions & 8 deletions src/Playground.iOS/Playground.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2CE837CD-9B97-4058-9156-339697EEE228}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Playground.iOS</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>PlaygroundiOS</AssemblyName>
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -28,7 +30,7 @@
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchI18n>
</MtouchI18n>
<MtouchArch>i386</MtouchArch>
<MtouchArch>i386, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>full</DebugType>
Expand Down Expand Up @@ -56,7 +58,7 @@
</IpaPackageName>
<MtouchI18n>
</MtouchI18n>
<MtouchArch>ARMv7</MtouchArch>
<MtouchArch>ARMv7, ARM64</MtouchArch>
<MtouchSdkVersion>8.0</MtouchSdkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
Expand All @@ -68,6 +70,7 @@
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>full</DebugType>
Expand All @@ -80,6 +83,7 @@
<BuildIpa>true</BuildIpa>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>full</DebugType>
Expand All @@ -91,16 +95,17 @@
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<MtouchArch>ARMv7, ARM64</MtouchArch>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="System.Net.Http" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\ext\monotouch\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
Expand All @@ -120,12 +125,11 @@
<ItemGroup>
<InterfaceDefinition Include="Playground_iOSViewController.xib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\ModernHttpClient\ModernHttpClient.iOS.csproj">
<Project>{0F2A1CC8-4168-4CB4-B334-28C28BA51ECB}</Project>
<Name>ModernHttpClient.iOS</Name>
<ProjectReference Include="..\ModernHttpClient\ModernHttpClient.iOS64.csproj">
<Project>{6941F069-AC02-40EE-BBF3-9FE3331030EF}</Project>
<Name>ModernHttpClient.iOS64</Name>
</ProjectReference>
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions src/Playground.iOS/Playground_iOSViewController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using CoreGraphics;
using Foundation;
using UIKit;
using System.Net.Http;
using System.Threading;
using System.Diagnostics;
Expand Down Expand Up @@ -54,7 +54,7 @@ public Playground_iOSViewController () : base ("Playground_iOSViewController", n
CancellationTokenSource currentToken;
HttpResponseMessage resp;

partial void cancelIt (MonoTouch.Foundation.NSObject sender)
partial void cancelIt (Foundation.NSObject sender)
{
this.currentToken.Cancel();
if (resp != null) resp.Content.Dispose();
Expand All @@ -70,7 +70,7 @@ void HandleDownloadProgress(long bytes, long totalBytes, long totalBytesExpected
});
}

async partial void doIt (MonoTouch.Foundation.NSObject sender)
async partial void doIt (Foundation.NSObject sender)
{
var handler = new NativeMessageHandler();
var client = new HttpClient(handler);
Expand Down
12 changes: 6 additions & 6 deletions src/Playground.iOS/Playground_iOSViewController.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4faa371

Please sign in to comment.