Created
September 16, 2014 19:31
-
-
Save foffer/942e63cf2b19ebf800c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainMenuViewController: UICollectionViewController, SharedLightsNetworkContextInterface { | |
let reuseIdentifier = "menuItemCell" | |
var localNetworkContext = LFXNetworkContext() | |
var lights = NSArray() | |
var delegate: SharedLightsReceiver? | |
override func viewDidLoad() { | |
collectionView!.registerClass(MainMenuCell.self, forCellWithReuseIdentifier: reuseIdentifier) | |
collectionView!.backgroundColor = UIColor.clearColor() | |
title = "Searching for Lights" | |
var sharedLightsManager = SharedLightsManager() | |
sharedLightsManager.delegate = self | |
sharedLightsManager.loadNetworkContext() | |
} | |
func loadNetworkContext(networkContext: LFXNetworkContext) { | |
localNetworkContext = networkContext | |
println("\(localNetworkContext)") | |
/* | |
This returns <LFXNetworkContext: 0x7fa692731b40> {name = LAN, isConnected = 0}, so the object is correctly created, however, | |
in the SharedLightsManger, it doesn't connect to the network, or call any of the callback methods provided by the LFX Framework. | |
Can this LFX network context and its method not be extracted into a seperate class like this? Or does it have to be created on each viewcontroller that is responsible for | |
controlling lights? It would be really convenient to have it in a 'master' class and delegate the calls out from that*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment