Changes

Jump to: navigation, search

Integrating Twitter and Facebook into iOS 7 Applications

42 bytes added, 19:56, 27 October 2016
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_IOS7ios9_upgrade</googlehtmlet>
The UIActivityViewController class is instantiated within an application at the point at which a posting is ready to be made to a social network. Once the user takes an action to post an update from within an application, the screen shown in Figure 79-2 will appear listing the options that are available:
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
[[Image:ios_7_social_share.png|The iOS 7 UIActivityViewController sheet]]
In the event that the user has not yet configured an account for the selected social network in the Settings application, a dialog will appear providing the option to either set up an account or cancel the post.
<googlehtmlet>BUY_IOS7ios9_upgrade</googlehtmlet>
The assumption is generally made that at the point an instance of UIActivityViewController is created, the application will already have gathered together the text and images that are to be included in the post. These items need to be placed into an NSArray object and passed to the controller before it is presented to the user. The following code excerpt, for example, instantiates a UIActivityViewController instance primed with text and an image to be included in the post and presents it to the user:
NSString *postText = @”My first Facebook post from iOS 7”;
<googlehtmlet>BUY_IOS7ios9_upgrade</googlehtmlet>
 
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">

Navigation menu