dekatotoro / dekatotoro/SlideMenuControllerSwift
Problem with BarButton.
- Dominant language
- Swift
- Stars
- 3.4k
- Forks
- 742
- PR merge metrics
- No merged PRs in 30d
Description
From collection view I want open screen with menu. I use this code
```
// MARK: - UICollectionViewDelegate
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
let vc = createMenuView()
self.presentViewController(vc, animated: true, completion: nil)
}
// MARK: - Create menu
func createMenuView() -> SlideMenuController {
let mainViewController = kStoryboard.instantiateViewControllerWithIdentifier("TakeLesson") as! TakeLessonViewController
let leftViewController = kStoryboard.instantiateViewControllerWithIdentifier("LeftViewController") as! LeftViewController
let nvc: UINavigationController = UINavigationController(rootViewController: mainViewController)
leftViewController.mainViewController = nvc
let slideMenuController = SlideMenuController(mainViewController:nvc, leftMenuViewController: leftViewController)
return slideMenuController
}
```
But in menu view I in TakeLessonViewController in willViewAppear write self.setNavigationBarItem() but this don't work. I used this method in viewDidLoad but have negative effect with BarButton. He started in origin x = 0 and after got to normal position.
How can I fix that?
Best regards Oleksii
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with createMenuView and TakeLessonViewController, then trace setNavigationBarItem from willViewAppear and viewDidLoad while reproducing the collection-view presentation. The work is done when the BarButton appears in its normal position without the initial x = 0 offset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100