FloatingMenu with expand and compress animation, written in Swift
- Add
FloatingMenuView.swiftandFloatingMenuView.xibto your project. - If Static identifiers needed then use
Constants.swiftfile. - Use the
ExtensionClass.swiftfile for Menu button extension title alignment - You can use
CustomButtonViewas the UIbutton Class
You can instantiate the menu by using on a button action
letmenuView=FloatingMenuView(frame:UIScreen.main.bounds)
menuView.alpha =0UIApplication.shared.keyWindow?.addSubview(menuView)UIView.animate(withDuration:0.3, delay:0, options:[.transitionCrossDissolve], animations:{
menuView.alpha =1}, completion:nil)on each view controller you have to manually add view and set the identifier for each view controller
letbtnCustom=CustomButtonView(frame:CGRect(x: view.bounds.maxX -100, y: view.bounds.maxY -100, width:70, height:70))
btnCustom.controllerIdentifier =Constants.VC_TAG_VALUE.TWO_TAG
view.addSubview(btnCustom)Inside the FloatingMenuView.swift you can set the COLUMN_COUNT and ROW_COUNT
Use MenuModel as the Model data for each menu button.
properties available to the model are
- storyBoardName
- storyBoardId
- title
- selectedImage
- unSelectedImage
On creating the Model array of menu button set the specific properties for each.
let Model = MenuModel(storyBoardName: "Main", storyBoardId: Constants.IDENTIFIERS.ONE_CONTROLLER,title: "Captain", selectedImage: "cap-icon", unSelectedImage: "cap-icon")
Faisal Azeez faisalazeez7@gmail.com
Floating-Menu is available under the MIT license. See the LICENSE file for more info.

