Skip to content

Commit

Permalink
[EventKitUI] Update to Xcode 9 Beta 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Jun 29, 2017
1 parent 6873f11 commit 05edc5e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Constants.iOS.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace MonoTouch {
public const string MapKitLibrary = "/System/Library/Frameworks/MapKit.framework/MapKit";
public const string GameKitLibrary = "/System/Library/Frameworks/GameKit.framework/GameKit";
public const string EventKitLibrary = "/System/Library/Frameworks/EventKit.framework/EventKit";
public const string EventKitUILibrary = "/System/Library/Frameworks/EventKitUI.framework/EventKitUI";
public const string ImageIOLibrary = "/System/Library/Frameworks/ImageIO.framework/ImageIO";
public const string AssetsLibraryLibrary = "/System/Library/Frameworks/AssetsLibrary.framework/AssetsLibrary";
public const string CoreVideoLibrary = "/System/Library/Frameworks/CoreVideo.framework/CoreVideo";
Expand Down
27 changes: 27 additions & 0 deletions src/EventKitUI/EKUIBundle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// EventKitUIBundle C# bindings
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0
using System;
using System.Runtime.InteropServices;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.EventKitUI {
public static class EKUIBundle {

[iOS (11,0)]
[DllImport (Constants.EventKitUILibrary)]
static extern IntPtr EventKitUIBundle ();

[iOS (11,0)]
public static NSBundle UIBundle { get; } = Runtime.GetNSObject<NSBundle> (EventKitUIBundle ());
}
}
#endif
3 changes: 3 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,9 @@ EVENTKIT_SOURCES = \
EVENTKITUI_CORE_SOURCES = \
EventKitUI/Defs.cs \

EVENTKITUI_SOURCES = \
EventKitUI/EKUIBundle.cs \

# ExternalAccessory

EXTERNALACCESSORY_API_SOURCES = \
Expand Down
34 changes: 34 additions & 0 deletions tests/monotouch-test/EventKit/EKUIBundleTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Unit tests for EKUIBundle
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !__TVOS__ && !__WATCHOS__

using System;
using EventKitUI;
using Foundation;
using NUnit.Framework;

namespace MonoTouchFixtures.EventKitUI {
[TestFixture]
[Preserve (AllMembers = true)]
public class EKUIBundleTest {

[Test]
public void BundleTest ()
{
if (!TestRuntime.CheckXcodeVersion (9, 0))
Assert.Ignore ("Ignoring tests: Requires iOS11+");

var bundle = EKUIBundle.UIBundle;
Assert.NotNull (bundle, "Was Null");
Assert.AreEqual ("com.apple.eventkitui", bundle.BundleIdentifier, "BundleIdentifier");
}
}
}
#endif
1 change: 1 addition & 0 deletions tests/monotouch-test/monotouch-test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@
<Compile Include="OpenGLES\EAGLContext.cs" />
<Compile Include="CoreText\CTParagraphStyleTests.cs" />
<Compile Include="CoreData\NSQueryGenerationTokenTest.cs" />
<Compile Include="EventKit\EKUIBundleTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down

0 comments on commit 05edc5e

Please sign in to comment.