# Crashy sharing popover controller

**URL:** <https://forums.kodeco.com/t/crashy-sharing-popover-controller/3585>\
**Category:** iOS\
**Created:** [March 1, 2016, 2:20am UTC](https://forums.kodeco.com/t/crashy-sharing-popover-controller/3585 "2016-03-01T02:20:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkliman](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dkliman/32/69829_2.png) [@dkliman](https://forums.kodeco.com/u/dkliman)\
**Post date:** [March 1, 2016, 2:20am UTC](https://forums.kodeco.com/t/crashy-sharing-popover-controller/3585/1 "2016-03-01T02:20:41Z")

</div>

hi everybody,

I thought I’d post this question here and see how that goes…

I was doing [this tutorial:](https://www.hackingwithswift.com/read/3/overview)

so when I make the app in the tutorial, it crashes when I run or simulate it on an iPad.

i’m just learning here, so I’ve asked around and one person said:

> the tutorial doesn’t mention the popoverPresentationController, so that code will crash on iPad iOS 9.x. The solution would be to add `vc.popoverPresentationController?.barButtonItem = navigationItem.rightBarButtonItem` before you present the view controller.

i had also tried:

`vc.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem `

both still crashed. What am I doing wrong? while i’m here, how do i populate the popover with the different share services such as Facebook, twitter, etc?

It would be nice to see a tutorial explaining how to make the sharing button bring up a popover or whatever kind of controller and populate it with whatever services I want, or are available… I’m not exactly sure how to do that.
