nico-s
6/7/2017 - 6:26 PM

ViewController.swift

//
//  ViewController.swift
//  GrandPi2
//
//  Created by Nicolas Suarez-Canton Trueba on 6/7/17.
//  Copyright © 2017 Nicolas Suarez-Canton Trueba. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    
    var monteCarloGraph: UIView = {
        var view = UIView()
        view.backgroundColor = UIColor.lightGray
        view.translatesAutoresizingMaskIntoConstraints = false
        return view
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        view.backgroundColor = UIColor.white
        
        view.addSubview(monteCarloGraph)
        setMonteCarloGraph()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func setMonteCarloGraph() {
        monteCarloGraph.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        monteCarloGraph.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
        monteCarloGraph.widthAnchor.constraint(equalToConstant: 300).isActive = true
        monteCarloGraph.heightAnchor.constraint(equalToConstant: 300).isActive = true
    }


}