PagingMenuController icon indicating copy to clipboard operation
PagingMenuController copied to clipboard

why does changing self.view value affects all other tabs content

Open Lithium-HD opened this issue 10 years ago • 2 comments

I have two tabs with different content. one of them shows some labels and buttons. and the other tab contain google map. in the second tab when I'm using this lines of code: (the last line of code)

let camera = GMSCameraPosition.cameraWithLatitude(lat1.doubleValue, longitude: lng1.doubleValue, zoom: 6)
let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
mapView.myLocationEnabled = true
mapView.delegate = self
self.view = mapView

this affects the first tab content. and both tabs show googlemap. what should I do? (I'm using swift)

Lithium-HD avatar Apr 05 '16 07:04 Lithium-HD

Can you show me some more codes about usage? Is self.view root view of child view controller or root view controller?

kitasuke avatar Apr 13 '16 10:04 kitasuke

I've attached three .txt files which includes the codes of main view and two tabs (I just removed unnecessary lines of codes) in the file named: 'detailTab0.txt' I've written self.view = ... to show the googlemaps in that view. but it affects the other tab too. after tapping on tabs title it will show the correct content again but I want the correct content without any tapping! capture

main.txt detailTab1.txt detailTab0.txt



Lithium-HD avatar Apr 13 '16 11:04 Lithium-HD