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,641 @@
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
+ // Bee_ActiveBase.h
31
+ //
32
+
33
+ #import "Bee_Precompile.h"
34
+ #import "Bee_Log.h"
35
+ #import "Bee_Runtime.h"
36
+ #import "Bee_Database.h"
37
+ #import "Bee_ActiveBase.h"
38
+
39
+ #import "NSObject+BeeTypeConversion.h"
40
+ #import "NSDictionary+BeeExtension.h"
41
+ #import "NSNumber+BeeExtension.h"
42
+ #import "NSObject+BeeDatabase.h"
43
+
44
+ #include <objc/runtime.h>
45
+
46
+ #pragma mark -
47
+
48
+ @interface NSObject(BeeActiveBasePrivate)
49
+ + (NSString *)keyPath:(NSString *)path;
50
+ + (void)addProtperty:(NSString *)name
51
+ atPath:(NSString *)path
52
+ forClass:(NSString *)className
53
+ associateTo:(NSString *)domain
54
+ defaultValue:(id)value
55
+ key:(BOOL)key;
56
+ @end
57
+
58
+ @implementation NSObject(BeeActiveBase)
59
+
60
+ static NSMutableDictionary * __primaryKeys = nil;
61
+ static NSMutableDictionary * __properties = nil;
62
+ static NSMutableDictionary * __usingAI = nil;
63
+ static NSMutableDictionary * __usingUN = nil;
64
+ static NSMutableDictionary * __usingJSON = nil;
65
+ static NSMutableDictionary * __flags = nil;
66
+
67
+ + (void)mapRelation
68
+ {
69
+ }
70
+
71
+ + (NSString *)mapTableName
72
+ {
73
+ return [NSString stringWithUTF8String:class_getName(self)];
74
+ }
75
+
76
+ + (void)mapPropertyAsKey:(NSString *)name
77
+ {
78
+ [self addProtperty:name
79
+ atPath:nil
80
+ forClass:nil
81
+ associateTo:nil
82
+ defaultValue:nil
83
+ key:YES];
84
+ }
85
+
86
+ + (void)mapPropertyAsKey:(NSString *)name defaultValue:(id)value
87
+ {
88
+ [self addProtperty:name
89
+ atPath:nil
90
+ forClass:nil
91
+ associateTo:nil
92
+ defaultValue:value
93
+ key:YES];
94
+ }
95
+
96
+ + (void)mapPropertyAsKey:(NSString *)name atPath:(NSString *)path
97
+ {
98
+ [self addProtperty:name
99
+ atPath:path
100
+ forClass:nil
101
+ associateTo:nil
102
+ defaultValue:nil
103
+ key:YES];
104
+ }
105
+
106
+ + (void)mapPropertyAsKey:(NSString *)name atPath:(NSString *)path defaultValue:(id)value
107
+ {
108
+ [self addProtperty:name
109
+ atPath:path
110
+ forClass:nil
111
+ associateTo:nil
112
+ defaultValue:value
113
+ key:YES];
114
+ }
115
+
116
+ + (void)mapProperty:(NSString *)name
117
+ {
118
+ [self addProtperty:name
119
+ atPath:nil
120
+ forClass:nil
121
+ associateTo:nil
122
+ defaultValue:nil
123
+ key:NO];
124
+ }
125
+
126
+ + (void)mapProperty:(NSString *)name defaultValue:(id)value
127
+ {
128
+ [self addProtperty:name
129
+ atPath:nil
130
+ forClass:nil
131
+ associateTo:nil
132
+ defaultValue:value
133
+ key:NO];
134
+ }
135
+
136
+ + (void)mapProperty:(NSString *)name atPath:(NSString *)path
137
+ {
138
+ [self addProtperty:name
139
+ atPath:path
140
+ forClass:nil
141
+ associateTo:nil
142
+ defaultValue:nil
143
+ key:NO];
144
+ }
145
+
146
+ + (void)mapProperty:(NSString *)name atPath:(NSString *)path defaultValue:(id)value
147
+ {
148
+ [self addProtperty:name
149
+ atPath:path
150
+ forClass:nil
151
+ associateTo:nil
152
+ defaultValue:value
153
+ key:NO];
154
+ }
155
+
156
+ + (void)mapProperty:(NSString *)name forClass:(NSString *)className
157
+ {
158
+ [self addProtperty:name
159
+ atPath:nil
160
+ forClass:className
161
+ associateTo:nil
162
+ defaultValue:nil
163
+ key:NO];
164
+ }
165
+
166
+ + (void)mapProperty:(NSString *)name forClass:(NSString *)className defaultValue:(id)value
167
+ {
168
+ [self addProtperty:name
169
+ atPath:nil
170
+ forClass:className
171
+ associateTo:nil
172
+ defaultValue:value
173
+ key:NO];
174
+ }
175
+
176
+ + (void)mapProperty:(NSString *)name forClass:(NSString *)className atPath:(NSString *)path
177
+ {
178
+ [self addProtperty:name
179
+ atPath:path
180
+ forClass:className
181
+ associateTo:nil
182
+ defaultValue:nil
183
+ key:NO];
184
+ }
185
+
186
+ + (void)mapProperty:(NSString *)name forClass:(NSString *)className atPath:(NSString *)path defaultValue:(id)value
187
+ {
188
+ [self addProtperty:name
189
+ atPath:path
190
+ forClass:className
191
+ associateTo:nil
192
+ defaultValue:value
193
+ key:NO];
194
+ }
195
+
196
+ + (void)mapProperty:(NSString *)name associateTo:(NSString *)domain
197
+ {
198
+ [self addProtperty:name
199
+ atPath:nil
200
+ forClass:nil
201
+ associateTo:domain
202
+ defaultValue:nil
203
+ key:NO];
204
+ }
205
+
206
+ + (void)mapProperty:(NSString *)name associateTo:(NSString *)domain defaultValue:(id)value
207
+ {
208
+ [self addProtperty:name
209
+ atPath:nil
210
+ forClass:nil
211
+ associateTo:domain
212
+ defaultValue:value
213
+ key:NO];
214
+ }
215
+
216
+ + (void)addProtperty:(NSString *)name
217
+ atPath:(NSString *)path
218
+ forClass:(NSString *)className
219
+ associateTo:(NSString *)domain
220
+ defaultValue:(id)value
221
+ key:(BOOL)key
222
+ {
223
+ // add primary key
224
+
225
+ if ( key )
226
+ {
227
+ if ( nil == __primaryKeys )
228
+ {
229
+ __primaryKeys = [[NSMutableDictionary alloc] init];
230
+ }
231
+
232
+ [__primaryKeys setObject:name forKey:[self description]];
233
+ }
234
+
235
+ // add property
236
+
237
+ if ( nil == __properties )
238
+ {
239
+ __properties = [[NSMutableDictionary alloc] init];
240
+ }
241
+
242
+ NSMutableDictionary * propertySet = self.activePropertySet;
243
+ if ( propertySet )
244
+ {
245
+ NSMutableDictionary * property = [propertySet objectForKey:name];
246
+ if ( nil == property )
247
+ {
248
+ property = [NSMutableDictionary dictionary];
249
+ [propertySet setObject:property forKey:name];
250
+ }
251
+
252
+ if ( property )
253
+ {
254
+ [property setObject:name forKey:@"name"];
255
+ [property setObject:(key ? @"YES" : @"NO") forKey:@"key"];
256
+ [property setObject:[BeeDatabase fieldNameForIdentifier:name] forKey:@"field"];
257
+ [property setObject:[self description] forKey:@"byClass"];
258
+
259
+ if ( domain )
260
+ {
261
+ NSArray * components = [domain componentsSeparatedByString:@"."];
262
+ if ( components.count >= 2 )
263
+ {
264
+ NSString * className = [components objectAtIndex:0];
265
+ NSString * propertyName = [components objectAtIndex:1];
266
+
267
+ [property setObject:className forKey:@"associateClass"];
268
+ [property setObject:propertyName forKey:@"associateProperty"];
269
+ }
270
+ else
271
+ {
272
+ [property setObject:domain forKey:@"associateClass"];
273
+ }
274
+ }
275
+
276
+ if ( className )
277
+ {
278
+ [property setObject:className forKey:@"className"];
279
+ }
280
+
281
+ path = path ? [self keyPath:path] : name;
282
+ if ( path )
283
+ {
284
+ [property setObject:path forKey:@"path"];
285
+ }
286
+
287
+ if ( value )
288
+ {
289
+ [property setObject:value forKey:@"value"];
290
+ }
291
+ else
292
+ {
293
+ [property setObject:[NonValue value] forKey:@"value"];
294
+ }
295
+ }
296
+ }
297
+ }
298
+
299
+ + (void)useAutoIncrement
300
+ {
301
+ [self useAutoIncrementFor:self];
302
+ }
303
+
304
+ + (void)useAutoIncrementFor:(Class)clazz
305
+ {
306
+ if ( nil == __usingAI )
307
+ {
308
+ __usingAI = [[NSMutableDictionary alloc] init];
309
+ }
310
+
311
+ [__usingAI setObject:__INT(YES) forKey:[clazz description]];
312
+ }
313
+
314
+ + (BOOL)usingAutoIncrement
315
+ {
316
+ return [self usingAutoIncrementFor:self];
317
+ }
318
+
319
+ + (BOOL)usingAutoIncrementFor:(Class)clazz
320
+ {
321
+ if ( nil == __usingAI )
322
+ return NO;
323
+
324
+ NSNumber * flag = [__usingAI objectForKey:[clazz description]];
325
+ if ( flag )
326
+ return flag.boolValue;
327
+
328
+ return NO;
329
+ }
330
+
331
+ + (void)useAutoIncrementFor:(Class)clazz andProperty:(NSString *)name
332
+ {
333
+ if ( nil == __usingAI )
334
+ {
335
+ __usingAI = [[NSMutableDictionary alloc] init];
336
+ }
337
+
338
+ NSString * key = [NSString stringWithFormat:@"%@.%@", [clazz description], name];
339
+ [__usingAI setObject:__INT(YES) forKey:key];
340
+ }
341
+
342
+ + (BOOL)usingAutoIncrementFor:(Class)clazz andProperty:(NSString *)name
343
+ {
344
+ if ( nil == __usingAI )
345
+ return NO;
346
+
347
+ NSString * key = [NSString stringWithFormat:@"%@.%@", [clazz description], name];
348
+ NSNumber * flag = [__usingAI objectForKey:key];
349
+ if ( flag )
350
+ return flag.boolValue;
351
+
352
+ return NO;
353
+ }
354
+
355
+ + (void)useUniqueFor:(Class)clazz andProperty:(NSString *)name
356
+ {
357
+ if ( nil == __usingUN )
358
+ {
359
+ __usingUN = [[NSMutableDictionary alloc] init];
360
+ }
361
+
362
+ NSString * key = [NSString stringWithFormat:@"%@.%@", [clazz description], name];
363
+ [__usingUN setObject:__INT(YES) forKey:key];
364
+ }
365
+
366
+ + (BOOL)usingUniqueFor:(Class)clazz andProperty:(NSString *)name
367
+ {
368
+ if ( nil == __usingUN )
369
+ return NO;
370
+
371
+ NSString * key = [NSString stringWithFormat:@"%@.%@", [clazz description], name];
372
+ NSNumber * flag = [__usingUN objectForKey:key];
373
+ if ( flag )
374
+ return flag.boolValue;
375
+
376
+ return NO;
377
+ }
378
+
379
+ + (void)useJSON
380
+ {
381
+ [self useJSONFor:self];
382
+ }
383
+
384
+ + (void)useJSONFor:(Class)clazz
385
+ {
386
+ if ( nil == __usingJSON )
387
+ {
388
+ __usingJSON = [[NSMutableDictionary alloc] init];
389
+ }
390
+
391
+ [__usingJSON setObject:__INT(YES) forKey:[clazz description]];
392
+ }
393
+
394
+ + (BOOL)usingJSON
395
+ {
396
+ return [self usingJSONFor:self];
397
+ }
398
+
399
+ + (BOOL)usingJSONFor:(Class)clazz
400
+ {
401
+ if ( nil == __usingJSON )
402
+ return NO;
403
+
404
+ NSNumber * flag = [__usingJSON objectForKey:[clazz description]];
405
+ return flag ? flag.boolValue : NO;
406
+ }
407
+
408
+ + (NSString *)keyPath:(NSString *)path
409
+ {
410
+ NSString * keyPath = [path stringByReplacingOccurrencesOfString:@"/" withString:@"."];
411
+ NSRange range = NSMakeRange( 0, 1 );
412
+
413
+ if ( [[keyPath substringWithRange:range] isEqualToString:@"."] )
414
+ {
415
+ keyPath = [keyPath substringFromIndex:1];
416
+ }
417
+
418
+ return keyPath;
419
+ }
420
+
421
+ - (NSString *)activePrimaryKey
422
+ {
423
+ return [[self class] activePrimaryKey];
424
+ }
425
+
426
+ + (NSString *)activePrimaryKey
427
+ {
428
+ return [self activePrimaryKeyFor:self];
429
+ }
430
+
431
+ + (NSString *)activePrimaryKeyFor:(Class)clazz
432
+ {
433
+ if ( __primaryKeys )
434
+ {
435
+ NSString * key = [clazz description];
436
+ NSString * value = (NSString *)[__primaryKeys objectForKey:key];
437
+ if ( value )
438
+ return value;
439
+ }
440
+
441
+ return nil;
442
+ }
443
+
444
+ - (NSString *)activeJSONKey
445
+ {
446
+ return [[self class] activeJSONKey];
447
+ }
448
+
449
+ + (NSString *)activeJSONKey
450
+ {
451
+ return [self activeJSONKeyFor:self];
452
+ }
453
+
454
+ + (NSString *)activeJSONKeyFor:(Class)clazz
455
+ {
456
+ return nil;
457
+ }
458
+
459
+ - (NSMutableDictionary *)activePropertySet
460
+ {
461
+ return [[self class] activePropertySet];
462
+ }
463
+
464
+ + (NSMutableDictionary *)activePropertySet
465
+ {
466
+ return [self activePropertySetFor:self];
467
+ }
468
+
469
+ + (NSMutableDictionary *)activePropertySetFor:(Class)clazz
470
+ {
471
+ if ( nil == __properties )
472
+ {
473
+ __properties = [[NSMutableDictionary alloc] init];
474
+ }
475
+
476
+ NSString * className = [clazz description];
477
+ NSMutableDictionary * propertySet = [__properties objectForKey:className];
478
+ if ( nil == propertySet )
479
+ {
480
+ propertySet = [NSMutableDictionary dictionary];
481
+ [__properties setObject:propertySet forKey:className];
482
+ }
483
+
484
+ return propertySet;
485
+ }
486
+
487
+ + (void)prepareOnceWithRootClass:(Class)rootClass
488
+ {
489
+ if ( nil == __flags )
490
+ {
491
+ __flags = [[NSMutableDictionary alloc] init];
492
+ }
493
+
494
+ NSString * className = [self description];
495
+ NSNumber * flag = [__flags objectForKey:className];
496
+ if ( nil == flag || NO == flag.boolValue )
497
+ {
498
+ // Step1, map relation between property and field
499
+
500
+ [self mapRelation];
501
+
502
+ // Step2, create table
503
+
504
+ [NSObject DB]
505
+ .TABLE( self.tableName )
506
+ .FIELD( self.activePrimaryKey, @"INTEGER" ).UNIQUE().PRIMARY_KEY();
507
+
508
+ if ( [self usingAutoIncrement] )
509
+ {
510
+ [NSObject DB].AUTO_INREMENT();
511
+ }
512
+
513
+ if ( [self usingJSON] )
514
+ {
515
+ [NSObject DB]
516
+ .TABLE( self.tableName )
517
+ .FIELD( self.activeJSONKey, @"TEXT" ).DEFAULT( @"" );
518
+ }
519
+
520
+ NSDictionary * propertySet = self.activePropertySet;
521
+ if ( propertySet && propertySet.count )
522
+ {
523
+ for ( Class clazzType = [self class];; )
524
+ {
525
+ if ( clazzType == rootClass )
526
+ break;
527
+
528
+ NSUInteger propertyCount = 0;
529
+ objc_property_t * properties = class_copyPropertyList( clazzType, &propertyCount );
530
+
531
+ for ( NSUInteger i = 0; i < propertyCount; i++ )
532
+ {
533
+ const char * name = property_getName(properties[i]);
534
+ NSString * propertyName = [NSString stringWithCString:name encoding:NSUTF8StringEncoding];
535
+
536
+ NSMutableDictionary * property = [propertySet objectForKey:propertyName];
537
+ if ( property )
538
+ {
539
+ const char * attr = property_getAttributes(properties[i]);
540
+ NSUInteger type = [BeeTypeEncoding typeOf:attr];
541
+
542
+ NSString * field = [property objectForKey:@"field"];
543
+ NSObject * value = [property objectForKey:@"value"];
544
+
545
+ if ( BeeTypeEncoding.NSNUMBER == type )
546
+ {
547
+ [NSObject DB].FIELD( field, @"INTEGER" );
548
+ }
549
+ else if ( BeeTypeEncoding.NSSTRING == type )
550
+ {
551
+ [NSObject DB].FIELD( field, @"TEXT" );
552
+ }
553
+ else if ( BeeTypeEncoding.NSDATE == type )
554
+ {
555
+ [NSObject DB].FIELD( field, @"TEXT" );
556
+ }
557
+ // else if ( BeeTypeEncoding.NSARRAY == type )
558
+ // {
559
+ // [NSObject DB].FIELD( field, @"TEXT" );
560
+ // }
561
+ // else if ( BeeTypeEncoding.NSDICTIONARY == type )
562
+ // {
563
+ // [NSObject DB].FIELD( field, @"TEXT" );
564
+ // }
565
+ else if ( BeeTypeEncoding.OBJECT == type )
566
+ {
567
+ // AR对象只存它的主键
568
+
569
+ [NSObject DB].FIELD( field, @"INTEGER" );
570
+ }
571
+ else
572
+ {
573
+ [NSObject DB].FIELD( field, @"INTEGER" );
574
+ }
575
+
576
+ if ( [self usingAutoIncrementFor:clazzType andProperty:field] )
577
+ {
578
+ [NSObject DB].AUTO_INREMENT();
579
+ }
580
+
581
+ if ( value && NO == [value isKindOfClass:[NonValue class]] )
582
+ {
583
+ [NSObject DB].DEFAULT( value );
584
+ }
585
+
586
+ [property setObject:__INT(type) forKey:@"type"];
587
+ }
588
+ }
589
+
590
+ free( properties );
591
+
592
+ clazzType = class_getSuperclass( clazzType );
593
+ if ( nil == clazzType )
594
+ break;
595
+ }
596
+ }
597
+
598
+ [NSObject DB]
599
+ .CREATE_IF_NOT_EXISTS();
600
+
601
+ // Step3, do migration if needed
602
+
603
+ // "pragma table_info(\"test\")";
604
+ // "alter table \"test\" add column name";
605
+
606
+ // Step4, create index
607
+
608
+ [NSObject DB]
609
+ .TABLE( self.tableName )
610
+ .INDEX_ON( self.activePrimaryKey, nil );
611
+
612
+ // done
613
+
614
+ [__flags setObject:__INT(YES) forKey:className];
615
+ }
616
+ }
617
+
618
+ + (void)resetPrepareFlags
619
+ {
620
+ [__flags removeAllObjects];
621
+ }
622
+
623
+ @end
624
+
625
+ #pragma mark -
626
+
627
+ @implementation NonValue
628
+
629
+ + (NonValue *)value
630
+ {
631
+ static NonValue * __value = nil;
632
+
633
+ if ( nil == __value )
634
+ {
635
+ __value = [[NonValue alloc] init];
636
+ }
637
+
638
+ return __value;
639
+ }
640
+
641
+ @end