简体   繁体   中英

Category SideMenu with button SWIFT

i currently developping an app, which allow users to make an research by title, category, price and location.

to be more user-friendly, i'm trying to create a sidemenu, which contains all category under the form of button, and when the button is select, the textfield will take the name of the category. Furthermore, i want sidemenu appear when the category textfield is tapped.

I used SWRearViewController, for the side menu, but i don't know how to implement the functionnality which are listed above.

This is an example of what i want to create :

侧面菜单按钮

Thank's for your help !

You should set callbacks for all your category buttons. Once those get triggered you should get the instance of category textfield and set its text, something like

func artsCategoryTapped(aButton: UIButton) {
categoryTextField.text = "Arts"
}

I'm not sure how SWRearViewController works, but if you know how to trigger it, you can set delegate method for your category textField. Once you know someone has begin to edit it, you should display your SWRearViewController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM