I want to use the iBotlet map view in MapManager. To realize this connection I need to present a map viewer to the map manager. I thought it would do something like this:
@Iboutlet var View Map: MKMapView! Var locationManager = CLLocationManager () var User Location: Mkusar Location! Manager Manager: MapManager = MapManager (MapView: mapView)
Now, I wonder if this is the right way to do this. I mean, I'm basically going to use a map view in a model which is not the best thing. So how do I know this idea?
I think your code should not be compiled, because when map manager
You are referring to the implication itself
, which is unavailable until all the class properties are started.
I have an inherent unwanted MapManager
property:
var manager: MapManager!
which is set to mapView
is started:
@IBOutlet var map view: MKMapView! Before referencing the mapManager
you need to make sure that mapView mapView}}
code> is already started Otherwise any runtime exceptions will be raised.
Comments
Post a Comment