diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-12-14 12:38:46 -0800 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-12-14 20:38:46 +0000 |
commit | 9535315986c6ad5d51ec28f676310b9a5f7d444c (patch) | |
tree | d0492d1c6c35581040ca76aff4dc577c7227c840 /Xamarin.Forms.Platform.iOS/Platform.cs | |
parent | eca25db80eebc2e7936f154246ed7996f6d071a1 (diff) | |
download | xamarin-forms-9535315986c6ad5d51ec28f676310b9a5f7d444c.tar.gz xamarin-forms-9535315986c6ad5d51ec28f676310b9a5f7d444c.tar.bz2 xamarin-forms-9535315986c6ad5d51ec28f676310b9a5f7d444c.zip |
Deprecate versions of iOS older than 8 (#630)
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Platform.cs')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Platform.cs | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Platform.cs b/Xamarin.Forms.Platform.iOS/Platform.cs index c9c31887..586892f7 100644 --- a/Xamarin.Forms.Platform.iOS/Platform.cs +++ b/Xamarin.Forms.Platform.iOS/Platform.cs @@ -45,15 +45,7 @@ namespace Xamarin.Forms.Platform.iOS { if (!PageIsChildOfPlatform(sender)) return; - - if (Forms.IsiOS8OrNewer) - { - PresentAlert(arguments); - } - else - { - PresentPre8Alert(arguments); - } + PresentAlert(arguments); }); MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, (Page sender, ActionSheetArguments arguments) => @@ -64,16 +56,8 @@ namespace Xamarin.Forms.Platform.iOS var pageRoot = sender; while (!Application.IsApplicationOrNull(pageRoot.RealParent)) pageRoot = (Page)pageRoot.RealParent; - var pageRenderer = GetRenderer(pageRoot); - if (Forms.IsiOS8OrNewer) - { - PresentActionSheet(arguments); - } - else - { - PresentPre8ActionSheet(arguments, pageRenderer); - } + PresentActionSheet(arguments); }); } @@ -491,35 +475,6 @@ namespace Xamarin.Forms.Platform.iOS await Task.Delay(5); } - void PresentPre8Alert(AlertArguments arguments) - { - UIAlertView alertView; - if (arguments.Accept != null) - alertView = new UIAlertView(arguments.Title, arguments.Message, null, arguments.Cancel, arguments.Accept); - else - alertView = new UIAlertView(arguments.Title, arguments.Message, null, arguments.Cancel); - - alertView.Dismissed += (o, args) => arguments.SetResult(args.ButtonIndex != 0); - alertView.Show(); - } - - void PresentPre8ActionSheet(ActionSheetArguments arguments, IVisualElementRenderer pageRenderer) - { - var actionSheet = new UIActionSheet(arguments.Title, null, arguments.Cancel, arguments.Destruction, - arguments.Buttons.ToArray()); - - actionSheet.ShowInView(pageRenderer.NativeView); - - actionSheet.Clicked += (o, args) => - { - string title = null; - if (args.ButtonIndex != -1) - title = actionSheet.ButtonTitle(args.ButtonIndex); - - arguments.Result.TrySetResult(title); - }; - } - internal class DefaultRenderer : VisualElementRenderer<VisualElement> { } |