增加默认限制的行数;action没有handle时默认会pop

This commit is contained in:
xaoxuu 2020-06-19 09:49:24 +08:00
parent 1b4f42716b
commit 03eebc6c93
8 changed files with 52 additions and 12 deletions

View File

@ -15,7 +15,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C" BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C"
BuildableName = "Example.app" BuildableName = "ProHUD (Xcode11&#x4e4b;&#x524d;&#x7684;&#x8001;&#x9879;&#x76ee;).app"
BlueprintName = "Example" BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj"> ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference> </BuildableReference>
@ -45,7 +45,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C" BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C"
BuildableName = "Example.app" BuildableName = "ProHUD (Xcode11&#x4e4b;&#x524d;&#x7684;&#x8001;&#x9879;&#x76ee;).app"
BlueprintName = "Example" BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj"> ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference> </BuildableReference>
@ -62,7 +62,7 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C" BlueprintIdentifier = "CDA4E03720D3935B00CD2A0C"
BuildableName = "Example.app" BuildableName = "ProHUD (Xcode11&#x4e4b;&#x524d;&#x7684;&#x8001;&#x9879;&#x76ee;).app"
BlueprintName = "Example" BlueprintName = "Example"
ReferencedContainer = "container:Example.xcodeproj"> ReferencedContainer = "container:Example.xcodeproj">
</BuildableReference> </BuildableReference>

View File

@ -23,7 +23,9 @@ class TestAlertVC: BaseListVC {
"场景同步成功写法2", "场景同步成功写法2",
"场景:同步失败和重试", "场景:同步失败和重试",
"极端场景:短时间内调用了多次同一个弹窗", "极端场景:短时间内调用了多次同一个弹窗",
"极端场景:多个弹窗重叠"] "极端场景:多个弹窗重叠",
"测试较长的标题和内容",
"测试特别长的标题和内容"]
} }
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
@ -179,6 +181,24 @@ class TestAlertVC: BaseListVC {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) { DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
f(4) f(4)
} }
} else if row == 6 {
Alert.push() { (a) in
a.update { (vm) in
vm.scene = .confirm
vm.title = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.message = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.add(action: .default, title: "我知道了", handler: nil)
}
}
} else if row == 7 {
Alert.push() { (a) in
a.update { (vm) in
vm.scene = .warning
vm.title = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.message = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.add(action: .default, title: "我知道了", handler: nil)
}
}
} }
} }

View File

@ -26,7 +26,9 @@ class TestToastVC: BaseListVC {
"禁止手势移除", "禁止手势移除",
"组合使用示例", "组合使用示例",
"避免重复发布同一条信息", "避免重复发布同一条信息",
"根据id查找并修改实例"] "根据id查找并修改实例",
"测试较长的标题和内容",
"测试特别长的标题和内容"]
} }
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
@ -111,6 +113,24 @@ class TestToastVC: BaseListVC {
} }
}) })
} else if row == 9 {
Toast.push() { (a) in
a.update { (vm) in
vm.scene = .warning
vm.title = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.message = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
}
}
} else if row == 10 {
Toast.push() { (a) in
a.update { (vm) in
vm.scene = .warning
vm.title = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
vm.message = "正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过正在同步看到了你撒地方快乐撒的肌肤轮廓啊就是;来的跨省的人格人格离开那地方离开过"
}
}
} }
} }

View File

@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/xaoxuu/Inspire.git", "repositoryURL": "https://github.com/xaoxuu/Inspire.git",
"state": { "state": {
"branch": null, "branch": null,
"revision": "fed13e3530ca38f884d190ea5c7b12b8f3b2a41b", "revision": "cad0c64e6995a06ee3bf3ed7c632ad27c1b8ffb1",
"version": "2.0.0" "version": "2.0.0"
} }
}, },

View File

@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/xaoxuu/Inspire", "repositoryURL": "https://github.com/xaoxuu/Inspire",
"state": { "state": {
"branch": null, "branch": null,
"revision": "fed13e3530ca38f884d190ea5c7b12b8f3b2a41b", "revision": "cad0c64e6995a06ee3bf3ed7c632ad27c1b8ffb1",
"version": "2.0.0" "version": "2.0.0"
} }
}, },

View File

@ -33,7 +33,7 @@ public extension ProHUD.Configuration {
/// ///
public var titleFont = UIFont.boldSystemFont(ofSize: 22) public var titleFont = UIFont.boldSystemFont(ofSize: 22)
/// ///
public var titleMaxLines = Int(1) public var titleMaxLines = Int(5)
/// ///
public var boldTextFont = UIFont.boldSystemFont(ofSize: 18) public var boldTextFont = UIFont.boldSystemFont(ofSize: 18)
@ -41,7 +41,7 @@ public extension ProHUD.Configuration {
/// ///
public var bodyFont = UIFont.systemFont(ofSize: 17) public var bodyFont = UIFont.systemFont(ofSize: 17)
/// ///
public var bodyMaxLines = Int(5) public var bodyMaxLines = Int(20)
// MARK: // MARK:
/// ///

View File

@ -236,7 +236,7 @@ internal extension Alert {
} }
addTouchUpAction(for: btn) { [weak self] in addTouchUpAction(for: btn) { [weak self] in
handler?() handler?()
if btn.tag == UIAlertAction.Style.cancel.rawValue { if btn.tag == UIAlertAction.Style.cancel.rawValue || handler == nil {
self?.pop() self?.pop()
} }
} }

View File

@ -29,12 +29,12 @@ public extension ProHUD.Configuration {
/// ///
public var titleFont = UIFont.boldSystemFont(ofSize: 18) public var titleFont = UIFont.boldSystemFont(ofSize: 18)
/// ///
public var titleMaxLines = Int(1) public var titleMaxLines = Int(5)
/// ///
public var bodyFont = UIFont.systemFont(ofSize: 16) public var bodyFont = UIFont.systemFont(ofSize: 16)
/// ///
public var bodyMaxLines = Int(10) public var bodyMaxLines = Int(20)
/// ///
/// - Parameter callback: /// - Parameter callback: