惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
P
Proofpoint News Feed
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog
A
About on SuperTechFans
T
Tenable Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
I
Intezer
D
DataBreaches.Net
爱范儿
爱范儿
T
Threatpost
C
CERT Recently Published Vulnerability Notes
云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
K
Kaspersky official blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Y
Y Combinator Blog
Cyberwarzone
Cyberwarzone
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
AWS News Blog
AWS News Blog
博客园 - 聂微东
C
Check Point Blog
S
Securelist
有赞技术团队
有赞技术团队
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
D
Docker
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tailwind CSS Blog
L
Lohrmann on Cybersecurity
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog

博客园 - 王彬iOS

AI时代iOS开发未来在哪里 iOS继承和多态 iOS OC中多线程总结 UIVIew和CALayer的区别 iOS远程推送APNs原理和基本配置 iOS App启动过程 写个文章 iOS强制关闭暗黑模式2021.12.2 【原创】关于github那些事:如何把项目提交到coding上/gitLab上 Mac-Macs Fan Control(控制温度、随时改变风扇转速、电脑降温) Excel使用基础 NSRunLoopCommonModes和NSDefaultRunLoopMode区别(Timer) 数据统计---埋点 【问题汇总】iOS数据持久化 iOS APP 如何做才安全 【问题汇总】 【原创】苹果设备数据标准 【面试题】iOS知识大全 Swift——convenience(便利构造函数)和类方法
SVProgressHUD方法
王彬iOS · 2018-06-11 · via 博客园 - 王彬iOS

第三方框架中关于HUD有MBProgressHUD和SVProgressHUD

我觉得会一种就可以了,综合前辈们的经验选择了后者,然后就花了一点时间,把他的方法都看了一下。在这里用作记录,供自己巩固和查阅。

方法

SVProgressHUD所以的方法都是类方法,并且对象是通过单例创建。由于方法都是通过类名调用,简单明了。

基本方法
 + (void)show;    显示:状态是一个迅速转动的圈
     + (void)showWithMaskType:(SVProgressHUDMaskType)maskType; 显示并且带着一个状态
     + (void)showWithStatus:(NSString*)status; 显示并且带着文字
     + (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
     
     + (void)showProgress:(float)progress;  

关于HUD的属性配置

     + (void)setBackgroundColor:(UIColor*)color;       //背景颜色          // default is [UIColor whiteColor]
     + (void)setForegroundColor:(UIColor*)color;       

关于HUD的通知

 extern NSString * const SVProgressHUDDidReceiveTouchEventNotification; 在HUD外点击
 extern NSString * const SVProgressHUDDidTouchDownInsideNotification; 在HUD中点击
 extern NSString * const SVProgressHUDWillDisappearNotification;  将要显示
 extern NSString * const SVProgressHUDDidDisappearNotification;   已经显示
 extern NSString * const SVProgressHUDWillAppearNotification;     将要消失
 extern NSString * const SVProgressHUDDidAppearNotification;      已经消失
 
 extern NSString * const SVProgressHUDStatusUserInfoKey; HUD的状态  

在通知中userInfo字典中存储了HUD的状态,其key为SVProgressHUDStatusUserInfoKey

MBProgressHUD的基本使用

    /**
     *  类方法
     */
    /*
     
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    
    @weakify(hud)
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        @strongify(hud)
        
        [MBProgressHUD hideAllHUDsForView:self.view animated:YES];
        
    });
    */
    
    /**
     *  实例方法
     */
    MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.view];