Question: I add UITabbar with storyboard. And i have create 3 items in tabbar. (lets say "food", "sport", "videos") when i tap on "Food" items it open food view. And in uiTabbar "food" item is selected. 

I have done first and last item with this code:

```
tabBar.selectedItem = tabBar.items?.first as? UITabBarItem
or 
tabBar.selectedItem = tabBar.items?.last as? UITabBarItem

```

These are work but in my project there is 3 items exist. And I can't select middle item. I try 

```
tabBar.selectedItem = tabBar.items[1] as? UITabBarItem

```

However doesn't work. I got this error

> 
> '(UITabBar, didSelectItem: UITabBarItem!) -> ()' does not have a
>  member named 'selectedItem'
> 
> 
> 

any suggestion?

Edit:
Solve by myself added the answer below

Answer: 
Even though you don't want that old branch anymore, git really doesn't like rewriting history or discarding changes. Just revert and merge.

```
git branch new_master              # name current detached HEAD
git checkout master                # switch back to master
git revert --no-edit HEAD~4..HEAD  # create commits reverting back to where the history split
git merge new_master               # merge
git branch -d new_master           # don't need it anymore

```
So, I would do this in a couple steps:

```
git checkout -b new_master

```

to get a nice ref to what you want the new master to be.

```
git checkout master ; git checkout -b old_master

```

to keep a ref to the old master in case you want to go back or something later ; you can always delete that branch later once you're sure.

```
git checkout master ; git reset --hard new_master

```

this will reset the HEAD of the branch you're on (master) to the specified reference (new\_master).

```
git push -f origin

```

this will do a force-push of your new master branch to the remote. NOTE that this is bad practice if anyone else is using your remote repo as it will potentially break their fetches/pulls.