Open malcommac opened 7 years ago
Just for reference the only workaround I've found right now is to create a subclass and override the updateToolbar()
function (cannot call super to avoid loops).
Following example add a custom share button.
class PhotoBrowser: IDMPhotoBrowser {
public lazy var items: [UIBarButtonItem] = {
let flexible_space = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let share_button = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareGallery))
return [flexible_space,share_button]
}()
public var bottomToolbar: UIToolbar {
get {
let toolbar = self.value(forKey: "_toolbar") as! UIToolbar
toolbar.tintColor = UIColor.white
return toolbar
}
}
public func updateToolbar() {
self.bottomToolbar.setItems(items, animated: false)
}
public func shareGallery() {
// something...
}
}
Is possible to customize the bottom toolbar with custom elements?