access view inside a storyboard

后端 未结 1 810
死守一世寂寞
死守一世寂寞 2021-01-27 16:00

How does one access, in code, a view they dragged from the Object Browser into another view in their storyboard?

For example, I created a UIView which I assigned to a Vi

相关标签:
1条回答
  • 2021-01-27 16:54

    You should use outlets, first select your storyboard file, then go to

    View->Assistant Editor->Show Assistant Editor
    

    enter image description here

    Next select the map view, press control on your keyboard and drag to the right section of xcode that will show your .h file, the following will appear

    enter image description here

    Write mapView inside it and hit enter, this will create an outlet for you to use Now you can use mapView to access your MKMapView

    0 讨论(0)
提交回复
热议问题