Markup is simple and useful Markup Language。it was wirtten by Js and widely used in web. We alse can use it in Native code, So I rewrite it by Objective C . When you write iOS App , you can think about it .
Why use markup
1.markup is powerful,simple, and lightly
2.markup can combine temple and data,which help you merge data to view. you need not write hard code in your project.
Markup for Objective C
Markup is simple and useful Markup Language。it was wirtten by Js and widely used in web. We alse can use it in Native code, So I rewrite it by Objective C . When you write iOS App , you can think about it .
Why use markup
1.markup is powerful,simple, and lightly
2.markup can combine temple and data,which help you merge data to view. you need not write hard code in your project.
3.lots of project use markup ,such as vue.js.
How to use
-(NSString*) markupWithTemp:(id)tpContent withContent:(id)context withOption:(id)options;example
value
template: Hi, {{name.first}}!
data: { name: { first: “John”, last: “Doe” } }
output:"Hi, John!"Array
template:Favorite color: {{colors.0}}
data:{ name: “John Doe”, colors: [“Red”, “Blue”, “Green”] }
output:"Favorite color: Red"Loops
<ul>{{brothers}}<li>{{.}}</li>{{/brothers}}</ul>output:<ul><li>Jack</li><li>Joe</li><li>Jim</li></ul>Pipes
Name: {{name|upcase}}Chaining pipes
IF and IF/ELSE statements