TemplateInfo 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. data/.DS_Store +0 -0
  2. data/.gitignore +2 -0
  3. data/TemplateInfo.gemspec +1 -1
  4. data/bin/tif_create.rb +157 -0
  5. data/lib/TemplateInfo/version.rb +1 -1
  6. data/test.xctemplate/.DS_Store +0 -0
  7. data/test.xctemplate/TemplateInfo.plist +2830 -0
  8. data/test.xctemplate/TemplateInfo.xml +2842 -0
  9. data/test.xctemplate/libs/BeeFramework/Bee.h +35 -0
  10. data/test.xctemplate/libs/BeeFramework/Bee_Precompile.h +143 -0
  11. data/test.xctemplate/libs/BeeFramework/Core/Bee_Core.h +36 -0
  12. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.h +54 -0
  13. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.mm +33 -0
  14. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.h +64 -0
  15. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.mm +164 -0
  16. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.h +111 -0
  17. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.mm +122 -0
  18. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.h +98 -0
  19. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.mm +437 -0
  20. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.h +45 -0
  21. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.mm +81 -0
  22. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.h +47 -0
  23. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.mm +34 -0
  24. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.h +62 -0
  25. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.m +147 -0
  26. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.h +64 -0
  27. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.mm +91 -0
  28. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.h +76 -0
  29. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.m +300 -0
  30. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.h +44 -0
  31. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.m +92 -0
  32. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.h +44 -0
  33. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.m +85 -0
  34. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.h +90 -0
  35. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.m +509 -0
  36. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.h +50 -0
  37. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.m +64 -0
  38. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.h +43 -0
  39. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.m +116 -0
  40. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.h +66 -0
  41. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.m +150 -0
  42. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.h +210 -0
  43. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.m +34 -0
  44. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.h +41 -0
  45. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.m +156 -0
  46. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.h +49 -0
  47. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.m +109 -0
  48. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.h +86 -0
  49. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.m +464 -0
  50. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.h +36 -0
  51. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.m +33 -0
  52. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.h +144 -0
  53. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.m +560 -0
  54. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.h +99 -0
  55. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.m +742 -0
  56. data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.h +62 -0
  57. data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.m +175 -0
  58. data/test.xctemplate/libs/BeeFramework/Core/Storage/0.2.4.zip +0 -0
  59. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.h +133 -0
  60. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.m +641 -0
  61. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.h +106 -0
  62. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.m +1956 -0
  63. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.h +91 -0
  64. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.m +318 -0
  65. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.h +223 -0
  66. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.m +3007 -0
  67. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.h +55 -0
  68. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.m +173 -0
  69. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.h +39 -0
  70. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.m +33 -0
  71. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.h +47 -0
  72. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.m +81 -0
  73. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.h +44 -0
  74. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.m +57 -0
  75. data/test.xctemplate/libs/BeeFramework/MVC/Bee_MVC.h +49 -0
  76. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.h +66 -0
  77. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.mm +228 -0
  78. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.h +209 -0
  79. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.mm +873 -0
  80. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.h +75 -0
  81. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.mm +389 -0
  82. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.h +52 -0
  83. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.m +150 -0
  84. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.h +49 -0
  85. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.mm +201 -0
  86. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.h +52 -0
  87. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.mm +118 -0
  88. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.h +49 -0
  89. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.mm +78 -0
  90. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.h +57 -0
  91. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.mm +138 -0
  92. data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.h +64 -0
  93. data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.m +190 -0
  94. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.h +71 -0
  95. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.m +307 -0
  96. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.h +52 -0
  97. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.m +152 -0
  98. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.h +73 -0
  99. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.m +234 -0
  100. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.h +97 -0
  101. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.m +424 -0
  102. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.h +78 -0
  103. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.m +362 -0
  104. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.h +82 -0
  105. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.m +298 -0
  106. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.h +110 -0
  107. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.m +541 -0
  108. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.h +74 -0
  109. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.m +243 -0
  110. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.h +46 -0
  111. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.m +99 -0
  112. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.h +124 -0
  113. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.m +821 -0
  114. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.h +57 -0
  115. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.m +161 -0
  116. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.h +60 -0
  117. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.m +146 -0
  118. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.h +61 -0
  119. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.m +190 -0
  120. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.h +47 -0
  121. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.m +113 -0
  122. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.h +71 -0
  123. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.m +236 -0
  124. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.h +146 -0
  125. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.m +1487 -0
  126. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.h +60 -0
  127. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.m +192 -0
  128. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.h +126 -0
  129. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.m +453 -0
  130. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.h +70 -0
  131. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.m +249 -0
  132. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.h +67 -0
  133. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.m +242 -0
  134. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.h +75 -0
  135. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.m +311 -0
  136. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.h +184 -0
  137. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.m +911 -0
  138. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.h +65 -0
  139. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.m +242 -0
  140. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.h +91 -0
  141. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.m +444 -0
  142. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.h +72 -0
  143. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.m +38 -0
  144. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.h +79 -0
  145. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.m +288 -0
  146. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.h +65 -0
  147. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.m +161 -0
  148. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.h +45 -0
  149. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.m +137 -0
  150. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.h +56 -0
  151. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.m +218 -0
  152. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.h +105 -0
  153. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.m +556 -0
  154. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.h +53 -0
  155. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.m +104 -0
  156. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.h +52 -0
  157. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.m +170 -0
  158. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.h +54 -0
  159. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.m +166 -0
  160. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.h +54 -0
  161. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.m +184 -0
  162. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.h +57 -0
  163. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.m +275 -0
  164. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.h +212 -0
  165. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.m +1219 -0
  166. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.h +111 -0
  167. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.m +694 -0
  168. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.h +71 -0
  169. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.m +258 -0
  170. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.h +45 -0
  171. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.m +36 -0
  172. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.h +57 -0
  173. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.m +151 -0
  174. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.h +53 -0
  175. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.m +92 -0
  176. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.h +72 -0
  177. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.m +175 -0
  178. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.h +59 -0
  179. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.m +249 -0
  180. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.h +199 -0
  181. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.m +1170 -0
  182. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.h +113 -0
  183. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.m +710 -0
  184. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.h +66 -0
  185. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.m +189 -0
  186. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.h +69 -0
  187. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.m +210 -0
  188. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.h +45 -0
  189. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.m +59 -0
  190. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.h +45 -0
  191. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.m +55 -0
  192. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.h +45 -0
  193. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.m +54 -0
  194. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.h +45 -0
  195. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.m +54 -0
  196. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.h +45 -0
  197. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.m +438 -0
  198. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.h +60 -0
  199. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.m +37 -0
  200. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.h +45 -0
  201. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.m +55 -0
  202. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.h +45 -0
  203. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.m +55 -0
  204. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.h +41 -0
  205. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.m +100 -0
  206. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.h +41 -0
  207. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.m +101 -0
  208. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.h +41 -0
  209. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.m +48 -0
  210. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.h +41 -0
  211. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.m +77 -0
  212. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.h +41 -0
  213. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.m +47 -0
  214. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.h +52 -0
  215. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.m +177 -0
  216. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.h +44 -0
  217. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.m +57 -0
  218. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.h +50 -0
  219. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.m +283 -0
  220. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.h +52 -0
  221. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.m +178 -0
  222. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.h +44 -0
  223. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.m +58 -0
  224. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.h +44 -0
  225. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.m +57 -0
  226. metadata +226 -3
@@ -0,0 +1,52 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUILayout.h
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_UILayout.h"
37
+
38
+ #pragma mark -
39
+
40
+ @interface UIView(BeeUILayout)
41
+
42
+ @property (nonatomic, retain) NSString * templateResource;
43
+ @property (nonatomic, retain) NSString * templateFile;
44
+ @property (nonatomic, retain) BeeUILayout * layout;
45
+ @property (nonatomic, readonly) BeeUILayoutBlock BEGIN_LAYOUT;
46
+ @property (nonatomic, readonly) BeeUILayoutBlock RELAYOUT;
47
+ @property (nonatomic, readonly) BeeUILayoutBlockS FROM_RESOURCE;
48
+ @property (nonatomic, readonly) BeeUILayoutBlockS FROM_FILE;
49
+
50
+ @end
51
+
52
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -0,0 +1,177 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUILayout.m
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_Log.h"
37
+ #import "Bee_UILayout.h"
38
+ #import "Bee_UITemplate.h"
39
+ #import "UIView+BeeUILayout.h"
40
+ #include <objc/runtime.h>
41
+ #include <execinfo.h>
42
+
43
+ #pragma mark -
44
+
45
+ #undef KEY_LAYOUT
46
+ #define KEY_LAYOUT "UIView.layout"
47
+
48
+ #pragma mark -
49
+
50
+ @implementation UIView(BeeUILayout)
51
+
52
+ @dynamic templateResource;
53
+ @dynamic templateFile;
54
+
55
+ @dynamic layout;
56
+ @dynamic BEGIN_LAYOUT;
57
+ @dynamic FROM_RESOURCE;
58
+ @dynamic FROM_FILE;
59
+
60
+ - (void)setTemplateFile:(NSString *)templateFile
61
+ {
62
+ BeeUITemplate * temp = [BeeUITemplate fromFile:templateFile];
63
+ if ( temp && temp.rootLayout )
64
+ {
65
+ self.layout = temp.rootLayout;
66
+ self.layout.canvas = self;
67
+ self.layout.REBUILD();
68
+ }
69
+ }
70
+
71
+ - (void)setTemplateResource:(NSString *)templateResource
72
+ {
73
+ BeeUITemplate * temp = [BeeUITemplate fromResource:templateResource];
74
+ if ( temp && temp.rootLayout )
75
+ {
76
+ self.layout = temp.rootLayout;
77
+ self.layout.canvas = self;
78
+ self.layout.REBUILD();
79
+ }
80
+ }
81
+
82
+ - (BeeUILayout *)layout
83
+ {
84
+ BeeUILayout * layout = objc_getAssociatedObject( self, KEY_LAYOUT );
85
+ if ( nil == layout )
86
+ {
87
+ layout = [[[BeeUILayout alloc] init] autorelease];
88
+ layout.canvas = self;
89
+ objc_setAssociatedObject( self, KEY_LAYOUT, layout, OBJC_ASSOCIATION_RETAIN_NONATOMIC );
90
+ }
91
+ return layout;
92
+ }
93
+
94
+ - (void)setLayout:(BeeUILayout *)newLayout
95
+ {
96
+ BeeUILayout * layout = objc_getAssociatedObject( self, KEY_LAYOUT );
97
+ if ( layout != newLayout )
98
+ {
99
+ newLayout.canvas = self;
100
+ objc_setAssociatedObject( self, KEY_LAYOUT, newLayout, OBJC_ASSOCIATION_RETAIN_NONATOMIC );
101
+ }
102
+ }
103
+
104
+ - (BeeUILayoutBlock)BEGIN_LAYOUT
105
+ {
106
+ BeeUILayoutBlock block = ^ BeeUILayout * ( void )
107
+ {
108
+ CC( @"begin layout" );
109
+
110
+ BeeLogIndent( 1 );
111
+
112
+ BeeUILayout * layout = [self layout];
113
+ [layout.childs removeAllObjects];
114
+ return layout;
115
+ };
116
+
117
+ return [[block copy] autorelease];
118
+ }
119
+
120
+ - (BeeUILayoutBlock)RELAYOUT
121
+ {
122
+ BeeUILayoutBlock block = ^ BeeUILayout * ( void )
123
+ {
124
+ BeeUILayout * layout = [self layout];
125
+ if ( layout )
126
+ {
127
+ layout.RELAYOUT();
128
+ }
129
+ else
130
+ {
131
+ [self layoutSubviews];
132
+ }
133
+ return layout;
134
+ };
135
+
136
+ return [[block copy] autorelease];
137
+ }
138
+
139
+ - (BeeUILayoutBlockS)FROM_RESOURCE
140
+ {
141
+ BeeUILayoutBlockS block = ^ BeeUILayout * ( NSString * res )
142
+ {
143
+ BeeUITemplate * temp = [BeeUITemplate fromResource:res];
144
+ if ( temp && temp.rootLayout )
145
+ {
146
+ self.layout = temp.rootLayout;
147
+ self.layout.canvas = self;
148
+ self.layout.REBUILD();
149
+ }
150
+
151
+ return self.layout;
152
+ };
153
+
154
+ return [[block copy] autorelease];
155
+ }
156
+
157
+ - (BeeUILayoutBlockS)FROM_FILE
158
+ {
159
+ BeeUILayoutBlockS block = ^ BeeUILayout * ( NSString * file )
160
+ {
161
+ BeeUITemplate * temp = [BeeUITemplate fromFile:file];
162
+ if ( temp && temp.rootLayout )
163
+ {
164
+ self.layout = temp.rootLayout;
165
+ self.layout.canvas = self;
166
+ self.layout.REBUILD();
167
+ }
168
+
169
+ return self.layout;
170
+ };
171
+
172
+ return [[block copy] autorelease];
173
+ }
174
+
175
+ @end
176
+
177
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -0,0 +1,44 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUIQuery.h
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_UIQuery.h"
37
+
38
+ #pragma mark -
39
+
40
+ @interface UIView(BeeUIQuery)
41
+ @property (nonatomic, readonly) BeeUIQuery * query;
42
+ @end
43
+
44
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -0,0 +1,57 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUIQuery.m
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_UIQuery.h"
37
+ #import "UIView+BeeUIQuery.h"
38
+ #import "UIView+BeeExtension.h"
39
+ #include <objc/runtime.h>
40
+ #include <execinfo.h>
41
+
42
+ #pragma mark -
43
+
44
+ @implementation UIView(BeeUIQuery)
45
+
46
+ @dynamic query;
47
+
48
+ - (BeeUIQuery *)query
49
+ {
50
+ BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
51
+ q.object = self;
52
+ return q;
53
+ }
54
+
55
+ @end
56
+
57
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -0,0 +1,50 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUIStyle.h
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_UIStyle.h"
37
+ #import "UIColor+BeeExtension.h"
38
+ #import "UIFont+BeeExtension.h"
39
+
40
+ #pragma mark -
41
+
42
+ @interface UIView(BeeUIStyle)
43
+
44
+ @property (nonatomic, readonly) BeeUIStyle * style;
45
+
46
+ - (void)applyStyleProperties:(NSDictionary *)properties;
47
+
48
+ @end
49
+
50
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
@@ -0,0 +1,283 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // UIView+BeeUIStyle.m
31
+ //
32
+
33
+ #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
34
+
35
+ #import "Bee_Precompile.h"
36
+ #import "Bee_UIStyle.h"
37
+ #import "UIView+BeeUIStyle.h"
38
+ #import "UIView+BeeExtension.h"
39
+ #import "NSString+BeeExtension.h"
40
+ #import "NSDictionary+BeeExtension.h"
41
+ #include <objc/runtime.h>
42
+ #include <execinfo.h>
43
+
44
+ #pragma mark -
45
+
46
+ @implementation UIView(BeeUIStyle)
47
+
48
+ @dynamic style;
49
+
50
+ - (BeeUIStyle *)style
51
+ {
52
+ BeeUIStyle * s = [[[BeeUIStyle alloc] init] autorelease];
53
+ s.object = self;
54
+ return s;
55
+ }
56
+
57
+ - (void)applyStyleProperties:(NSDictionary *)properties
58
+ {
59
+ // setBackgoundColor
60
+
61
+ NSString * backgroundColor = [properties stringOfAny:@[@"color", @"backgroundColor", @"background-color", @"bgcolor", @"bg-color", @"backcolor", @"back-color"]];
62
+ if ( backgroundColor && backgroundColor.length )
63
+ {
64
+ UIColor * color = [UIColor colorWithString:backgroundColor];
65
+ if ( color )
66
+ {
67
+ [self setBackgroundColor:color];
68
+ }
69
+ }
70
+
71
+ // setAlpha
72
+
73
+ NSString * alpha = [properties stringOfAny:@[@"alpha", @"opaque", @"transparency"]];
74
+ if ( alpha && alpha.length )
75
+ {
76
+ [self setAlpha:[alpha floatValue]];
77
+ }
78
+
79
+ // setHidden
80
+
81
+ NSString * hidden = [properties stringOfAny:@[@"hidden", @"hide"]];
82
+ if ( hidden )
83
+ {
84
+ [self setHidden:hidden.boolValue];
85
+ }
86
+
87
+ NSString * visible = [properties stringOfAny:@[@"visible", @"show"]];
88
+ if ( visible )
89
+ {
90
+ [self setHidden:visible.boolValue ? NO : YES];
91
+ }
92
+
93
+ // setText
94
+
95
+ if ( [self respondsToSelector:@selector(setText:)] )
96
+ {
97
+ NSString * text = [properties stringOfAny:@[@"text", @"content", @"value", @"val"]];
98
+ if ( text )
99
+ {
100
+ [self performSelector:@selector(setText:) withObject:text];
101
+ }
102
+ }
103
+
104
+ // setTextColor
105
+
106
+ if ( [self respondsToSelector:@selector(setTextColor:)] )
107
+ {
108
+ NSString * textColor = [properties stringOfAny:@[@"textColor", @"text-color", @"foregroundColor", @"foreground-Color", @"fgColor", @"fg-Color"]];
109
+ if ( textColor )
110
+ {
111
+ [self performSelector:@selector(setTextColor:) withObject:[UIColor colorWithString:textColor]];
112
+ }
113
+ }
114
+
115
+ // setFont
116
+
117
+ if ( [self respondsToSelector:@selector(setFont:)] )
118
+ {
119
+ // 18,system,bold
120
+ // 18,arial
121
+ // 18
122
+ // 18,bold
123
+ // 18,italic
124
+
125
+ NSString * font = [properties stringOfAny:@[@"font"]];
126
+ if ( font )
127
+ {
128
+ NSArray * array = [font componentsSeparatedByString:@","];
129
+ if ( 1 == array.count )
130
+ {
131
+ [self performSelector:@selector(setFont:) withObject:[UIFont systemFontOfSize:font.floatValue]];
132
+ }
133
+ else
134
+ {
135
+ UIFont * userFont = nil;
136
+
137
+ NSString * size = nil;
138
+ NSString * family = nil;
139
+ NSString * attribute = nil;
140
+
141
+ if ( array.count >= 3 )
142
+ {
143
+ attribute = ((NSString *)[array objectAtIndex:2]).trim;
144
+ }
145
+ if ( array.count >= 2 )
146
+ {
147
+ NSString * temp = ((NSString *)[array objectAtIndex:1]).trim;
148
+
149
+ NSComparisonResult result1 = [temp compare:@"bold" options:NSCaseInsensitiveSearch];
150
+ NSComparisonResult result2 = [temp compare:@"italic" options:NSCaseInsensitiveSearch];
151
+
152
+ if ( NSOrderedSame == result1 || NSOrderedSame == result2 )
153
+ {
154
+ attribute = temp;
155
+ }
156
+ else
157
+ {
158
+ family = temp;
159
+ }
160
+ }
161
+ if ( array.count >= 1 )
162
+ {
163
+ size = ((NSString *)[array objectAtIndex:0]).trim;
164
+ }
165
+
166
+ BOOL isSystem = YES;
167
+ BOOL isItalic = NO;
168
+ BOOL isBold = NO;
169
+
170
+ if ( NSOrderedSame != [family compare:@"system" options:NSCaseInsensitiveSearch] )
171
+ {
172
+ isSystem = NO;
173
+ }
174
+
175
+ if ( NSOrderedSame == [attribute compare:@"bold" options:NSCaseInsensitiveSearch] )
176
+ {
177
+ isBold = YES;
178
+ }
179
+ else if ( NSOrderedSame == [attribute compare:@"italic" options:NSCaseInsensitiveSearch] )
180
+ {
181
+ isItalic = YES;
182
+ }
183
+
184
+ if ( isSystem )
185
+ {
186
+ if ( isBold )
187
+ {
188
+ userFont = [UIFont boldSystemFontOfSize:size.floatValue];
189
+ }
190
+ else if ( isItalic )
191
+ {
192
+ userFont = [UIFont italicSystemFontOfSize:size.floatValue];
193
+ }
194
+ else
195
+ {
196
+ userFont = [UIFont systemFontOfSize:size.floatValue];
197
+ }
198
+ }
199
+ else
200
+ {
201
+ userFont = [UIFont fontWithName:family size:size.floatValue];
202
+ }
203
+
204
+ if ( nil == userFont )
205
+ {
206
+ userFont = [UIFont systemFontOfSize:14.0f];
207
+ }
208
+
209
+ [self performSelector:@selector(setFont:) withObject:userFont];
210
+ }
211
+ }
212
+ }
213
+
214
+ // setTextAlignment
215
+
216
+ if ( [self respondsToSelector:@selector(setText:)] )
217
+ {
218
+ NSString * textAlignment = [properties stringOfAny:@[@"align", @"alignment", @"textAlign", @"text-align", @"textAlignment", @"text-alignment"]].trim;
219
+ if ( textAlignment )
220
+ {
221
+ if ( NSOrderedSame == [textAlignment compare:@"left" options:NSCaseInsensitiveSearch] )
222
+ {
223
+ [self setTextAlignment:UITextAlignmentLeft];
224
+ }
225
+ else if ( NSOrderedSame == [textAlignment compare:@"right" options:NSCaseInsensitiveSearch] )
226
+ {
227
+ [self setTextAlignment:UITextAlignmentRight];
228
+ }
229
+ else if ( NSOrderedSame == [textAlignment compare:@"center" options:NSCaseInsensitiveSearch] )
230
+ {
231
+ [self setTextAlignment:UITextAlignmentCenter];
232
+ }
233
+ }
234
+ }
235
+
236
+ // setLineBreakMode
237
+
238
+ if ( [self respondsToSelector:@selector(setLineBreakMode:)] )
239
+ {
240
+ NSString * lineBreakMode = [properties stringOfAny:@[@"lineBreak", @"wrap", @"trunk", @"break", @"lineBreakMode"]].trim;
241
+ if ( lineBreakMode )
242
+ {
243
+ if ( NSOrderedSame == [lineBreakMode compare:@"word" options:NSCaseInsensitiveSearch] ||
244
+ NSOrderedSame == [lineBreakMode compare:@"WordWrap" options:NSCaseInsensitiveSearch] ||
245
+ NSOrderedSame == [lineBreakMode compare:@"word-wrap" options:NSCaseInsensitiveSearch] )
246
+ {
247
+ [self setLineBreakMode:UILineBreakModeWordWrap];
248
+ }
249
+ else if ( NSOrderedSame == [lineBreakMode compare:@"char" options:NSCaseInsensitiveSearch] ||
250
+ NSOrderedSame == [lineBreakMode compare:@"CharacterWrap" options:NSCaseInsensitiveSearch] ||
251
+ NSOrderedSame == [lineBreakMode compare:@"character-wrap" options:NSCaseInsensitiveSearch] )
252
+ {
253
+ [self setLineBreakMode:UILineBreakModeCharacterWrap];
254
+ }
255
+ else if ( NSOrderedSame == [lineBreakMode compare:@"Clip" options:NSCaseInsensitiveSearch] )
256
+ {
257
+ [self setLineBreakMode:UILineBreakModeClip];
258
+ }
259
+ else if ( NSOrderedSame == [lineBreakMode compare:@"a..." options:NSCaseInsensitiveSearch] ||
260
+ NSOrderedSame == [lineBreakMode compare:@"HeadTruncation" options:NSCaseInsensitiveSearch] ||
261
+ NSOrderedSame == [lineBreakMode compare:@"head-truncation" options:NSCaseInsensitiveSearch] )
262
+ {
263
+ [self setLineBreakMode:UILineBreakModeHeadTruncation];
264
+ }
265
+ else if ( NSOrderedSame == [lineBreakMode compare:@"...a" options:NSCaseInsensitiveSearch] ||
266
+ NSOrderedSame == [lineBreakMode compare:@"TailTruncation" options:NSCaseInsensitiveSearch] ||
267
+ NSOrderedSame == [lineBreakMode compare:@"tail-truncation" options:NSCaseInsensitiveSearch] )
268
+ {
269
+ [self setLineBreakMode:UILineBreakModeTailTruncation];
270
+ }
271
+ else if ( NSOrderedSame == [lineBreakMode compare:@"a..b" options:NSCaseInsensitiveSearch] ||
272
+ NSOrderedSame == [lineBreakMode compare:@"MiddleTruncation" options:NSCaseInsensitiveSearch] ||
273
+ NSOrderedSame == [lineBreakMode compare:@"middle-truncation" options:NSCaseInsensitiveSearch] )
274
+ {
275
+ [self setLineBreakMode:UILineBreakModeMiddleTruncation];
276
+ }
277
+ }
278
+ }
279
+ }
280
+
281
+ @end
282
+
283
+ #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)