All Projects → lyb5834 → YBAttributeString

lyb5834 / YBAttributeString

Licence: MIT license
用Masonry的语法写NSAttributedString/a fast way to create attributedString like Masonry

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to YBAttributeString

Ordnung
The 1kb alternative to Isotope
Stars: ✭ 79 (+426.67%)
Mutual labels:  masonry
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+14366.67%)
Mutual labels:  masonry
react-mason
React Masonry grid
Stars: ✭ 13 (-13.33%)
Mutual labels:  masonry
Justified Gallery
Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
Stars: ✭ 1,512 (+9980%)
Mutual labels:  masonry
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (+913.33%)
Mutual labels:  masonry
Ragrid
Intrinsic first auto-layout flexbox grid
Stars: ✭ 249 (+1560%)
Mutual labels:  masonry
Screenadaptationkit
🎨iOS rapidScreen Compatible AdapterKit(Deprecate)
Stars: ✭ 70 (+366.67%)
Mutual labels:  masonry
react-plock
Plock is a responsive masonry layout implementation for React.
Stars: ✭ 118 (+686.67%)
Mutual labels:  masonry
Vue Magic Grid
🧙‍♂️🔌 Responsive Magic Grid for Vue
Stars: ✭ 162 (+980%)
Mutual labels:  masonry
egjs-grid
A component that can arrange items according to the type of grids
Stars: ✭ 188 (+1153.33%)
Mutual labels:  masonry
Flexlib
FlexLib是一个基于flexbox模型,使用xml文件进行界面布局的框架,融合了web快速布局的能力,让iOS界面开发像写网页一样简单快速
Stars: ✭ 1,569 (+10360%)
Mutual labels:  masonry
Opensource
♨️ 分享GitHub优秀开源项目和主流开发使用的网站、解决问题方案收集以及学习网站或资料,涵盖了iOS, macOS X, Blockchain, Flutter, Weex, H5, Games, C++, Script等多方面的内容,其中iOS大致包涵以下内容:音视频;IM和直播;逆向开发;图像相关(OpenGL, Metal, GPUImage);内购(IAP), ApplePay和第三方支付;安全攻防和应用加固, 数据安全和算法;常用第三方库;导航栏和状态栏;侧边菜单;数据持久;蓝牙, 手势指纹面容ID解锁, 图片浏览器, 扫码, 下拉和上拉刷新, 指示器, Toast, Menu, Sensor, Privacy, WebView和进度条, 动画, 选择器, 搜索, 分享, 图片验证码, 设备相关信息, 广告, 高仿项目及Demo等。
Stars: ✭ 123 (+720%)
Mutual labels:  masonry
React Snuggle
An intimate and comfortable way to layout your components
Stars: ✭ 251 (+1573.33%)
Mutual labels:  masonry
Ngx Masonry
Angular Module for displaying a feed of items in a masonry layout
Stars: ✭ 102 (+580%)
Mutual labels:  masonry
react-native-masonry-list
The Masonry List implementation which has similar implementation as the `FlatList` in React Native
Stars: ✭ 255 (+1600%)
Mutual labels:  masonry
Vue Masonry Wall
A pure vue responsive masonry layout without direct dom manipulation and ssr support.
Stars: ✭ 79 (+426.67%)
Mutual labels:  masonry
Masonic
🧱 High-performance masonry layouts for React
Stars: ✭ 209 (+1293.33%)
Mutual labels:  masonry
mpMasonry
小程序瀑布流组件
Stars: ✭ 35 (+133.33%)
Mutual labels:  masonry
masonry-css
Create mosaic grid, like masonry, with css only
Stars: ✭ 17 (+13.33%)
Mutual labels:  masonry
angular-masonry
A simple lightweight library to use Masonry layout in Angular
Stars: ✭ 11 (-26.67%)
Mutual labels:  masonry

YBAttributeString

用Masonry的语法写NSAttributedString/a fast way to create attributedString like Masonry

 效果图

(演示效果)

简介

众所周知,Masonry是一个非常优秀的AutoLayout三方库,它最方便的地方在于巧妙的用了优雅且简洁的链式语法,本框架也使用了类似Masonry的链式语法,让设置attributedString方便优雅起来。

优势

  • 拒绝大量繁琐的系统API
  • 一键设置 NSParagraphStyleAttributeNameNSShadowAttributeNameNSAttachmentAttributeName
  • 不侵入,不破坏原本API

PS

  • xcode 8.3 以后,block的get方法也会自动补全了哦,使用本框架更方便了

用法

[text yb_makeAttributes:^(YBAttributeMake *make) { 
* 普通用法
       make.yb_font([UIFont systemFontOfSize:20]).yb_range(10, 50);
* 快捷用法
       make.yb_font([UIFont systemFontOfSize:20]).yb_range(10, 50).yb_range(60, 50);
  }];  

注意

  • 设置NSParagraphStyleAttributeName相关属性的时候,结尾必须是yb_all(),不然无效
  • 设置NSAttachmentAttributeName相关属性的时候,结尾必须是yb_location(integer),不然无效

cocoaPods 支持

  • 只需在Podfile中加入pod 'YBAttributeString'pod install即可

版本支持

  • xcode7.0+

  • 如果您在使用本库的过程中发现任何bug或者有更好建议,欢迎联系本人email [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].