access view inside a storyboard
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 ViewController class. Then I dragged a Map View into that view. Now I need to start manipulating that Map View in code. How do I access it? I’ve tried things like self.view.subview but haven’t gotten anywhere from there.
Solutions Collect From Internet About “access view inside a storyboard”
You should use outlets, first select your storyboard file, then go to
View->Assistant Editor->Show Assistant Editor
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
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
- How to calculate the camera position from Vuforia GL matrix?
- – throws an exception saying length is too big, but it isn't
- How containerURLForSecurityApplicationGroupIdentifier in NSFileManager works on iOS 7
- Create a rectangle with just two rounded corners in swift?
- How does TestFlight do it?
- How do I see which version of Swift I'm using?
- iOS background application network access
- How do I change the title of the “back” button on a Navigation Bar
- UICollectionViewCell using prototype sizes
- Playing video inline in Ionic/Phonegap (webkit-playsinline not working)
- Weak Reference to NSTimer Target To Prevent Retain Cycle
- Google Maps SDK for iOS requires GoogleMaps.bundle to be part of your target under 'Copy Bundle Resources
- calculating directory size in cocoa
- Use autorelease when setting a retain property using dot syntax?
- Saving an image array with nsuserdefaults