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 - 本地存儲數據,類似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 - 設置某個字符串可以點擊

- (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(@"被點擊了");
    
    }];
    _agressLabel.numberOfLines = 0;  //設置多行顯示
    _agressLabel.preferredMaxLayoutWidth = self.view.frame.size.width - 30; //設置最大的寬度
    _agressLabel.attributedText = text;  //設置富文本
}
?著作權歸作者所有,轉載或內容合作請聯系作者
  • 序言:七十年代末洛巢,一起剝皮案震驚了整個濱河市群叶,隨后出現的幾起案子,更是在濱河造成了極大的恐慌弓摘,老刑警劉巖陨瘩,帶你破解...
    沈念sama閱讀 217,277評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件娜膘,死亡現場離奇詭異,居然都是意外死亡优质,警方通過查閱死者的電腦和手機竣贪,發(fā)現死者居然都...
    沈念sama閱讀 92,689評論 3 393
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來巩螃,“玉大人演怎,你說我怎么就攤上這事”芊Γ” “怎么了爷耀?”我有些...
    開封第一講書人閱讀 163,624評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長拍皮。 經常有香客問我歹叮,道長,這世上最難降的妖魔是什么铆帽? 我笑而不...
    開封第一講書人閱讀 58,356評論 1 293
  • 正文 為了忘掉前任咆耿,我火速辦了婚禮,結果婚禮上爹橱,老公的妹妹穿的比我還像新娘萨螺。我一直安慰自己,他們只是感情好愧驱,可當我...
    茶點故事閱讀 67,402評論 6 392
  • 文/花漫 我一把揭開白布慰技。 她就那樣靜靜地躺著,像睡著了一般组砚。 火紅的嫁衣襯著肌膚如雪吻商。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,292評論 1 301
  • 那天糟红,我揣著相機與錄音手报,去河邊找鬼。 笑死改化,一個胖子當著我的面吹牛掩蛤,可吹牛的內容都是我干的。 我是一名探鬼主播陈肛,決...
    沈念sama閱讀 40,135評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼揍鸟,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起阳藻,我...
    開封第一講書人閱讀 38,992評論 0 275
  • 序言:老撾萬榮一對情侶失蹤晰奖,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后腥泥,有當地人在樹林里發(fā)現了一具尸體匾南,經...
    沈念sama閱讀 45,429評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,636評論 3 334
  • 正文 我和宋清朗相戀三年蛔外,在試婚紗的時候發(fā)現自己被綠了蛆楞。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,785評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡夹厌,死狀恐怖豹爹,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情矛纹,我是刑警寧澤臂聋,帶...
    沈念sama閱讀 35,492評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站或南,受9級特大地震影響孩等,放射性物質發(fā)生泄漏。R本人自食惡果不足惜采够,卻給世界環(huán)境...
    茶點故事閱讀 41,092評論 3 328
  • 文/蒙蒙 一瞎访、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧吁恍,春花似錦扒秸、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,723評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至翼闽,卻和暖如春拾徙,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背感局。 一陣腳步聲響...
    開封第一講書人閱讀 32,858評論 1 269
  • 我被黑心中介騙來泰國打工尼啡, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人询微。 一個月前我還...
    沈念sama閱讀 47,891評論 2 370
  • 正文 我出身青樓崖瞭,卻偏偏與公主長得像,于是被迫代替她去往敵國和親撑毛。 傳聞我的和親對象是個殘疾皇子书聚,可洞房花燭夜當晚...
    茶點故事閱讀 44,713評論 2 354

推薦閱讀更多精彩內容

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