Ramotion / circle-menu

:octocat: ⭕️ CircleMenu is a simple, elegant UI menu with a circular layout and material design animations. Swift UI library made by @Ramotion
https://www.ramotion.com/circle-menu-open-source-iphone-app-development-library/
MIT License
3.44k stars 357 forks source link

How to move another viewcontroller when button is tapped ? #44

Open IOSDeveloperProgrammer opened 7 years ago

IOSDeveloperProgrammer commented 7 years ago

`func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int) { print("button did selected: (atIndex)")

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let annoucement = storyboard.instantiateViewController(withIdentifier: "FirstVC") as! FirstVC

}`

This method is not working. please guide me

tache commented 6 years ago

In Xcode IB, make sure you setup a segue ... You could set it up programmatically as well.

ensure you have the delegates set ...

extension MyViewController: CircleMenuDelegate { ... }

then in you delegate for buttonDidSelected ...

func circleMenu(_ circleMenu: CircleMenu, buttonDidSelected button: UIButton, atIndex: Int) {

switch atIndex {

        case 0:
            self.performSegue(withIdentifier: "MyNewWindowSegue", sender: nil)

...
... }