TemplateInfo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +2 -0
- data/TemplateInfo.gemspec +1 -1
- data/bin/tif_create.rb +157 -0
- data/lib/TemplateInfo/version.rb +1 -1
- data/test.xctemplate/.DS_Store +0 -0
- data/test.xctemplate/TemplateInfo.plist +2830 -0
- data/test.xctemplate/TemplateInfo.xml +2842 -0
- data/test.xctemplate/libs/BeeFramework/Bee.h +35 -0
- data/test.xctemplate/libs/BeeFramework/Bee_Precompile.h +143 -0
- data/test.xctemplate/libs/BeeFramework/Core/Bee_Core.h +36 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.h +54 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.mm +33 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.h +64 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.mm +164 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.h +111 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.mm +122 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.h +98 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.mm +437 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.h +45 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.mm +81 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.h +47 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.mm +34 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.h +62 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.m +147 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.h +64 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.mm +91 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.h +76 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.m +300 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.h +44 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.m +92 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.h +44 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.m +85 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.h +90 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.m +509 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.h +50 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.m +64 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.h +43 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.m +116 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.h +66 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.m +150 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.h +210 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.m +34 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.h +41 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.m +156 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.h +49 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.m +109 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.h +86 -0
- data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.m +464 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.h +36 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.m +33 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.h +144 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.m +560 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.h +99 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.m +742 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.h +62 -0
- data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.m +175 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/0.2.4.zip +0 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.h +133 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.m +641 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.h +106 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.m +1956 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.h +91 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.m +318 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.h +223 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.m +3007 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.h +55 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.m +173 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.h +39 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.m +33 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.h +47 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.m +81 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.h +44 -0
- data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.m +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Bee_MVC.h +49 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.h +66 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.mm +228 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.h +209 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.mm +873 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.h +75 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.mm +389 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.m +150 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.h +49 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.mm +201 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.mm +118 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.h +49 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.mm +78 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.h +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.mm +138 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.h +64 -0
- data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.m +190 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.h +71 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.m +307 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.m +152 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.h +73 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.m +234 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.h +97 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.m +424 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.h +78 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.m +362 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.h +82 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.m +298 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.h +110 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.m +541 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.h +74 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.m +243 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.h +46 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.m +99 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.h +124 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.m +821 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.h +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.m +161 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.h +60 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.m +146 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.h +61 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.m +190 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.h +47 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.m +113 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.h +71 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.m +236 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.h +146 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.m +1487 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.h +60 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.m +192 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.h +126 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.m +453 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.h +70 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.m +249 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.h +67 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.m +242 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.h +75 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.m +311 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.h +184 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.m +911 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.h +65 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.m +242 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.h +91 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.m +444 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.h +72 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.m +38 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.h +79 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.m +288 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.h +65 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.m +161 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.m +137 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.h +56 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.m +218 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.h +105 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.m +556 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.h +53 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.m +104 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.m +170 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.h +54 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.m +166 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.h +54 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.m +184 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.h +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.m +275 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.h +212 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.m +1219 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.h +111 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.m +694 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.h +71 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.m +258 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.m +36 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.h +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.m +151 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.h +53 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.m +92 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.h +72 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.m +175 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.h +59 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.m +249 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.h +199 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.m +1170 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.h +113 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.m +710 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.h +66 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.m +189 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.h +69 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.m +210 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.m +59 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.m +55 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.m +54 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.m +54 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.m +438 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.h +60 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.m +37 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.m +55 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.h +45 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.m +55 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.h +41 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.m +100 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.h +41 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.m +101 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.h +41 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.m +48 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.h +41 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.m +77 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.h +41 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.m +47 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.m +177 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.h +44 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.m +57 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.h +50 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.m +283 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.h +52 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.m +178 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.h +44 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.m +58 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.h +44 -0
- data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.m +57 -0
- metadata +226 -3
@@ -0,0 +1,75 @@
|
|
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_MessageQueue.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Singleton.h"
|
35
|
+
#import "Bee_Message.h"
|
36
|
+
|
37
|
+
#pragma mark -
|
38
|
+
|
39
|
+
@interface BeeMessageQueue : NSObject
|
40
|
+
{
|
41
|
+
BeeMessageBlock _whenCreate;
|
42
|
+
BeeMessageBlock _whenUpdate;
|
43
|
+
NSTimer * _timer;
|
44
|
+
BOOL _pause;
|
45
|
+
}
|
46
|
+
|
47
|
+
AS_SINGLETON(BeeMessageQueue)
|
48
|
+
|
49
|
+
@property (nonatomic, copy) BeeMessageBlock whenCreate;
|
50
|
+
@property (nonatomic, copy) BeeMessageBlock whenUpdate;
|
51
|
+
|
52
|
+
@property (nonatomic, retain) NSTimer * timer;
|
53
|
+
@property (nonatomic, assign) BOOL pause;
|
54
|
+
|
55
|
+
@property (nonatomic, readonly) NSArray * allMessages;
|
56
|
+
@property (nonatomic, readonly) NSArray * pendingMessages;
|
57
|
+
@property (nonatomic, readonly) NSArray * sendingMessages;
|
58
|
+
@property (nonatomic, readonly) NSArray * finishedMessages;
|
59
|
+
|
60
|
+
- (NSArray *)messages:(NSString *)msgName;
|
61
|
+
- (NSArray *)messagesInSet:(NSArray *)msgNames;
|
62
|
+
|
63
|
+
- (BOOL)sendMessage:(BeeMessage *)msg;
|
64
|
+
- (void)removeMessage:(BeeMessage *)msg;
|
65
|
+
- (void)cancelMessage:(NSString *)msg;
|
66
|
+
- (void)cancelMessage:(NSString *)msg byResponder:(id)responder;
|
67
|
+
- (void)cancelMessages;
|
68
|
+
|
69
|
+
- (BOOL)sending:(NSString *)msg;
|
70
|
+
- (BOOL)sending:(NSString *)msg byResponder:(id)responder;
|
71
|
+
|
72
|
+
- (void)enableResponder:(id)responder;
|
73
|
+
- (void)disableResponder:(id)responder;
|
74
|
+
|
75
|
+
@end
|
@@ -0,0 +1,389 @@
|
|
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_MessageQueue.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Core.h"
|
35
|
+
#import "Bee_Message.h"
|
36
|
+
#import "Bee_MessageQueue.h"
|
37
|
+
#import "Bee_Controller.h"
|
38
|
+
|
39
|
+
#import <objc/runtime.h>
|
40
|
+
|
41
|
+
#pragma mark -
|
42
|
+
|
43
|
+
#undef DEFAULT_RUNLOOP_INTERVAL
|
44
|
+
#define DEFAULT_RUNLOOP_INTERVAL (0.1f)
|
45
|
+
|
46
|
+
#pragma mark -
|
47
|
+
|
48
|
+
@interface BeeMessageQueue(Private)
|
49
|
+
- (void)runloop;
|
50
|
+
@end
|
51
|
+
|
52
|
+
#pragma mark -
|
53
|
+
|
54
|
+
@implementation BeeMessageQueue
|
55
|
+
|
56
|
+
static NSMutableArray * __sharedQueue = nil;
|
57
|
+
|
58
|
+
@synthesize whenCreate = _whenCreate;
|
59
|
+
@synthesize whenUpdate = _whenUpdate;
|
60
|
+
@synthesize timer = _timer;
|
61
|
+
@synthesize pause = _pause;
|
62
|
+
|
63
|
+
DEF_SINGLETON(BeeMessageQueue);
|
64
|
+
|
65
|
+
- (NSArray *)allMessages
|
66
|
+
{
|
67
|
+
return __sharedQueue;
|
68
|
+
}
|
69
|
+
|
70
|
+
- (NSArray *)pendingMessages
|
71
|
+
{
|
72
|
+
NSMutableArray * array = [NSMutableArray array];
|
73
|
+
|
74
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
75
|
+
|
76
|
+
for ( BeeMessage * bmsg in queued )
|
77
|
+
{
|
78
|
+
if ( bmsg.created )
|
79
|
+
{
|
80
|
+
[array addObject:bmsg];
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
[queued release];
|
85
|
+
|
86
|
+
return array;
|
87
|
+
}
|
88
|
+
|
89
|
+
- (NSArray *)sendingMessages
|
90
|
+
{
|
91
|
+
NSMutableArray * array = [NSMutableArray array];
|
92
|
+
|
93
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
94
|
+
|
95
|
+
for ( BeeMessage * msg in queued )
|
96
|
+
{
|
97
|
+
if ( msg.sending )
|
98
|
+
{
|
99
|
+
[array addObject:msg];
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
[queued release];
|
104
|
+
|
105
|
+
return array;
|
106
|
+
}
|
107
|
+
|
108
|
+
- (NSArray *)finishedMessages
|
109
|
+
{
|
110
|
+
NSMutableArray * array = [NSMutableArray array];
|
111
|
+
|
112
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
113
|
+
|
114
|
+
for ( BeeMessage * bmsg in queued )
|
115
|
+
{
|
116
|
+
if ( bmsg.succeed || bmsg.failed || bmsg.cancelled )
|
117
|
+
{
|
118
|
+
[array addObject:bmsg];
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
[queued release];
|
123
|
+
|
124
|
+
return array;
|
125
|
+
}
|
126
|
+
|
127
|
+
- (NSArray *)messages:(NSString *)msgName
|
128
|
+
{
|
129
|
+
if ( nil == msgName )
|
130
|
+
{
|
131
|
+
return __sharedQueue;
|
132
|
+
}
|
133
|
+
else
|
134
|
+
{
|
135
|
+
NSMutableArray * array = [NSMutableArray array];
|
136
|
+
|
137
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
138
|
+
|
139
|
+
for ( BeeMessage * msg in queued )
|
140
|
+
{
|
141
|
+
if ( [msg.message isEqual:msgName] )
|
142
|
+
{
|
143
|
+
[array addObject:msg];
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
[queued release];
|
148
|
+
|
149
|
+
return array;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
- (NSArray *)messagesInSet:(NSArray *)msgNames
|
154
|
+
{
|
155
|
+
NSMutableArray * array = [NSMutableArray array];
|
156
|
+
|
157
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
158
|
+
|
159
|
+
for ( BeeMessage * msg in queued )
|
160
|
+
{
|
161
|
+
for ( NSString * msgName in msgNames )
|
162
|
+
{
|
163
|
+
if ( [msg.message isEqual:msgName] )
|
164
|
+
{
|
165
|
+
[array addObject:msg];
|
166
|
+
break;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
171
|
+
[queued release];
|
172
|
+
|
173
|
+
return array;
|
174
|
+
}
|
175
|
+
|
176
|
+
- (BOOL)sendMessage:(BeeMessage *)msg
|
177
|
+
{
|
178
|
+
if ( [__sharedQueue containsObject:msg] )
|
179
|
+
return NO;
|
180
|
+
|
181
|
+
if ( msg.unique )
|
182
|
+
{
|
183
|
+
for ( BeeMessage * inqueue in __sharedQueue )
|
184
|
+
{
|
185
|
+
if ( [inqueue isTwinWith:msg] )
|
186
|
+
return NO;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
[msg setSending:YES];
|
191
|
+
|
192
|
+
[__sharedQueue addObject:msg];
|
193
|
+
return YES;
|
194
|
+
}
|
195
|
+
|
196
|
+
- (void)removeMessage:(BeeMessage *)msg
|
197
|
+
{
|
198
|
+
[__sharedQueue removeObject:msg];
|
199
|
+
}
|
200
|
+
|
201
|
+
- (void)cancelMessage:(NSString *)msg
|
202
|
+
{
|
203
|
+
if ( nil == msg )
|
204
|
+
{
|
205
|
+
[BeeRequestQueue cancelAllRequests];
|
206
|
+
|
207
|
+
[__sharedQueue removeAllObjects];
|
208
|
+
}
|
209
|
+
else
|
210
|
+
{
|
211
|
+
NSUInteger count = [__sharedQueue count];
|
212
|
+
BeeMessage * bmsg;
|
213
|
+
|
214
|
+
for ( NSUInteger i = count; i > 0; --i )
|
215
|
+
{
|
216
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
217
|
+
if ( msg && NO == [msg isEqualToString:bmsg.message] )
|
218
|
+
continue;
|
219
|
+
|
220
|
+
[bmsg changeState:BeeMessage.STATE_CANCELLED];
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
- (BOOL)sending:(NSString *)msg
|
226
|
+
{
|
227
|
+
if ( nil == msg )
|
228
|
+
{
|
229
|
+
return ([__sharedQueue count] > 0) ? YES : NO;
|
230
|
+
}
|
231
|
+
else
|
232
|
+
{
|
233
|
+
BeeMessage * bmsg = nil;
|
234
|
+
|
235
|
+
NSUInteger count = [__sharedQueue count];
|
236
|
+
for ( NSUInteger i = count; i > 0; --i )
|
237
|
+
{
|
238
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
239
|
+
if ( YES == [msg isEqualToString:bmsg.message] )
|
240
|
+
{
|
241
|
+
if ( bmsg.created || bmsg.sending )
|
242
|
+
{
|
243
|
+
return YES;
|
244
|
+
}
|
245
|
+
else
|
246
|
+
{
|
247
|
+
return NO;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
252
|
+
return NO;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
- (BOOL)sending:(NSString *)msg byResponder:(id)responder
|
257
|
+
{
|
258
|
+
BeeMessage * bmsg = nil;
|
259
|
+
|
260
|
+
NSUInteger count = [__sharedQueue count];
|
261
|
+
for ( NSUInteger i = count; i > 0; --i )
|
262
|
+
{
|
263
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
264
|
+
if ( responder && bmsg.responder != responder )
|
265
|
+
continue;
|
266
|
+
|
267
|
+
if ( nil == msg || [msg isEqualToString:bmsg.message] )
|
268
|
+
{
|
269
|
+
if ( bmsg.created || bmsg.sending )
|
270
|
+
{
|
271
|
+
return YES;
|
272
|
+
}
|
273
|
+
else
|
274
|
+
{
|
275
|
+
return NO;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
|
280
|
+
return NO;
|
281
|
+
}
|
282
|
+
|
283
|
+
- (void)enableResponder:(id)responder
|
284
|
+
{
|
285
|
+
NSUInteger count = [__sharedQueue count];
|
286
|
+
BeeMessage * bmsg;
|
287
|
+
|
288
|
+
for ( NSUInteger i = count; i > 0; --i )
|
289
|
+
{
|
290
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
291
|
+
if ( responder && bmsg.responder != responder )
|
292
|
+
continue;
|
293
|
+
|
294
|
+
bmsg.disabled = NO;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
- (void)disableResponder:(id)responder
|
299
|
+
{
|
300
|
+
NSUInteger count = [__sharedQueue count];
|
301
|
+
BeeMessage * bmsg;
|
302
|
+
|
303
|
+
for ( NSUInteger i = count; i > 0; --i )
|
304
|
+
{
|
305
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
306
|
+
if ( responder && bmsg.responder != responder )
|
307
|
+
continue;
|
308
|
+
|
309
|
+
bmsg.disabled = YES;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
|
313
|
+
- (void)cancelMessage:(NSString *)msg byResponder:(id)responder
|
314
|
+
{
|
315
|
+
NSUInteger count = [__sharedQueue count];
|
316
|
+
BeeMessage * bmsg;
|
317
|
+
|
318
|
+
for ( NSUInteger i = count; i > 0; --i )
|
319
|
+
{
|
320
|
+
bmsg = [__sharedQueue objectAtIndex:(i - 1)];
|
321
|
+
if ( responder && bmsg.responder != responder )
|
322
|
+
continue;
|
323
|
+
|
324
|
+
if ( msg && NO == [msg isEqualToString:bmsg.message] )
|
325
|
+
continue;
|
326
|
+
|
327
|
+
[bmsg changeState:BeeMessage.STATE_CANCELLED];
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
331
|
+
- (void)cancelMessages
|
332
|
+
{
|
333
|
+
[BeeRequestQueue cancelAllRequests];
|
334
|
+
|
335
|
+
[__sharedQueue removeAllObjects];
|
336
|
+
}
|
337
|
+
|
338
|
+
#pragma mark -
|
339
|
+
|
340
|
+
- (id)init
|
341
|
+
{
|
342
|
+
self = [super init];
|
343
|
+
if ( self )
|
344
|
+
{
|
345
|
+
if ( nil == __sharedQueue )
|
346
|
+
{
|
347
|
+
__sharedQueue = [[NSMutableArray alloc] init];
|
348
|
+
}
|
349
|
+
|
350
|
+
if ( nil == self.timer )
|
351
|
+
{
|
352
|
+
self.timer = [NSTimer scheduledTimerWithTimeInterval:DEFAULT_RUNLOOP_INTERVAL
|
353
|
+
target:self
|
354
|
+
selector:@selector(runloop)
|
355
|
+
userInfo:nil
|
356
|
+
repeats:YES];
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
360
|
+
return self;
|
361
|
+
}
|
362
|
+
|
363
|
+
- (void)runloop
|
364
|
+
{
|
365
|
+
if ( _pause )
|
366
|
+
return;
|
367
|
+
|
368
|
+
NSArray * queued = [[NSArray alloc] initWithArray:__sharedQueue];
|
369
|
+
|
370
|
+
for ( BeeMessage * bmsg in queued )
|
371
|
+
{
|
372
|
+
[bmsg runloop];
|
373
|
+
}
|
374
|
+
|
375
|
+
[queued release];
|
376
|
+
}
|
377
|
+
|
378
|
+
- (void)dealloc
|
379
|
+
{
|
380
|
+
[_timer invalidate];
|
381
|
+
_timer = nil;
|
382
|
+
|
383
|
+
self.whenCreate = nil;
|
384
|
+
self.whenUpdate = nil;
|
385
|
+
|
386
|
+
[super dealloc];
|
387
|
+
}
|
388
|
+
|
389
|
+
@end
|
@@ -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
|
+
// BeeMessage+ActiveRecord.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Message.h"
|
35
|
+
#import "Bee_Network.h"
|
36
|
+
#import "Bee_ActiveRecord.h"
|
37
|
+
|
38
|
+
typedef BeeActiveRecord * (^BeeMessageBlockC)( Class clazz );
|
39
|
+
typedef BeeActiveRecord * (^BeeMessageBlockC2)( Class clazz, NSString * path );
|
40
|
+
typedef NSArray * (^BeeMessageBlockCA)( Class clazz );
|
41
|
+
typedef NSArray * (^BeeMessageBlockCA2)( Class clazz, NSString * path );
|
42
|
+
|
43
|
+
#pragma mark -
|
44
|
+
|
45
|
+
@interface BeeMessage(ActiveRecord)
|
46
|
+
|
47
|
+
@property (nonatomic, readonly) BeeMessageBlockC responseRecord;
|
48
|
+
@property (nonatomic, readonly) BeeMessageBlockCA responseRecords;
|
49
|
+
@property (nonatomic, readonly) BeeMessageBlockC2 responseRecordAtPath;
|
50
|
+
@property (nonatomic, readonly) BeeMessageBlockCA2 responseRecordsAtPath;
|
51
|
+
|
52
|
+
@end
|
@@ -0,0 +1,150 @@
|
|
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
|
+
// BeeMessage+ActiveRecord.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Network.h"
|
35
|
+
#import "BeeMessage+JSON.h"
|
36
|
+
#import "BeeMessage+HTTP.h"
|
37
|
+
#import "BeeMessage+ActiveRecord.h"
|
38
|
+
#import "NSDictionary+BeeExtension.h"
|
39
|
+
|
40
|
+
#import "JSONKit.h"
|
41
|
+
#import <objc/runtime.h>
|
42
|
+
|
43
|
+
#pragma mark -
|
44
|
+
|
45
|
+
@implementation BeeMessage(ActiveRecord)
|
46
|
+
|
47
|
+
@dynamic responseRecord;
|
48
|
+
@dynamic responseRecords;
|
49
|
+
@dynamic responseRecordAtPath;
|
50
|
+
@dynamic responseRecordsAtPath;
|
51
|
+
|
52
|
+
- (BeeMessageBlockC)responseRecord
|
53
|
+
{
|
54
|
+
BeeMessageBlockC block = ^ BeeActiveRecord * ( Class clazz )
|
55
|
+
{
|
56
|
+
NSObject * obj = self.responseString;
|
57
|
+
if ( nil == obj )
|
58
|
+
return nil;
|
59
|
+
|
60
|
+
BeeActiveRecord * record = (BeeActiveRecord *)[[clazz alloc] initWithObject:obj];
|
61
|
+
if ( nil == record )
|
62
|
+
return nil;
|
63
|
+
|
64
|
+
return record;
|
65
|
+
};
|
66
|
+
|
67
|
+
return [[block copy] autorelease];
|
68
|
+
}
|
69
|
+
|
70
|
+
- (BeeMessageBlockCA)responseRecords
|
71
|
+
{
|
72
|
+
BeeMessageBlockCA block = ^ NSArray * ( Class clazz )
|
73
|
+
{
|
74
|
+
NSObject * obj = self.responseString;
|
75
|
+
if ( nil == obj || NO == [obj isKindOfClass:[NSArray class]] )
|
76
|
+
return nil;
|
77
|
+
|
78
|
+
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
|
79
|
+
if ( nil == array )
|
80
|
+
return nil;
|
81
|
+
|
82
|
+
for ( NSObject * elem in (NSArray *)obj )
|
83
|
+
{
|
84
|
+
BeeActiveRecord * record = (BeeActiveRecord *)[[clazz alloc] initWithObject:obj];
|
85
|
+
if ( nil == record )
|
86
|
+
return nil;
|
87
|
+
|
88
|
+
[array addObject:record];
|
89
|
+
}
|
90
|
+
|
91
|
+
return array.count ? array : nil;
|
92
|
+
};
|
93
|
+
|
94
|
+
return [[block copy] autorelease];
|
95
|
+
}
|
96
|
+
|
97
|
+
- (BeeMessageBlockC2)responseRecordAtPath
|
98
|
+
{
|
99
|
+
BeeMessageBlockC2 block = ^ BeeActiveRecord * ( Class clazz, NSString * path )
|
100
|
+
{
|
101
|
+
NSObject * obj = self.responseString;
|
102
|
+
if ( nil == obj || NO == [obj isKindOfClass:[NSDictionary class]] )
|
103
|
+
return nil;
|
104
|
+
|
105
|
+
obj = [(NSDictionary *)obj objectAtPath:path];
|
106
|
+
if ( nil == obj )
|
107
|
+
return nil;
|
108
|
+
|
109
|
+
BeeActiveRecord * record = (BeeActiveRecord *)[[clazz alloc] initWithObject:obj];
|
110
|
+
if ( nil == record )
|
111
|
+
return nil;
|
112
|
+
|
113
|
+
return record;
|
114
|
+
};
|
115
|
+
|
116
|
+
return [[block copy] autorelease];
|
117
|
+
}
|
118
|
+
|
119
|
+
- (BeeMessageBlockCA2)responseRecordsAtPath
|
120
|
+
{
|
121
|
+
BeeMessageBlockCA2 block = ^ NSArray * ( Class clazz, NSString * path )
|
122
|
+
{
|
123
|
+
NSObject * obj = self.responseString;
|
124
|
+
if ( nil == obj || NO == [obj isKindOfClass:[NSDictionary class]] )
|
125
|
+
return nil;
|
126
|
+
|
127
|
+
obj = [(NSDictionary *)obj objectAtPath:path];
|
128
|
+
if ( nil == obj || NO == [obj isKindOfClass:[NSArray class]] )
|
129
|
+
return nil;
|
130
|
+
|
131
|
+
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
|
132
|
+
if ( nil == array )
|
133
|
+
return nil;
|
134
|
+
|
135
|
+
for ( NSObject * elem in (NSArray *)obj )
|
136
|
+
{
|
137
|
+
BeeActiveRecord * record = (BeeActiveRecord *)[[clazz alloc] initWithObject:obj];
|
138
|
+
if ( nil == record )
|
139
|
+
return nil;
|
140
|
+
|
141
|
+
[array addObject:record];
|
142
|
+
}
|
143
|
+
|
144
|
+
return array.count ? array : nil;
|
145
|
+
};
|
146
|
+
|
147
|
+
return [[block copy] autorelease];
|
148
|
+
}
|
149
|
+
|
150
|
+
@end
|
@@ -0,0 +1,49 @@
|
|
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
|
+
// BeeMessage+HTTP.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Message.h"
|
35
|
+
#import "Bee_Network.h"
|
36
|
+
|
37
|
+
#pragma mark -
|
38
|
+
|
39
|
+
@interface BeeMessage(HTTP)
|
40
|
+
|
41
|
+
@property (nonatomic, readonly) float uploadProgress;
|
42
|
+
@property (nonatomic, readonly) float downloadProgress;
|
43
|
+
|
44
|
+
@property (nonatomic, readonly) BOOL requesting;
|
45
|
+
@property (nonatomic, readonly) BeeRequest * request;
|
46
|
+
@property (nonatomic, readonly) NSData * response;
|
47
|
+
@property (nonatomic, readonly) NSString * responseString;
|
48
|
+
|
49
|
+
@end
|