mirror of https://github.com/xaoxuu/ProHUD
接口注释
This commit is contained in:
parent
0574844a7f
commit
ccaad1d13d
|
@ -7,11 +7,11 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
CD2439342A82164E00A3BBF5 /* CapsuleVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2439332A82164E00A3BBF5 /* CapsuleVC.swift */; };
|
||||
CD2439342A82164E00A3BBF5 /* DemoCapsuleVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD2439332A82164E00A3BBF5 /* DemoCapsuleVC.swift */; };
|
||||
CD6537BF28C3311B00A5981B /* ListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537BE28C3311B00A5981B /* ListModel.swift */; };
|
||||
CD6537C128C35E1C00A5981B /* ListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C028C35E1C00A5981B /* ListVC.swift */; };
|
||||
CD6537C328C35E6200A5981B /* ToastVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C228C35E6200A5981B /* ToastVC.swift */; };
|
||||
CD6537C528C35F2C00A5981B /* SheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C428C35F2C00A5981B /* SheetVC.swift */; };
|
||||
CD6537C328C35E6200A5981B /* DemoToastVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C228C35E6200A5981B /* DemoToastVC.swift */; };
|
||||
CD6537C528C35F2C00A5981B /* DemoSheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6537C428C35F2C00A5981B /* DemoSheetVC.swift */; };
|
||||
CD6AE8A32A7CC1BA0044E53D /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CD6AE8A22A7CC1BA0044E53D /* SnapKit */; };
|
||||
CD891BCD2A80B58E00848BBC /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = CD891BCC2A80B58E00848BBC /* SnapKit */; };
|
||||
CD8EEF3B28BC5C7200E660EA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD8EEF3A28BC5C7200E660EA /* AppDelegate.swift */; };
|
||||
|
@ -22,16 +22,16 @@
|
|||
CD9C7B1E28CB8972006190CD /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD9C7B1D28CB8972006190CD /* Extensions.swift */; };
|
||||
CDA83DB928C601E60025F0DF /* TableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDA83DB828C601E60025F0DF /* TableHeaderView.swift */; };
|
||||
CDB6A2A228BC5F4600DEC80D /* ProHUD in Frameworks */ = {isa = PBXBuildFile; productRef = CDB6A2A128BC5F4600DEC80D /* ProHUD */; };
|
||||
CDB7A1D028C32A7400E034D8 /* AlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB7A1CF28C32A7400E034D8 /* AlertVC.swift */; };
|
||||
CDB7A1D028C32A7400E034D8 /* DemoAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB7A1CF28C32A7400E034D8 /* DemoAlertVC.swift */; };
|
||||
CDCBAEC42A80D6FD00C30DE5 /* ProHUD in Frameworks */ = {isa = PBXBuildFile; productRef = CDCBAEC32A80D6FD00C30DE5 /* ProHUD */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
CD2439332A82164E00A3BBF5 /* CapsuleVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapsuleVC.swift; sourceTree = "<group>"; };
|
||||
CD2439332A82164E00A3BBF5 /* DemoCapsuleVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoCapsuleVC.swift; sourceTree = "<group>"; };
|
||||
CD6537BE28C3311B00A5981B /* ListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListModel.swift; sourceTree = "<group>"; };
|
||||
CD6537C028C35E1C00A5981B /* ListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListVC.swift; sourceTree = "<group>"; };
|
||||
CD6537C228C35E6200A5981B /* ToastVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToastVC.swift; sourceTree = "<group>"; };
|
||||
CD6537C428C35F2C00A5981B /* SheetVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetVC.swift; sourceTree = "<group>"; };
|
||||
CD6537C228C35E6200A5981B /* DemoToastVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoToastVC.swift; sourceTree = "<group>"; };
|
||||
CD6537C428C35F2C00A5981B /* DemoSheetVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoSheetVC.swift; sourceTree = "<group>"; };
|
||||
CD8EEF3728BC5C7200E660EA /* PHDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PHDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
CD8EEF3A28BC5C7200E660EA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
CD8EEF3C28BC5C7200E660EA /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
|
@ -41,7 +41,7 @@
|
|||
CD8EEF4828BC5C7300E660EA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
CD9C7B1D28CB8972006190CD /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
|
||||
CDA83DB828C601E60025F0DF /* TableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableHeaderView.swift; sourceTree = "<group>"; };
|
||||
CDB7A1CF28C32A7400E034D8 /* AlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertVC.swift; sourceTree = "<group>"; };
|
||||
CDB7A1CF28C32A7400E034D8 /* DemoAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoAlertVC.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -85,10 +85,10 @@
|
|||
CDA83DB828C601E60025F0DF /* TableHeaderView.swift */,
|
||||
CD9C7B1D28CB8972006190CD /* Extensions.swift */,
|
||||
CD6537C028C35E1C00A5981B /* ListVC.swift */,
|
||||
CD6537C228C35E6200A5981B /* ToastVC.swift */,
|
||||
CDB7A1CF28C32A7400E034D8 /* AlertVC.swift */,
|
||||
CD6537C428C35F2C00A5981B /* SheetVC.swift */,
|
||||
CD2439332A82164E00A3BBF5 /* CapsuleVC.swift */,
|
||||
CD6537C228C35E6200A5981B /* DemoToastVC.swift */,
|
||||
CDB7A1CF28C32A7400E034D8 /* DemoAlertVC.swift */,
|
||||
CD6537C428C35F2C00A5981B /* DemoSheetVC.swift */,
|
||||
CD2439332A82164E00A3BBF5 /* DemoCapsuleVC.swift */,
|
||||
CD8EEF4028BC5C7200E660EA /* Main.storyboard */,
|
||||
CD8EEF4328BC5C7300E660EA /* Assets.xcassets */,
|
||||
CD8EEF4528BC5C7300E660EA /* LaunchScreen.storyboard */,
|
||||
|
@ -186,10 +186,10 @@
|
|||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CDA83DB928C601E60025F0DF /* TableHeaderView.swift in Sources */,
|
||||
CD6537C528C35F2C00A5981B /* SheetVC.swift in Sources */,
|
||||
CD2439342A82164E00A3BBF5 /* CapsuleVC.swift in Sources */,
|
||||
CD6537C328C35E6200A5981B /* ToastVC.swift in Sources */,
|
||||
CDB7A1D028C32A7400E034D8 /* AlertVC.swift in Sources */,
|
||||
CD6537C528C35F2C00A5981B /* DemoSheetVC.swift in Sources */,
|
||||
CD2439342A82164E00A3BBF5 /* DemoCapsuleVC.swift in Sources */,
|
||||
CD6537C328C35E6200A5981B /* DemoToastVC.swift in Sources */,
|
||||
CDB7A1D028C32A7400E034D8 /* DemoAlertVC.swift in Sources */,
|
||||
CD6537C128C35E1C00A5981B /* ListVC.swift in Sources */,
|
||||
CD8EEF3B28BC5C7200E660EA /* AppDelegate.swift in Sources */,
|
||||
CD8EEF3D28BC5C7200E660EA /* SceneDelegate.swift in Sources */,
|
||||
|
|
|
@ -2,16 +2,15 @@
|
|||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22152" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="06J-FN-U3n">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22127"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--AlertVC-->
|
||||
<!--Demo AlertVC-->
|
||||
<scene sceneID="LP0-RE-kvY">
|
||||
<objects>
|
||||
<tableViewController id="NBo-Re-tKO" customClass="AlertVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="NBo-Re-tKO" customClass="DemoAlertVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" id="eCS-6f-ub3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
@ -60,10 +59,10 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="1865.217391304348" y="71.651785714285708"/>
|
||||
</scene>
|
||||
<!--ToastVC-->
|
||||
<!--Demo ToastVC-->
|
||||
<scene sceneID="DAh-i5-GcF">
|
||||
<objects>
|
||||
<tableViewController id="h7R-Kd-Dn5" customClass="ToastVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="h7R-Kd-Dn5" customClass="DemoToastVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" id="MVT-cH-t1Z">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
@ -90,10 +89,10 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="1863.7681159420292" y="803.57142857142856"/>
|
||||
</scene>
|
||||
<!--SheetVC-->
|
||||
<!--Demo SheetVC-->
|
||||
<scene sceneID="DG9-RE-7gC">
|
||||
<objects>
|
||||
<tableViewController id="9SY-ag-pK6" customClass="SheetVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="9SY-ag-pK6" customClass="DemoSheetVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" id="N9I-Aa-GtP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
@ -120,10 +119,10 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="5471.0144927536239" y="803.57142857142856"/>
|
||||
</scene>
|
||||
<!--CapsuleVC-->
|
||||
<!--Demo CapsuleVC-->
|
||||
<scene sceneID="Bhf-XS-ITh">
|
||||
<objects>
|
||||
<tableViewController id="xyo-OI-w9X" customClass="CapsuleVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController id="xyo-OI-w9X" customClass="DemoCapsuleVC" customModule="PHDemo" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" estimatedSectionHeaderHeight="-1" sectionFooterHeight="18" estimatedSectionFooterHeight="-1" id="jta-3v-OTY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// AlertVC.swift
|
||||
// DemoAlertVC.swift
|
||||
// PHDemo
|
||||
//
|
||||
// Created by xaoxuu on 2022/9/3.
|
||||
|
@ -8,7 +8,7 @@
|
|||
import UIKit
|
||||
import ProHUD
|
||||
|
||||
class AlertVC: ListVC {
|
||||
class DemoAlertVC: ListVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
@ -29,9 +29,7 @@ class AlertVC: ListVC {
|
|||
|
||||
list.add(title: "纯文字") { section in
|
||||
section.add(title: "只有一句话") {
|
||||
// Alert(.message("只有一句话").duration(2))
|
||||
// 可以简写成这样:
|
||||
Alert("只有一句话")
|
||||
Alert(.message("只有一句话").duration(2))
|
||||
}
|
||||
section.add(title: "标题 + 正文") {
|
||||
let title = "这是标题"
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// CapsuleVC.swift
|
||||
// DemoCapsuleVC.swift
|
||||
// PHDemo
|
||||
//
|
||||
// Created by xaoxuu on 2022/9/3.
|
||||
|
@ -8,7 +8,7 @@
|
|||
import UIKit
|
||||
import ProHUD
|
||||
|
||||
class CapsuleVC: ListVC {
|
||||
class DemoCapsuleVC: ListVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// SheetVC.swift
|
||||
// DemoSheetVC.swift
|
||||
// PHDemo
|
||||
//
|
||||
// Created by xaoxuu on 2022/9/3.
|
||||
|
@ -8,7 +8,7 @@
|
|||
import UIKit
|
||||
import ProHUD
|
||||
|
||||
class SheetVC: ListVC {
|
||||
class DemoSheetVC: ListVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// ToastVC.swift
|
||||
// DemoToastVC.swift
|
||||
// PHDemo
|
||||
//
|
||||
// Created by xaoxuu on 2022/9/3.
|
||||
|
@ -44,7 +44,7 @@ class TestToast: ToastProvider {
|
|||
typealias Target = TestToastTarget
|
||||
}
|
||||
|
||||
class ToastVC: ListVC {
|
||||
class DemoToastVC: ListVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
|
@ -16,6 +16,10 @@ open class AlertProvider: HUDProvider<AlertViewModel, AlertTarget> {
|
|||
super.init(initializer: initializer)
|
||||
}
|
||||
|
||||
/// 根据ViewModel和自定义的初始化代码创建一个Target并显示
|
||||
/// - Parameters:
|
||||
/// - vm: 数据模型
|
||||
/// - initializer: 自定义的初始化代码
|
||||
@discardableResult public convenience init(_ vm: ViewModel, initializer: ((_ alert: Target) -> Void)?) {
|
||||
self.init { alert in
|
||||
alert.vm = vm
|
||||
|
@ -28,11 +32,6 @@ open class AlertProvider: HUDProvider<AlertViewModel, AlertTarget> {
|
|||
self.init(vm, initializer: nil)
|
||||
}
|
||||
|
||||
@discardableResult @objc public convenience init(_ text: String, duration: TimeInterval = 3) {
|
||||
self.init(.message(text).duration(duration), initializer: nil)
|
||||
}
|
||||
|
||||
|
||||
/// 如果不存在就创建并弹出一个HUD实例,如果存在就更新实例
|
||||
/// - Parameters:
|
||||
/// - identifier: 实例唯一标识符(如果为空,则以代码位置为唯一标识符)
|
||||
|
|
|
@ -33,6 +33,8 @@ open class CapsuleProvider: HUDProvider<CapsuleViewModel, CapsuleTarget> {
|
|||
self.init(vm, initializer: nil)
|
||||
}
|
||||
|
||||
/// 根据文本作为数据模型创建一个Target并显示
|
||||
/// - Parameter text: 文本
|
||||
@discardableResult public convenience init(_ text: String) {
|
||||
self.init(.message(text), initializer: nil)
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ open class ToastProvider: HUDProvider<ToastViewModel, ToastTarget> {
|
|||
super.init(initializer: initializer)
|
||||
}
|
||||
|
||||
/// 根据ViewModel和自定义的初始化代码创建一个Target并显示
|
||||
/// - Parameters:
|
||||
/// - vm: 数据模型
|
||||
/// - initializer: 自定义的初始化代码
|
||||
@discardableResult public convenience init(_ vm: ViewModel, initializer: ((_ toast: Target) -> Void)?) {
|
||||
self.init { toast in
|
||||
toast.vm = vm
|
||||
|
@ -29,6 +33,8 @@ open class ToastProvider: HUDProvider<ToastViewModel, ToastTarget> {
|
|||
self.init(vm, initializer: nil)
|
||||
}
|
||||
|
||||
/// 根据文本作为数据模型创建一个Target并显示
|
||||
/// - Parameter text: 文本
|
||||
@discardableResult @objc public convenience init(_ text: String) {
|
||||
self.init(.message(text), initializer: nil)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue