# Twitter Composer

**URL:** <https://forums.kodeco.com/t/twitter-composer/40443>\
**Category:** Swift\
**Created:** [March 19, 2018, 4:15pm UTC](https://forums.kodeco.com/t/twitter-composer/40443 "2018-03-19T16:15:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjazad](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@jjazad](https://forums.kodeco.com/u/jjazad)\
**Post date:** [March 19, 2018, 4:15pm UTC](https://forums.kodeco.com/t/twitter-composer/40443/1 "2018-03-19T16:15:51Z")

</div>

Good morning all, I have an issue that I cannot figure out. My self.navigationController is throwing an exception with a nil value when I call the below method. However, calling a similar method for FaceBook works just fine. Any thoughts? I also have tried the below code to initialize the navController. I have also tried to just do composer.show(from:self) with no luck. One other thing I was able to load a tweet into my app from a user ID, so I know the TWTR SKD is functional. Really racking my brain on this for the past two days.

Used this to initialize the navController. **self.navController = UINavigationController.init(rootViewController: self)**

**let composer = TWTRComposer()**

**composer.setText(“just setting up my Twitter Kit”)**  
**composer.setImage(UIImage(named: “twitterkit”))**

**// Called from a UIViewController**  
**composer.show(from: self.navigationController!) { (result)in**  
\*\* if (result == .done) {\*\*  
\*\* print(“Successfully composed Tweet”)\*\*  
\*\* } else {\*\*  
\*\* print(“Cancelled composing”)\*\*  
\*\* }\*\*  
**}**

---

<div class="post-metadata">

**Author:** ![syedfa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/syedfa/32/101500_2.png) [@syedfa](https://forums.kodeco.com/u/syedfa)\
**Post date:** [March 26, 2018, 4:36am UTC](https://forums.kodeco.com/t/twitter-composer/40443/2 "2018-03-26T04:36:00Z")

</div>

@jjazad Thanks very much for your question!

I think the problem lies in your initialization of your navController:

`self.navController = UINavigationController.init(rootViewController: self)`

Where is this line being initialized? What precisely is “self”? If this is being done in your AppDelegate, then perhaps this is your error.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [September 2, 2018, 8:23am UTC](https://forums.kodeco.com/t/twitter-composer/40443/3 "2018-09-02T08:23:27Z")

</div>

Closed on September 2, 2018, 8:23am UTC

This topic was automatically closed after 166 days. New replies are no longer allowed.
