Title: SLComposeViewControllerResultDone returned when no connection
Tags: ios;facebook;ios7
Question: When using the SLComposeViewController for posting to Facebook, ```SLComposeViewControllerResultDone``` is returned even when the device has no network connection. Any way around this, so I only display a 'success' message after its actually posted successfully. 

```[_shareComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result)
     {

         switch (result)
         {
             case SLComposeViewControllerResultCancelled:

                 break;
             case SLComposeViewControllerResultDone:
             {
                // Show success message

             }
                 break;
             default:
                 break;
         }
     }];
```


Here is the accepted answer: Import Apples's Reachability files and check with following methods:

```- (BOOL)connected 
{
    Reachability *reachability = [Reachability reachabilityForInternetConnection];  
    NetworkStatus networkStatus = [reachability currentReachabilityStatus]; 
    return networkStatus != NotReachable;
}



[_shareComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result)
     {

         switch (result)
         {
             case SLComposeViewControllerResultCancelled:

                 break;
             case SLComposeViewControllerResultDone:
             {

                  if (![self connected]) {
                       // Show internet is not available message
                  } 
                  else {
                       // Show success message
                  }

             }
                 break;
             default:
                 break;
         }
     }];
```


Here is another answer: From apple's doc

```
  The handler to call when the user is done composing a post.
```

Discussion

```
  The handler has a single parameter that indicates whether the user
  finished or cancelled composing the post. This block is not guaranteed
  to be called on any particular thread.
```

From above, you can clear, completion handler will be called once you've done with your composition, but it's not responding for either network connection availability or posting failed. You've to be check with connection before composition.

You can also these two result only possible with this handler.

```typedef NS_ENUM(NSInteger,
   SLComposeViewControllerResult) {
   SLComposeViewControllerResultCancelled,
   SLComposeViewControllerResultDone
};
```

That is, your composer view controller is either post or cancel.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:03/03/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><facebook><ios7>', 'Title': 'SLComposeViewControllerResultDone returned when no connection', 'ViewCount': 521, 'id': 22141893, 'user_AboutMe': '<p>zora, ios</p>\n', 'user_AccountId': 67113.0, 'user_DisplayName': 'daihovey', 'user_Reputation': 3435.0, 'user_Views': 578.0, 'user_id': 196555.0}}