FanMenu 是一個菜單和
圓形布局類庫,基于
Macaw,用Swift編寫。
用法
1. 在您的故事板或程序中創(chuàng)建UIView。
2. 將FanMenu設置為UIView類
3. 設置按鈕
fanMenu.button = FanMenuButton(
id: "main",
image: "plus",
color: Color(val: 0x7C93FE)
)
4. 設置菜單項
fanMenu.items = [
FanMenuButton(
id: "exchange_id",
image: "exchange",
color: Color(val: 0x9F85FF)
),
...
FanMenuButton(
id: "visa_id",
image: "visa",
color: Color(val: 0xF55B58)
)
]
5. 添加事件處理程序
// call before animation
fanMenu.onItemDidClick = { button in
print("ItemDidClick: \(button.id)")
}
// call after animation
fanMenu.onItemWillClick = { button in
print("ItemWillClick: \(button.id)")
}