Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
- preserve constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Nov 27, 2019
1 parent 23cc0e8 commit 52aa53e
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.ComponentModel;
using Foundation;

namespace Xamarin.Forms.Platform.iOS
{
public class CarouselViewRenderer : ItemsViewRenderer<CarouselView, CarouselViewController>
{
CarouselView CarouselView => Element;

[Preserve(Conditional = true)]
public CarouselViewRenderer()
{
CarouselView.VerifyCarouselViewFlagEnabled(nameof(CarouselViewRenderer));
Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/ButtonRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using Specifics = Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using SizeF = CoreGraphics.CGSize;
using PreserveAttribute = Foundation.PreserveAttribute;

namespace Xamarin.Forms.Platform.iOS
{
Expand Down Expand Up @@ -35,6 +36,7 @@ public class ButtonRenderer : ViewRenderer<Button, UIButton>, IImageVisualElemen
IImageVisualElementRenderer IButtonLayoutRenderer.ImageVisualElementRenderer => this;
nfloat IButtonLayoutRenderer.MinimumHeight => _minimumButtonHeight;

[Preserve(Conditional = true)]
public ButtonRenderer()
{
BorderElementManager.Init(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class CarouselPageRenderer : UIViewController, IVisualElementRenderer
VisualElementTracker _tracker;
Page _previousPage;

[Preserve(Conditional = true)]
public CarouselPageRenderer()
{
}
Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/CheckBoxRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using Foundation;

namespace Xamarin.Forms.Platform.iOS
{
public class CheckBoxRenderer : CheckBoxRendererBase<FormsCheckBox>
{
[Preserve(Conditional = true)]
public CheckBoxRenderer()
{
}
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/EditorRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class EditorRenderer : EditorRendererBase<UITextView>

UILabel _placeholderLabel;

[Preserve(Conditional = true)]
public EditorRenderer()
{
Frame = new RectangleF(0, 20, 320, 40);
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/EntryRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Xamarin.Forms.Platform.iOS
{
public class EntryRenderer : EntryRendererBase<UITextField>
{
[Preserve(Conditional = true)]
public EntryRenderer()
{
Frame = new RectangleF(0, 20, 320, 40);
Expand Down
3 changes: 3 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/FrameRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Drawing;
using CoreAnimation;
using CoreGraphics;
using Foundation;
using UIKit;

namespace Xamarin.Forms.Platform.iOS
Expand Down Expand Up @@ -88,12 +89,14 @@ public override void LayoutSubviews()
base.LayoutSubviews();
}

[Preserve(Conditional = true)]
class ShadowView : UIView
{
CALayer _shadowee;
CGRect _previousBounds;
CGRect _previousFrame;

[Preserve(Conditional = true)]
public ShadowView(CALayer shadowee)
{
_shadowee = shadowee;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ImageButtonRenderer : ViewRenderer<ImageButton, UIButton>, IImageVi
readonly nfloat _minimumButtonHeight = 44; // Apple docs


[Preserve(Conditional = true)]
public ImageButtonRenderer() : base()
{
ButtonElementManager.Init(this);
Expand Down
2 changes: 2 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using UIKit;
using Xamarin.Forms.Internals;
using RectangleF = CoreGraphics.CGRect;
using PreserveAttribute = Foundation.PreserveAttribute;

namespace Xamarin.Forms.Platform.iOS
{
Expand All @@ -32,6 +33,7 @@ public class ImageRenderer : ViewRenderer<Image, UIImageView>, IImageVisualEleme
{
bool _isDisposed;

[Preserve(Conditional = true)]
public ImageRenderer() : base()
{
ImageElementManager.Init(this);
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class NavigationRenderer : UINavigationController, IVisualElementRenderer
UIImage _defaultNavBarShadowImage;
UIImage _defaultNavBarBackImage;

[Preserve(Conditional = true)]
public NavigationRenderer() : base(typeof(FormsNavigationBar), null)
{
MessagingCenter.Subscribe<IVisualElementRenderer>(this, UpdateToolbarButtons, sender =>
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/PageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class PageRenderer : UIViewController, IVisualElementRenderer, IEffectCon
Thickness _userPadding = default(Thickness);
bool _userOverriddenSafeArea = false;

[Preserve(Conditional = true)]
public PageRenderer()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class PhoneMasterDetailRenderer : UIViewController, IVisualElementRendere
Page Page => Element as Page;


[Preserve(Conditional = true)]
public PhoneMasterDetailRenderer()
{
}
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/ScrollViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ScrollViewRenderer : UIScrollView, IVisualElementRenderer, IEffectC
bool _checkedForRtlScroll = false;
bool _previousLTR = true;

[Preserve(Conditional = true)]
public ScrollViewRenderer() : base(RectangleF.Empty)
{
ScrollAnimationEnded += HandleScrollAnimationEnded;
Expand Down
6 changes: 6 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/WkWebViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using UIKit;
using WebKit;
using Xamarin.Forms.Internals;
using PreserveAttribute = Foundation.PreserveAttribute;
using Uri = System.Uri;

namespace Xamarin.Forms.Platform.iOS
Expand All @@ -20,10 +21,15 @@ public class WkWebViewRenderer : WKWebView, IVisualElementRenderer, IWebViewDele
#pragma warning disable 0414
VisualElementTracker _tracker;
#pragma warning restore 0414


[Preserve(Conditional = true)]
public WkWebViewRenderer() : base(RectangleF.Empty, new WKWebViewConfiguration())
{
}


[Preserve(Conditional = true)]
public WkWebViewRenderer(WKWebViewConfiguration config) : base(RectangleF.Empty, config)
{
}
Expand Down

0 comments on commit 52aa53e

Please sign in to comment.