Skip to content

Commit 5cbaea2

Browse files
committed
Convert layout constant to nfloat
1 parent 9f6ecda commit 5cbaea2

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Cirrious.FluentLayout/FluentLayout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public FluentLayout(
3333
public FluentLayout(UIView view,
3434
NSLayoutAttribute attribute,
3535
NSLayoutRelation relation,
36-
float constant = 0f)
36+
nfloat constant)
3737
{
3838
View = view;
3939
Attribute = attribute;

Cirrious.FluentLayout/UIViewAndLayoutAttribute.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Project Lead - Stuart Lodge, @slodge, [email protected]
77

88
using UIKit;
9+
using System;
910

1011
namespace Cirrious.FluentLayouts.Touch
1112
{
@@ -20,17 +21,32 @@ public UIViewAndLayoutAttribute(UIView view, NSLayoutAttribute attribute)
2021
public UIView View { get; private set; }
2122
public NSLayoutAttribute Attribute { get; private set; }
2223

23-
public FluentLayout EqualTo(float constant = 0f)
24+
public FluentLayout EqualTo()
25+
{
26+
return EqualTo(0);
27+
}
28+
29+
public FluentLayout EqualTo(nfloat constant)
2430
{
2531
return new FluentLayout(View, Attribute, NSLayoutRelation.Equal, constant);
2632
}
2733

28-
public FluentLayout GreaterThanOrEqualTo(float constant = 0f)
34+
public FluentLayout GreaterThanOrEqualTo()
35+
{
36+
return GreaterThanOrEqualTo(0);
37+
}
38+
39+
public FluentLayout GreaterThanOrEqualTo(nfloat constant)
2940
{
3041
return new FluentLayout(View, Attribute, NSLayoutRelation.GreaterThanOrEqual, constant);
3142
}
3243

33-
public FluentLayout LessThanOrEqualTo(float constant = 0f)
44+
public FluentLayout LessThanOrEqualTo()
45+
{
46+
return LessThanOrEqualTo(0);
47+
}
48+
49+
public FluentLayout LessThanOrEqualTo(nfloat constant)
3450
{
3551
return new FluentLayout(View, Attribute, NSLayoutRelation.LessThanOrEqual, constant);
3652
}

QuickLayout.Touch/LinkerPleaseInclude.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Specialized;
33
using System.Windows.Input;
44
using UIKit;
5+
using Foundation;
56

67
namespace QuickLayout.Touch
78
{
@@ -46,7 +47,7 @@ public void Include(UIImageView imageView)
4647
public void Include(UIDatePicker date)
4748
{
4849
date.Date = date.Date.AddSeconds(1);
49-
date.ValueChanged += (sender, args) => { date.Date = DateTime.MaxValue; };
50+
date.ValueChanged += (sender, args) => { date.Date = (NSDate)DateTime.MaxValue; };
5051
}
5152

5253
public void Include(UISlider slider)

0 commit comments

Comments
 (0)