As not every device will necessarily be running iOS 5, we'll create a check to ensure that the device supports Twitter, and then let the user tweet and share an update about our brand:
1. Open the
Dino Stores
projectwe used in the last exercise. We'll add a button to the menu screen that'll open up the Twitter dialog. Open the menu page on the canvas and then drag the button from the object library.2. Position the menu near the bottom of the page and expand it to fill the width. Update the text with a call to action, such as
Tweet a dino fact!
. Your button may look a little like the following screenshot:3. Click and select the button, and select Execute JavaScript as the Touched Up Inside action to create the event and automatically open the code editor.
4. Remove the placeholder comment
//Code here
and replace it with the following code:if(window.ad.twitterComposer) { window.ad.twitterComposer.text = 'The longest dinosaur was Seismosaurus, was as long...