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: 
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.
Because you have divergence, you'll need to destroy the remote master and push up the local version. Depending on the security in place, you may not be able to do so. This has other implications as well, depending on who else is doing work based on master. **It should be done with extreme caution**.

```
git push origin :master // deletes remote master
git push origin master  // pushes local master to remote

```

Another (probably better) approach would be to revert the commits to master and commit the reverts (which themselves are commits). Then cherry-pick the work you've done on your local. First, create a new topic branch locally to save your work.

```
git checkout -b <topic_branch_name>  // create new branch to save local work
git checkout master
git reset --hard HEAD // sync local master to remote HEAD

git revert <last commit to master>
git revert <second-to-last commit to master>
...
git revert <Added cordova to .gitignore commit>
git push

git cherry-pick <commit hash from topic branch commit(s)>

```