Skip to content

Instantly share code, notes, and snippets.

@Jamonek
Created March 10, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jamonek/8999805d94f5f4f558c9 to your computer and use it in GitHub Desktop.
Save Jamonek/8999805d94f5f4f558c9 to your computer and use it in GitHub Desktop.
//
// Legend.swift
// VCN
//
// Created by Jamone Alexander Kelly on 3/3/15.
// Copyright (c) 2015 Veteran Care Network, LLC. All rights reserved.
//
import UIKit
class Legend : UIViewController {
@IBOutlet weak var containerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
// load default view into container
let view = UIStoryboard(name: "Main", bundle: nil)
let vc = view.instantiateViewControllerWithIdentifier("layersSub") as UIViewController
let sub = vc.view
containerView.addSubview(sub)
}
@IBAction func segmentChange(sender: UISegmentedControl) {
switch(sender.selectedSegmentIndex)
{
case 0:
let view = UIStoryboard(name: "Main", bundle: nil)
let vc = view.instantiateViewControllerWithIdentifier("layersSub") as UIViewController
let sub = vc.view
containerView.addSubview(sub)
case 1:
let view = UIStoryboard(name: "Main", bundle: nil)
let vc = view.instantiateViewControllerWithIdentifier("legendSub") as UIViewController
let sub = vc.view
containerView.addSubview(sub)
default:
println("Test")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment