mirror of https://github.com/xaoxuu/ProHUD
discardableResult
This commit is contained in:
parent
7e6c87364e
commit
b62c027cd5
|
@ -13,7 +13,7 @@ extension Alert: InternalConvenienceLayout {
|
||||||
@discardableResult public func add(action: Action) -> Button {
|
@discardableResult public func add(action: Action) -> Button {
|
||||||
insert(action: action, at: actionStack.arrangedSubviews.count)
|
insert(action: action, at: actionStack.arrangedSubviews.count)
|
||||||
}
|
}
|
||||||
public func insert(action: Action, at index: Int) -> Button {
|
@discardableResult public func insert(action: Action, at index: Int) -> Button {
|
||||||
let btn = Button(config: config, action: action)
|
let btn = Button(config: config, action: action)
|
||||||
if index < actionStack.arrangedSubviews.count {
|
if index < actionStack.arrangedSubviews.count {
|
||||||
actionStack.insertArrangedSubview(btn, at: index)
|
actionStack.insertArrangedSubview(btn, at: index)
|
||||||
|
@ -106,7 +106,7 @@ extension Alert: InternalConvenienceLayout {
|
||||||
|
|
||||||
// MARK: 完全自定义布局
|
// MARK: 完全自定义布局
|
||||||
|
|
||||||
public func set(customView: UIView) -> UIView {
|
@discardableResult public func set(customView: UIView) -> UIView {
|
||||||
self.customView = customView
|
self.customView = customView
|
||||||
contentView.subviews.forEach({ $0.removeFromSuperview() })
|
contentView.subviews.forEach({ $0.removeFromSuperview() })
|
||||||
contentView.addSubview(customView)
|
contentView.addSubview(customView)
|
||||||
|
|
|
@ -13,7 +13,7 @@ extension Sheet: ConvenienceLayout {
|
||||||
@discardableResult public func add(action: Action) -> Button {
|
@discardableResult public func add(action: Action) -> Button {
|
||||||
insert(action: action, at: contentStack.arrangedSubviews.count)
|
insert(action: action, at: contentStack.arrangedSubviews.count)
|
||||||
}
|
}
|
||||||
public func insert(action: Action, at index: Int) -> Button {
|
@discardableResult public func insert(action: Action, at index: Int) -> Button {
|
||||||
let btn = SheetButton(config: config, action: action)
|
let btn = SheetButton(config: config, action: action)
|
||||||
if index < contentStack.arrangedSubviews.count {
|
if index < contentStack.arrangedSubviews.count {
|
||||||
contentStack.insertArrangedSubview(btn, at: index)
|
contentStack.insertArrangedSubview(btn, at: index)
|
||||||
|
@ -102,7 +102,7 @@ extension Sheet: ConvenienceLayout {
|
||||||
|
|
||||||
// MARK: 完全自定义布局
|
// MARK: 完全自定义布局
|
||||||
|
|
||||||
public func set(customView: UIView) -> UIView {
|
@discardableResult public func set(customView: UIView) -> UIView {
|
||||||
self.customView = customView
|
self.customView = customView
|
||||||
contentView.addSubview(customView)
|
contentView.addSubview(customView)
|
||||||
return customView
|
return customView
|
||||||
|
|
|
@ -21,7 +21,7 @@ public extension Toast {
|
||||||
insert(action: action, at: actionStack.arrangedSubviews.count)
|
insert(action: action, at: actionStack.arrangedSubviews.count)
|
||||||
}
|
}
|
||||||
|
|
||||||
func insert(action: Action, at index: Int) -> Button {
|
@discardableResult func insert(action: Action, at index: Int) -> Button {
|
||||||
let btn = ToastButton(config: config, action: action)
|
let btn = ToastButton(config: config, action: action)
|
||||||
if index < actionStack.arrangedSubviews.count {
|
if index < actionStack.arrangedSubviews.count {
|
||||||
actionStack.insertArrangedSubview(btn, at: index)
|
actionStack.insertArrangedSubview(btn, at: index)
|
||||||
|
|
Loading…
Reference in New Issue