Popover is an UIPopoverController like control for iOS.
import PopoverSwift
// In view controller
let image = UIImage(named: "collection_hightlight")
let item0 = PopoverItem(title: "发起群聊", image: image) { debugPrint($0.title) }
let item1 = PopoverItem(title: "添加胖友", image: image) { debugPrint($0.title) }
let item2 = PopoverItem(title: "扫一扫", image: image) { debugPrint($0.title) }
let item3 = PopoverItem(title: "收付款", image: image) { debugPrint($0.title) }
let items = [item0, item1, item2, item3]
let controller = PopoverController(items: items, fromView: rightTopButton, direction: .down, style: .withImage)
popover(controller)
- v0.x for swift 2.2
- v1.x for swift2.3
- v2.x for swift3.x
- v3.x for swift4.x