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,710 @@
|
|
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_UIQuery.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_UIQuery.h"
|
38
|
+
#import "NSString+BeeExtension.h"
|
39
|
+
#import "UIView+BeeExtension.h"
|
40
|
+
#import "NSArray+BeeExtension.h"
|
41
|
+
|
42
|
+
#import "JSONKit.h"
|
43
|
+
#import <objc/runtime.h>
|
44
|
+
|
45
|
+
#pragma mark -
|
46
|
+
|
47
|
+
BeeUIQueryObjectBlockN __getQueryBlock( id context )
|
48
|
+
{
|
49
|
+
// C
|
50
|
+
|
51
|
+
BeeUIQueryContextBlock contextBlock = ^ BeeUIQueryObjectBlockN ( id context )
|
52
|
+
{
|
53
|
+
// OC Runtime
|
54
|
+
|
55
|
+
id self = context;
|
56
|
+
|
57
|
+
BeeUIQueryObjectBlockN resultBlock = ^ BeeUIQuery * ( id first, ... )
|
58
|
+
{
|
59
|
+
// OC Runtime with self
|
60
|
+
|
61
|
+
BeeUIQuery * wrapper = [[[BeeUIQuery alloc] init] autorelease];
|
62
|
+
if ( nil == wrapper )
|
63
|
+
return nil;
|
64
|
+
|
65
|
+
if ( [first isKindOfClass:[UIView class]] )
|
66
|
+
{
|
67
|
+
wrapper.object = first;
|
68
|
+
}
|
69
|
+
else if ( [first isKindOfClass:[UIViewController class]] )
|
70
|
+
{
|
71
|
+
wrapper.object = first;
|
72
|
+
}
|
73
|
+
else if ( [first isKindOfClass:[NSString class]] )
|
74
|
+
{
|
75
|
+
UIView * rootView = nil;
|
76
|
+
NSString * tag = (NSString * )first;
|
77
|
+
|
78
|
+
if ( [self isKindOfClass:[UIView class]] )
|
79
|
+
{
|
80
|
+
rootView = (UIView *)self;
|
81
|
+
}
|
82
|
+
else if ( [self isKindOfClass:[UIViewController class]] )
|
83
|
+
{
|
84
|
+
rootView = ((UIViewController *)self).view;
|
85
|
+
}
|
86
|
+
else if ( [self isKindOfClass:[UIWindow class]] )
|
87
|
+
{
|
88
|
+
rootView = (UIView *)self;
|
89
|
+
}
|
90
|
+
|
91
|
+
NSMutableArray * result = [NSMutableArray nonRetainingArray];
|
92
|
+
|
93
|
+
NSArray * tags = [tag componentsSeparatedByString:@","];
|
94
|
+
for ( NSString * subTag in tags )
|
95
|
+
{
|
96
|
+
if ( [subTag isEqualToString:@"*"] )
|
97
|
+
{
|
98
|
+
[result addObjectsFromArray:rootView.subviews];
|
99
|
+
}
|
100
|
+
else if ( [subTag hasPrefix:@"#"] )
|
101
|
+
{
|
102
|
+
NSObject * obj = [rootView viewWithTagString:[subTag substringFromIndex:1]];
|
103
|
+
if ( obj )
|
104
|
+
{
|
105
|
+
[result addObject:obj];
|
106
|
+
}
|
107
|
+
}
|
108
|
+
else if ( [subTag hasPrefix:@"."] )
|
109
|
+
{
|
110
|
+
Class clazz = NSClassFromString( [subTag substringFromIndex:1] );
|
111
|
+
if ( nil == clazz )
|
112
|
+
{
|
113
|
+
clazz = [UIView class];
|
114
|
+
}
|
115
|
+
|
116
|
+
if ( clazz )
|
117
|
+
{
|
118
|
+
NSMutableArray * array2 = [NSMutableArray nonRetainingArray];
|
119
|
+
for ( UIView * view in rootView.subviews )
|
120
|
+
{
|
121
|
+
if ( [view isKindOfClass:clazz] )
|
122
|
+
{
|
123
|
+
[array2 addObject:view];
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
[result addObjectsFromArray:array2];
|
128
|
+
}
|
129
|
+
}
|
130
|
+
else
|
131
|
+
{
|
132
|
+
NSArray * paths = [subTag componentsSeparatedByString:@">"];
|
133
|
+
if ( paths.count > 1 )
|
134
|
+
{
|
135
|
+
UIView * subview = rootView;
|
136
|
+
|
137
|
+
for ( NSString * path in paths )
|
138
|
+
{
|
139
|
+
subview = [subview viewWithTagString:path.trim];
|
140
|
+
if ( nil == subview )
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
|
144
|
+
if ( subview )
|
145
|
+
{
|
146
|
+
[result addObject:subview];
|
147
|
+
}
|
148
|
+
}
|
149
|
+
else
|
150
|
+
{
|
151
|
+
UIView * subview = [rootView viewWithTagString:subTag];
|
152
|
+
if ( subview )
|
153
|
+
{
|
154
|
+
[result addObject:subview];
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
161
|
+
if ( 0 == result.count )
|
162
|
+
{
|
163
|
+
CC( @"No subviews matched by '%@'", tag );
|
164
|
+
}
|
165
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
166
|
+
|
167
|
+
wrapper.retainedObject = result;
|
168
|
+
}
|
169
|
+
|
170
|
+
return wrapper;
|
171
|
+
};
|
172
|
+
|
173
|
+
return [[resultBlock copy] autorelease];
|
174
|
+
};
|
175
|
+
|
176
|
+
return contextBlock( context );
|
177
|
+
}
|
178
|
+
|
179
|
+
#pragma mark -
|
180
|
+
|
181
|
+
@implementation BeeUIQuery
|
182
|
+
|
183
|
+
@dynamic HIDE;
|
184
|
+
@dynamic SHOW;
|
185
|
+
@dynamic TOGGLE;
|
186
|
+
|
187
|
+
//@dynamic UNWRAP;
|
188
|
+
//@dynamic WRAP;
|
189
|
+
|
190
|
+
@dynamic APPEND;
|
191
|
+
@dynamic PREPEND;
|
192
|
+
@dynamic REMOVE;
|
193
|
+
@dynamic EMPTY;
|
194
|
+
@dynamic REPLACE_WITH;
|
195
|
+
|
196
|
+
@dynamic EACH;
|
197
|
+
@dynamic FIND;
|
198
|
+
@dynamic FILTER;
|
199
|
+
|
200
|
+
@dynamic FIRST;
|
201
|
+
@dynamic LAST;
|
202
|
+
@dynamic NEXT;
|
203
|
+
@dynamic PREV;
|
204
|
+
@dynamic CHILDREN;
|
205
|
+
@dynamic PARENT;
|
206
|
+
@dynamic PARENTS;
|
207
|
+
@dynamic SIBLINGS;
|
208
|
+
|
209
|
+
- (BeeUIQueryObjectBlock)HIDE
|
210
|
+
{
|
211
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
212
|
+
{
|
213
|
+
for ( UIView * v in self.views )
|
214
|
+
{
|
215
|
+
v.hidden = YES;
|
216
|
+
}
|
217
|
+
return self;
|
218
|
+
};
|
219
|
+
|
220
|
+
return [[block copy] autorelease];
|
221
|
+
}
|
222
|
+
|
223
|
+
- (BeeUIQueryObjectBlock)SHOW
|
224
|
+
{
|
225
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
226
|
+
{
|
227
|
+
for ( UIView * v in self.views )
|
228
|
+
{
|
229
|
+
v.hidden = NO;
|
230
|
+
}
|
231
|
+
return self;
|
232
|
+
};
|
233
|
+
|
234
|
+
return [[block copy] autorelease];
|
235
|
+
}
|
236
|
+
|
237
|
+
- (BeeUIQueryObjectBlock)TOGGLE
|
238
|
+
{
|
239
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
240
|
+
{
|
241
|
+
for ( UIView * v in self.views )
|
242
|
+
{
|
243
|
+
v.hidden = v.hidden ? NO : YES;
|
244
|
+
}
|
245
|
+
return self;
|
246
|
+
};
|
247
|
+
|
248
|
+
return [[block copy] autorelease];
|
249
|
+
}
|
250
|
+
|
251
|
+
//- (BeeUIQueryObjectBlock)UNWRAP
|
252
|
+
//{
|
253
|
+
// BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
254
|
+
// {
|
255
|
+
// // TODO:
|
256
|
+
// return self;
|
257
|
+
// };
|
258
|
+
//
|
259
|
+
// return [[block copy] autorelease];
|
260
|
+
//}
|
261
|
+
//
|
262
|
+
//- (BeeUIQueryObjectBlockCS)WRAP
|
263
|
+
//{
|
264
|
+
// BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
265
|
+
// {
|
266
|
+
// // TODO:
|
267
|
+
// return self;
|
268
|
+
// };
|
269
|
+
//
|
270
|
+
// return [[block copy] autorelease];
|
271
|
+
//}
|
272
|
+
|
273
|
+
- (BeeUIQueryObjectBlockCS)BEFORE
|
274
|
+
{
|
275
|
+
BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
276
|
+
{
|
277
|
+
if ( nil == clazz )
|
278
|
+
{
|
279
|
+
clazz = [UIView class];
|
280
|
+
}
|
281
|
+
|
282
|
+
if ( clazz != [UIView class] && NO == [clazz isSubclassOfClass:[UIView class]] )
|
283
|
+
return self;
|
284
|
+
|
285
|
+
for ( UIView * v in self.views )
|
286
|
+
{
|
287
|
+
if ( nil == v.superview )
|
288
|
+
continue;
|
289
|
+
|
290
|
+
UIView * view = [[[clazz alloc] initWithFrame:CGRectZero] autorelease];
|
291
|
+
if ( view )
|
292
|
+
{
|
293
|
+
view.tagString = tag;
|
294
|
+
[v.superview insertSubview:view belowSubview:v];
|
295
|
+
}
|
296
|
+
}
|
297
|
+
return self;
|
298
|
+
};
|
299
|
+
|
300
|
+
return [[block copy] autorelease];
|
301
|
+
}
|
302
|
+
|
303
|
+
- (BeeUIQueryObjectBlockCS)AFTER
|
304
|
+
{
|
305
|
+
BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
306
|
+
{
|
307
|
+
if ( nil == clazz )
|
308
|
+
{
|
309
|
+
clazz = [UIView class];
|
310
|
+
}
|
311
|
+
|
312
|
+
if ( clazz != [UIView class] && NO == [clazz isSubclassOfClass:[UIView class]] )
|
313
|
+
return self;
|
314
|
+
|
315
|
+
for ( UIView * v in self.views )
|
316
|
+
{
|
317
|
+
if ( nil == v.superview )
|
318
|
+
continue;
|
319
|
+
|
320
|
+
UIView * view = [[[clazz alloc] initWithFrame:CGRectZero] autorelease];
|
321
|
+
if ( view )
|
322
|
+
{
|
323
|
+
view.tagString = tag;
|
324
|
+
[v.superview insertSubview:view aboveSubview:v];
|
325
|
+
}
|
326
|
+
}
|
327
|
+
return self;
|
328
|
+
};
|
329
|
+
|
330
|
+
return [[block copy] autorelease];
|
331
|
+
}
|
332
|
+
|
333
|
+
- (BeeUIQueryObjectBlockCS)APPEND
|
334
|
+
{
|
335
|
+
BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
336
|
+
{
|
337
|
+
if ( nil == clazz )
|
338
|
+
{
|
339
|
+
clazz = [UIView class];
|
340
|
+
}
|
341
|
+
|
342
|
+
if ( clazz != [UIView class] && NO == [clazz isSubclassOfClass:[UIView class]] )
|
343
|
+
return self;
|
344
|
+
|
345
|
+
for ( UIView * v in self.views )
|
346
|
+
{
|
347
|
+
UIView * view = [[[clazz alloc] initWithFrame:CGRectZero] autorelease];
|
348
|
+
if ( view )
|
349
|
+
{
|
350
|
+
view.tagString = tag;
|
351
|
+
[v addSubview:view];
|
352
|
+
[v bringSubviewToFront:view];
|
353
|
+
}
|
354
|
+
}
|
355
|
+
return self;
|
356
|
+
};
|
357
|
+
|
358
|
+
return [[block copy] autorelease];
|
359
|
+
}
|
360
|
+
|
361
|
+
- (BeeUIQueryObjectBlockCS)PREPEND
|
362
|
+
{
|
363
|
+
BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
364
|
+
{
|
365
|
+
if ( nil == clazz )
|
366
|
+
{
|
367
|
+
clazz = [UIView class];
|
368
|
+
}
|
369
|
+
|
370
|
+
if ( clazz != [UIView class] && NO == [clazz isSubclassOfClass:[UIView class]] )
|
371
|
+
return self;
|
372
|
+
|
373
|
+
for ( UIView * v in self.views )
|
374
|
+
{
|
375
|
+
UIView * view = [[[clazz alloc] initWithFrame:CGRectZero] autorelease];
|
376
|
+
if ( view )
|
377
|
+
{
|
378
|
+
view.tagString = tag;
|
379
|
+
[v addSubview:view];
|
380
|
+
[v sendSubviewToBack:view];
|
381
|
+
}
|
382
|
+
}
|
383
|
+
return self;
|
384
|
+
};
|
385
|
+
|
386
|
+
return [[block copy] autorelease];
|
387
|
+
}
|
388
|
+
|
389
|
+
- (BeeUIQueryObjectBlock)REMOVE
|
390
|
+
{
|
391
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
392
|
+
{
|
393
|
+
for ( UIView * v in self.views )
|
394
|
+
{
|
395
|
+
[v removeFromSuperview];
|
396
|
+
}
|
397
|
+
return self;
|
398
|
+
};
|
399
|
+
|
400
|
+
return [[block copy] autorelease];
|
401
|
+
}
|
402
|
+
|
403
|
+
- (BeeUIQueryObjectBlock)EMPTY
|
404
|
+
{
|
405
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
406
|
+
{
|
407
|
+
for ( UIView * v in self.views )
|
408
|
+
{
|
409
|
+
[v removeAllSubviews];
|
410
|
+
}
|
411
|
+
return self;
|
412
|
+
};
|
413
|
+
|
414
|
+
return [[block copy] autorelease];
|
415
|
+
}
|
416
|
+
|
417
|
+
- (BeeUIQueryObjectBlockS)REPLACE_ALL
|
418
|
+
{
|
419
|
+
BeeUIQueryObjectBlockS block = ^ BeeUIQuery * ( NSString * tag )
|
420
|
+
{
|
421
|
+
// TODO:
|
422
|
+
return self;
|
423
|
+
};
|
424
|
+
|
425
|
+
return [[block copy] autorelease];
|
426
|
+
}
|
427
|
+
|
428
|
+
- (BeeUIQueryObjectBlockCS)REPLACE_WITH
|
429
|
+
{
|
430
|
+
BeeUIQueryObjectBlockCS block = ^ BeeUIQuery * ( Class clazz, NSString * tag )
|
431
|
+
{
|
432
|
+
if ( nil == clazz )
|
433
|
+
{
|
434
|
+
clazz = [UIView class];
|
435
|
+
}
|
436
|
+
|
437
|
+
for ( UIView * v in self.views )
|
438
|
+
{
|
439
|
+
UIView * parentView = v.superview;
|
440
|
+
if ( parentView )
|
441
|
+
{
|
442
|
+
UIView * newView = [[[clazz alloc] init] autorelease];
|
443
|
+
if ( newView )
|
444
|
+
{
|
445
|
+
newView.tagString = tag;
|
446
|
+
|
447
|
+
[parentView insertSubview:newView aboveSubview:v];
|
448
|
+
[v removeFromSuperview];
|
449
|
+
}
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
return self;
|
454
|
+
};
|
455
|
+
|
456
|
+
return [[block copy] autorelease];
|
457
|
+
}
|
458
|
+
|
459
|
+
- (BeeUIQueryObjectBlockX)EACH
|
460
|
+
{
|
461
|
+
BeeUIQueryObjectBlockX block = ^ BeeUIQuery * ( void (^block)(UIView *) )
|
462
|
+
{
|
463
|
+
for ( UIView * v in self.views )
|
464
|
+
{
|
465
|
+
block( v );
|
466
|
+
}
|
467
|
+
return self;
|
468
|
+
};
|
469
|
+
|
470
|
+
return [[block copy] autorelease];
|
471
|
+
}
|
472
|
+
|
473
|
+
- (BeeUIQueryObjectBlock)FIRST
|
474
|
+
{
|
475
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
476
|
+
{
|
477
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
478
|
+
q.object = [self.views objectAtIndex:0];
|
479
|
+
return q;
|
480
|
+
};
|
481
|
+
|
482
|
+
return [[block copy] autorelease];
|
483
|
+
}
|
484
|
+
|
485
|
+
- (BeeUIQueryObjectBlock)LAST
|
486
|
+
{
|
487
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
488
|
+
{
|
489
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
490
|
+
q.object = [self.views lastObject];
|
491
|
+
return q;
|
492
|
+
};
|
493
|
+
|
494
|
+
return [[block copy] autorelease];
|
495
|
+
}
|
496
|
+
|
497
|
+
- (BeeUIQueryObjectBlockS)FIND
|
498
|
+
{
|
499
|
+
BeeUIQueryObjectBlockS block = ^ BeeUIQuery * ( NSString * tag )
|
500
|
+
{
|
501
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
502
|
+
|
503
|
+
for ( UIView * v in self.views )
|
504
|
+
{
|
505
|
+
UIView * newView = [v viewWithTagString:tag];
|
506
|
+
if ( newView )
|
507
|
+
{
|
508
|
+
[array addObject:newView];
|
509
|
+
}
|
510
|
+
}
|
511
|
+
|
512
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
513
|
+
q.retainedObject = array;
|
514
|
+
return q;
|
515
|
+
};
|
516
|
+
|
517
|
+
return [[block copy] autorelease];
|
518
|
+
}
|
519
|
+
|
520
|
+
- (BeeUIQueryObjectBlockS)FILTER
|
521
|
+
{
|
522
|
+
BeeUIQueryObjectBlockS block = ^ BeeUIQuery * ( NSString * tag )
|
523
|
+
{
|
524
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
525
|
+
|
526
|
+
for ( UIView * v in self.views )
|
527
|
+
{
|
528
|
+
if ( [tag isEqualToString:@"*"] )
|
529
|
+
{
|
530
|
+
[array addObject:v];
|
531
|
+
}
|
532
|
+
else if ( [tag hasPrefix:@"#"] )
|
533
|
+
{
|
534
|
+
if ( [v.tagString isEqualToString:[tag substringFromIndex:1]] )
|
535
|
+
{
|
536
|
+
[array addObject:v];
|
537
|
+
}
|
538
|
+
}
|
539
|
+
else if ( [tag hasPrefix:@"."] )
|
540
|
+
{
|
541
|
+
Class clazz = NSClassFromString( [tag substringFromIndex:1] );
|
542
|
+
if ( nil == clazz )
|
543
|
+
{
|
544
|
+
clazz = [UIView class];
|
545
|
+
}
|
546
|
+
|
547
|
+
if ( clazz && [v isKindOfClass:clazz] )
|
548
|
+
{
|
549
|
+
[array addObject:v];
|
550
|
+
}
|
551
|
+
}
|
552
|
+
else
|
553
|
+
{
|
554
|
+
if ( [v.tagString isEqualToString:tag] )
|
555
|
+
{
|
556
|
+
[array addObject:v];
|
557
|
+
}
|
558
|
+
}
|
559
|
+
}
|
560
|
+
|
561
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
562
|
+
q.retainedObject = array;
|
563
|
+
return q;
|
564
|
+
};
|
565
|
+
|
566
|
+
return [[block copy] autorelease];
|
567
|
+
}
|
568
|
+
|
569
|
+
- (BeeUIQueryObjectBlock)NEXT
|
570
|
+
{
|
571
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
572
|
+
{
|
573
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
574
|
+
|
575
|
+
for ( UIView * v in self.views )
|
576
|
+
{
|
577
|
+
UIView * sibling = [v nextSibling];
|
578
|
+
if ( sibling )
|
579
|
+
{
|
580
|
+
[array addObject:sibling];
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
585
|
+
q.retainedObject = array;
|
586
|
+
return q;
|
587
|
+
};
|
588
|
+
|
589
|
+
return [[block copy] autorelease];
|
590
|
+
}
|
591
|
+
|
592
|
+
- (BeeUIQueryObjectBlock)PREV
|
593
|
+
{
|
594
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
595
|
+
{
|
596
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
597
|
+
|
598
|
+
for ( UIView * v in self.views )
|
599
|
+
{
|
600
|
+
UIView * sibling = [v prevSibling];
|
601
|
+
if ( sibling )
|
602
|
+
{
|
603
|
+
[array addObject:sibling];
|
604
|
+
}
|
605
|
+
}
|
606
|
+
|
607
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
608
|
+
q.retainedObject = array;
|
609
|
+
return q;
|
610
|
+
};
|
611
|
+
|
612
|
+
return [[block copy] autorelease];
|
613
|
+
}
|
614
|
+
|
615
|
+
- (BeeUIQueryObjectBlock)PARENT
|
616
|
+
{
|
617
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
618
|
+
{
|
619
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
620
|
+
|
621
|
+
for ( UIView * v in self.views )
|
622
|
+
{
|
623
|
+
if ( v.superview )
|
624
|
+
{
|
625
|
+
[array addObject:v.superview];
|
626
|
+
}
|
627
|
+
}
|
628
|
+
|
629
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
630
|
+
q.retainedObject = array;
|
631
|
+
return q;
|
632
|
+
};
|
633
|
+
|
634
|
+
return [[block copy] autorelease];
|
635
|
+
}
|
636
|
+
|
637
|
+
- (BeeUIQueryObjectBlock)CHILDREN
|
638
|
+
{
|
639
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
640
|
+
{
|
641
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
642
|
+
|
643
|
+
for ( UIView * v in self.views )
|
644
|
+
{
|
645
|
+
[array addObjectsFromArray:v.subviews];
|
646
|
+
}
|
647
|
+
|
648
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
649
|
+
q.retainedObject = array;
|
650
|
+
return q;
|
651
|
+
};
|
652
|
+
|
653
|
+
return [[block copy] autorelease];
|
654
|
+
}
|
655
|
+
|
656
|
+
- (void)walkThroughSuperviews:(UIView *)view forArray:(NSMutableArray *)array
|
657
|
+
{
|
658
|
+
if ( nil == view.superview )
|
659
|
+
return;
|
660
|
+
|
661
|
+
[array addObject:view.superview];
|
662
|
+
|
663
|
+
[self walkThroughSuperviews:view.superview forArray:array];
|
664
|
+
}
|
665
|
+
|
666
|
+
- (BeeUIQueryObjectBlock)PARENTS
|
667
|
+
{
|
668
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
669
|
+
{
|
670
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
671
|
+
|
672
|
+
for ( UIView * v in self.views )
|
673
|
+
{
|
674
|
+
[self walkThroughSuperviews:v forArray:array];
|
675
|
+
}
|
676
|
+
|
677
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
678
|
+
q.retainedObject = array;
|
679
|
+
return q;
|
680
|
+
};
|
681
|
+
|
682
|
+
return [[block copy] autorelease];
|
683
|
+
}
|
684
|
+
|
685
|
+
- (BeeUIQueryObjectBlock)SIBLINGS
|
686
|
+
{
|
687
|
+
BeeUIQueryObjectBlock block = ^ BeeUIQuery * ( void )
|
688
|
+
{
|
689
|
+
NSMutableArray * array = [NSMutableArray nonRetainingArray];
|
690
|
+
|
691
|
+
for ( UIView * v in self.views )
|
692
|
+
{
|
693
|
+
if ( v.superview )
|
694
|
+
{
|
695
|
+
[array addObjectsFromArray:v.superview.subviews];
|
696
|
+
[array removeObject:v];
|
697
|
+
}
|
698
|
+
}
|
699
|
+
|
700
|
+
BeeUIQuery * q = [[[BeeUIQuery alloc] init] autorelease];
|
701
|
+
q.retainedObject = array;
|
702
|
+
return q;
|
703
|
+
};
|
704
|
+
|
705
|
+
return [[block copy] autorelease];
|
706
|
+
}
|
707
|
+
|
708
|
+
@end
|
709
|
+
|
710
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|