- iOS 13.0
- Xcode 11.4
- Swift 5.0
You can install blob-menu
in several ways:
- By adding the source files to your project.
- Via CocoaPods:
pod 'blob-menu'
- Via Carthage:
github "Ramotion/blob-menu"
- Create several menu items. You need to provide at least one image icon to initialize
BlobMenuItem
. - Use these menu items to create a menu model
BlobMenuModel
.
public init(items: [BlobMenuItem], selectedIndex: Int = 0, isOpened: Bool = false)
- Finally, use the menu model to initialize
BlobMenuView
. You can use this view in your layout.
extension BlobMenuItem {
static let all = [
BlobMenuItem(icon: <#Image#>),
BlobMenuItem(icon: <#Image#>),
BlobMenuItem(icon: <#Image#>),
BlobMenuItem(icon: <#Image#>)
]
}
struct ContentView: View {
@ObservedObject private var model = BlobMenuModel(items: BlobMenuItem.all)
var body: some View {
VStack {
Spacer()
BlobMenuView(model: model).padding(.bottom, 30)
}
}
}
To configure additional menu parameters, use a custom BlobMenuConfiguration
in the BlobMenuView
init method.
public init(model: BlobMenuModel, configuration: BlobMenuConfiguration = .default)
Right now we provide only color parameters. If you have ideas on what else should be configurable, please create an issue with suggestion
label.
For more integration details, please take a look at the Example
project.
Blob Menu is released under the MIT license. See LICENSE for details.
This library is a part of a selection of our best UI open-source projects.
If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com
Try this UI component and more like this in our iOS app. Contact us if interested.