Skip to content

Commit 14cfa4f

Browse files
committed
NSAction hax
1 parent 44d9481 commit 14cfa4f

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

ReactiveUI/Cocoa/AutoSuspendHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#if UNIFIED
1212
using Foundation;
1313
using UIKit;
14+
using NSAction = System.Action;
1415
#else
1516
using MonoTouch.Foundation;
1617
using MonoTouch.UIKit;

ReactiveUI/Cocoa/NSRunloopScheduler.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using UIKit;
1010
using Foundation;
1111
using CoreFoundation;
12+
using NSAction = System.Action;
1213
#elif UIKIT
1314
using MonoTouch.UIKit;
1415
using MonoTouch.Foundation;
@@ -57,8 +58,12 @@ public IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<ISchedu
5758
{
5859
var innerDisp = Disposable.Empty;
5960
bool isCancelled = false;
60-
61+
62+
#if UNIFIED
63+
var timer = NSTimer.CreateScheduledTimer(dueTime, _ => {
64+
#else
6165
var timer = NSTimer.CreateScheduledTimer(dueTime, () => {
66+
#endif
6267
if (!isCancelled) innerDisp = action(this, state);
6368
});
6469

ReactiveUI/Cocoa/PlatformOperations.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ public class PlatformOperations : IPlatformOperations
99
{
1010
public string GetOrientation()
1111
{
12-
#if UIKIT
12+
#if UNIFIED
13+
return UIKit.UIDevice.CurrentDevice.Orientation.ToString();
14+
#elif UIKIT
1315
return MonoTouch.UIKit.UIDevice.CurrentDevice.Orientation.ToString();
1416
#else
1517
return null;

ReactiveUI/Cocoa/ReactiveCollectionViewSource.cs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#if UNIFIED
1919
using Foundation;
2020
using UIKit;
21+
using NSAction = System.Action;
2122
#else
2223
using MonoTouch.Foundation;
2324
using MonoTouch.UIKit;

0 commit comments

Comments
 (0)