Skip to content

Instantly share code, notes, and snippets.

@Krumelur
Last active October 8, 2015 16:07
Show Gist options
  • Save Krumelur/96e12df15d08a21cdb33 to your computer and use it in GitHub Desktop.
Save Krumelur/96e12df15d08a21cdb33 to your computer and use it in GitHub Desktop.
using System;
using UIKit;
namespace JackBox
{
// Addes the view of the first 50 boxes.
public partial class SecondViewController : UIViewController
{
BoxesViewL boxes50;
public SecondViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
boxes50 = new BoxesViewL (){ Frame = UIScreen.MainScreen.Bounds };
View.AddSubview (boxes50);
this.randomBox = new RandMaker().RandBox;
}
nint randomBox;
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
}
public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear (animated);
}
public override void ViewWillDisappear (bool animated)
{
base.ViewWillDisappear (animated);
}
public override void ViewDidDisappear (bool animated)
{
base.ViewDidDisappear (animated);
}
public override void DidReceiveMemoryWarning ()
{
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
}
}
using System;
using UIKit;
namespace JackBox
{
// Controls the first tab. For later game options.
public partial class FirstViewController : UIViewController
{
BoxesViewStart start;
public FirstViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
start = new BoxesViewStart (){ Frame = UIScreen.MainScreen.Bounds };
SecretBox.Text = "Secret box: " + new RandMaker ().RandBox.ToString ();
View.AddSubview(start);
var box = new UIView
{
BackgroundColor = UIColor.Red,
Frame = new CoreGraphics.CGRect(100, 100, 50, 50),
};
box.Layer.BorderColor = UIColor.Green.CGColor;
box.Layer.BorderWidth = 3f;
box.Layer.CornerRadius = 10;
this.Add(box);
}
public override void DidReceiveMemoryWarning ()
{
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment