iOS-YYKit(控件)

YYAnimatedImageView

加載GIF,可以暫停和開始
- (void)YYAnimatedImageView {
    animatedImageView = [[YYAnimatedImageView alloc]initWithFrame:CGRectMake(20, 100, 300, 300)];
    [self.view addSubview:animatedImageView];
    YYImage *image = [YYImage imageNamed:@"animalGIF"];
    animatedImageView.image = image;
}
- (void)stop {
    [animatedImageView stopAnimating]; // startAnimating
}

YYCache - 本地存儲(chǔ)數(shù)據(jù),類似NSUserDefaults


- (void)YYCache{
    
    // 0.初始化YYCache
    YYCache *cache = [YYCache cacheWithName:@"mydb"];
    
    // 1.緩存普通字符
    [cache setObject:@"我的名字" forKey:@"name"];
    
    // 2.取字符串
    NSString *name = (NSString *)[cache objectForKey:@"name"];
    NSLog(@"name: %@", name);
    
    // 3.刪除
    [cache removeObjectForKey:@"name"];
    
    // 4.是否包含
    [cache containsObjectForKey:@"name"];

}

YYFileHash - 加密

@property (nullable, nonatomic, strong, readonly) NSString *md2String; ///< md2 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *md4String; ///< md4 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *md5String; ///< md5 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *sha1String; ///< sha1 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *sha224String; ///< sha224 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *sha256String; ///< sha256 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *sha384String; ///< sha384 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *sha512String; ///< sha512 hash string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *crc32String; ///< crc32 checksum string in lowercase
@property (nullable, nonatomic, strong, readonly) NSString *adler32String; ///< adler32 checksum string in lowercase

@property (nullable, nonatomic, strong, readonly) NSData *md2Data; ///< md2 hash
@property (nullable, nonatomic, strong, readonly) NSData *md4Data; ///< md4 hash
@property (nullable, nonatomic, strong, readonly) NSData *md5Data; ///< md5 hash
@property (nullable, nonatomic, strong, readonly) NSData *sha1Data; ///< sha1 hash
@property (nullable, nonatomic, strong, readonly) NSData *sha224Data; ///< sha224 hash
@property (nullable, nonatomic, strong, readonly) NSData *sha256Data; ///< sha256 hash
@property (nullable, nonatomic, strong, readonly) NSData *sha384Data; ///< sha384 hash
@property (nullable, nonatomic, strong, readonly) NSData *sha512Data; ///< sha512 hash
@property (nonatomic, readonly) uint32_t crc32; ///< crc32 checksum
@property (nonatomic, readonly) uint32_t adler32; ///< adler32 checksum

YYLabel - 設(shè)置某個(gè)字符串可以點(diǎn)擊

- (void)YYLabel {
    YYLabel *_agressLabel = [[YYLabel alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width - 30, 100)];
    [self.view addSubview:_agressLabel];
    
    NSMutableAttributedString *text  = [[NSMutableAttributedString alloc] initWithString: @"德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞德瑪西亞"];
    text.lineSpacing = 10; // 行間距
    text.font = [UIFont systemFontOfSize:14];
    text.color = [UIColor blackColor];
    [text setTextHighlightRange:NSMakeRange(10, 7) color:[UIColor redColor] backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
        NSLog(@"被點(diǎn)擊了");
    
    }];
    _agressLabel.numberOfLines = 0;  //設(shè)置多行顯示
    _agressLabel.preferredMaxLayoutWidth = self.view.frame.size.width - 30; //設(shè)置最大的寬度
    _agressLabel.attributedText = text;  //設(shè)置富文本
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 15,376評論 4 61
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,569評論 19 139
  • Swift版本點(diǎn)擊這里歡迎加入QQ群交流: 594119878最新更新日期:18-09-17 About A cu...
    ylgwhyh閱讀 26,137評論 7 249
  • 每個(gè)人都有一些特別的日子值得紀(jì)念。于我而言,二零零二年的五月十三日極其難忘。兩個(gè)原因:一,我最愛的女兒是日抓周。二...
    楊昌林閱讀 489評論 1 0
  • 等你十載候你十個(gè)春夏換來的是無言的對白我苦苦追尋苦苦守候的日子已化為烏有隨風(fēng)飄散心底的火苗已轉(zhuǎn)瞬即逝 我無淚我無痛...
    玥萱兒閱讀 173評論 0 0

友情鏈接更多精彩內(nèi)容