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,556 @@
|
|
1
|
+
//
|
2
|
+
// ______ ______ ______
|
3
|
+
// /\ __ \ /\ ___\ /\ ___\
|
4
|
+
// \ \ __< \ \ __\_ \ \ __\_
|
5
|
+
// \ \_____\ \ \_____\ \ \_____\
|
6
|
+
// \/_____/ \/_____/ \/_____/
|
7
|
+
//
|
8
|
+
// Copyright (c) 2012 BEE creators
|
9
|
+
// http://www.whatsbug.com
|
10
|
+
//
|
11
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
12
|
+
// copy of this software and associated documentation files (the "Software"),
|
13
|
+
// to deal in the Software without restriction, including without limitation
|
14
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
15
|
+
// and/or sell copies of the Software, and to permit persons to whom the
|
16
|
+
// Software is furnished to do so, subject to the following conditions:
|
17
|
+
//
|
18
|
+
// The above copyright notice and this permission notice shall be included in
|
19
|
+
// all copies or substantial portions of the Software.
|
20
|
+
//
|
21
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
27
|
+
// IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
//
|
30
|
+
// UIView+BeeBackground.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
#import "Bee_UIImageView.h"
|
38
|
+
#import "Bee_UILabel.h"
|
39
|
+
#import "UIView+BeeExtension.h"
|
40
|
+
#include <objc/runtime.h>
|
41
|
+
#include <execinfo.h>
|
42
|
+
|
43
|
+
#pragma mark -
|
44
|
+
|
45
|
+
@interface __BeeHintLabel : BeeUILabel
|
46
|
+
@end
|
47
|
+
|
48
|
+
@implementation __BeeHintLabel
|
49
|
+
|
50
|
+
- (id)initWithFrame:(CGRect)frame
|
51
|
+
{
|
52
|
+
self = [super initWithFrame:frame];
|
53
|
+
if ( self )
|
54
|
+
{
|
55
|
+
self.autoresizesSubviews = YES;
|
56
|
+
self.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
|
57
|
+
|
58
|
+
self.alpha = 0.6f;
|
59
|
+
self.backgroundColor = [UIColor clearColor];
|
60
|
+
self.userInteractionEnabled = NO;
|
61
|
+
|
62
|
+
self.textColor = [UIColor whiteColor];
|
63
|
+
self.textAlignment = UITextAlignmentCenter;
|
64
|
+
self.font = [UIFont boldSystemFontOfSize:16.0f];
|
65
|
+
self.lineBreakMode = UILineBreakModeClip;
|
66
|
+
self.numberOfLines = 1;
|
67
|
+
}
|
68
|
+
|
69
|
+
return self;
|
70
|
+
}
|
71
|
+
|
72
|
+
- (void)drawRect:(CGRect)rect
|
73
|
+
{
|
74
|
+
CGContextRef context = UIGraphicsGetCurrentContext();
|
75
|
+
if ( context )
|
76
|
+
{
|
77
|
+
CGContextSaveGState( context );
|
78
|
+
|
79
|
+
CGContextSetStrokeColorWithColor( context, [UIColor colorWithWhite:0.3f alpha:1.0f].CGColor );
|
80
|
+
CGContextMoveToPoint( context, 0.0f, 0.0f );
|
81
|
+
CGContextAddLineToPoint( context, self.bounds.size.width, self.bounds.size.height );
|
82
|
+
CGContextStrokePath( context );
|
83
|
+
|
84
|
+
CGContextSetStrokeColorWithColor( context, [UIColor colorWithWhite:0.3f alpha:1.0f].CGColor );
|
85
|
+
CGContextMoveToPoint( context, 0.0f, self.bounds.size.height );
|
86
|
+
CGContextAddLineToPoint( context, self.bounds.size.width, 0.0f );
|
87
|
+
CGContextStrokePath( context );
|
88
|
+
|
89
|
+
CGContextRestoreGState( context );
|
90
|
+
}
|
91
|
+
|
92
|
+
[super drawRect:rect];
|
93
|
+
}
|
94
|
+
|
95
|
+
@end
|
96
|
+
|
97
|
+
#pragma mark -
|
98
|
+
|
99
|
+
@interface __BeeBackgroundImageView : BeeUIImageView
|
100
|
+
@end
|
101
|
+
|
102
|
+
@implementation __BeeBackgroundImageView
|
103
|
+
@end
|
104
|
+
|
105
|
+
#pragma mark -
|
106
|
+
|
107
|
+
@implementation UIView(BeeExtension)
|
108
|
+
|
109
|
+
@dynamic tagString;
|
110
|
+
@dynamic hintString;
|
111
|
+
@dynamic hintColor;
|
112
|
+
@dynamic backgroundImageView;
|
113
|
+
@dynamic backgroundImage;
|
114
|
+
|
115
|
+
@dynamic top;
|
116
|
+
@dynamic bottom;
|
117
|
+
@dynamic left;
|
118
|
+
@dynamic right;
|
119
|
+
@dynamic width;
|
120
|
+
@dynamic height;
|
121
|
+
|
122
|
+
@dynamic x;
|
123
|
+
@dynamic y;
|
124
|
+
@dynamic w;
|
125
|
+
@dynamic h;
|
126
|
+
@dynamic visible;
|
127
|
+
|
128
|
+
- (__BeeBackgroundImageView *)__backgroundImageView
|
129
|
+
{
|
130
|
+
__BeeBackgroundImageView * result = nil;
|
131
|
+
|
132
|
+
for ( UIView * subView in self.subviews )
|
133
|
+
{
|
134
|
+
if ( [subView isKindOfClass:[__BeeBackgroundImageView class]] )
|
135
|
+
{
|
136
|
+
result = (__BeeBackgroundImageView *)subView;
|
137
|
+
break;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
return result;
|
142
|
+
}
|
143
|
+
|
144
|
+
- (BeeUIImageView *)backgroundImageView
|
145
|
+
{
|
146
|
+
return [self __backgroundImageView];
|
147
|
+
}
|
148
|
+
|
149
|
+
- (void)setBackgroundImageView:(BeeUIImageView *)backgroundImageView
|
150
|
+
{
|
151
|
+
NSAssert( @"TO BE DONE", nil );
|
152
|
+
}
|
153
|
+
|
154
|
+
- (UIImage *)backgroundImage
|
155
|
+
{
|
156
|
+
__BeeBackgroundImageView * imageView = [self __backgroundImageView];
|
157
|
+
if ( imageView )
|
158
|
+
{
|
159
|
+
return imageView.image;
|
160
|
+
}
|
161
|
+
|
162
|
+
return nil;
|
163
|
+
}
|
164
|
+
|
165
|
+
- (void)setBackgroundImage:(UIImage *)image
|
166
|
+
{
|
167
|
+
if ( image )
|
168
|
+
{
|
169
|
+
__BeeBackgroundImageView * imageView = [self __backgroundImageView];
|
170
|
+
if ( nil == imageView )
|
171
|
+
{
|
172
|
+
imageView = [[[__BeeBackgroundImageView alloc] initWithFrame:self.bounds] autorelease];
|
173
|
+
[self addSubview:imageView];
|
174
|
+
[self sendSubviewToBack:imageView];
|
175
|
+
}
|
176
|
+
|
177
|
+
imageView.autoresizesSubviews = YES;
|
178
|
+
imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
179
|
+
imageView.image = image;
|
180
|
+
imageView.frame = self.bounds;
|
181
|
+
imageView.contentMode = UIViewContentModeCenter;
|
182
|
+
[imageView setNeedsDisplay];
|
183
|
+
}
|
184
|
+
else
|
185
|
+
{
|
186
|
+
__BeeBackgroundImageView * imageView = [self __backgroundImageView];
|
187
|
+
if ( imageView )
|
188
|
+
{
|
189
|
+
[imageView removeFromSuperview];
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
- (NSString *)tagString
|
195
|
+
{
|
196
|
+
NSObject * obj = objc_getAssociatedObject( self, "UIView.tagString" );
|
197
|
+
if ( obj && [obj isKindOfClass:[NSString class]] )
|
198
|
+
return (NSString *)obj;
|
199
|
+
|
200
|
+
return nil;
|
201
|
+
}
|
202
|
+
|
203
|
+
- (void)setTagString:(NSString *)value
|
204
|
+
{
|
205
|
+
objc_setAssociatedObject( self, "UIView.tagString", value, OBJC_ASSOCIATION_RETAIN );
|
206
|
+
}
|
207
|
+
|
208
|
+
- (UIView *)viewWithTagString:(NSString *)value
|
209
|
+
{
|
210
|
+
if ( nil == value )
|
211
|
+
return nil;
|
212
|
+
|
213
|
+
for ( UIView * subview in self.subviews )
|
214
|
+
{
|
215
|
+
NSString * tag = subview.tagString;
|
216
|
+
if ( [tag isEqualToString:value] )
|
217
|
+
{
|
218
|
+
return subview;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
return nil;
|
223
|
+
}
|
224
|
+
|
225
|
+
- (UIView *)viewWithTagPath:(NSString *)path
|
226
|
+
{
|
227
|
+
NSArray * array = [path componentsSeparatedByString:@"."];
|
228
|
+
if ( 0 == [array count] )
|
229
|
+
{
|
230
|
+
return nil;
|
231
|
+
}
|
232
|
+
|
233
|
+
UIView * result = self;
|
234
|
+
|
235
|
+
for ( NSString * subPath in array )
|
236
|
+
{
|
237
|
+
if ( 0 == subPath.length )
|
238
|
+
continue;
|
239
|
+
|
240
|
+
result = [result viewWithTagString:subPath];
|
241
|
+
if ( nil == result )
|
242
|
+
return nil;
|
243
|
+
|
244
|
+
if ( [array lastObject] == subPath )
|
245
|
+
{
|
246
|
+
return result;
|
247
|
+
}
|
248
|
+
else if ( NO == [result isKindOfClass:[UIView class]] )
|
249
|
+
{
|
250
|
+
return nil;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
return result;
|
255
|
+
}
|
256
|
+
|
257
|
+
- (UIView *)viewAtPath:(NSString *)path
|
258
|
+
{
|
259
|
+
if ( nil == path || 0 == path.length )
|
260
|
+
return nil;
|
261
|
+
|
262
|
+
NSString * keyPath = [path stringByReplacingOccurrencesOfString:@"/" withString:@"."];
|
263
|
+
NSRange range = NSMakeRange( 0, 1 );
|
264
|
+
|
265
|
+
if ( [[keyPath substringWithRange:range] isEqualToString:@"."] )
|
266
|
+
{
|
267
|
+
keyPath = [keyPath substringFromIndex:1];
|
268
|
+
}
|
269
|
+
|
270
|
+
NSObject * result = [self valueForKeyPath:keyPath];
|
271
|
+
if ( result == [NSNull null] || NO == [result isKindOfClass:[UIView class]] )
|
272
|
+
return nil;
|
273
|
+
|
274
|
+
return (UIView *)result;
|
275
|
+
}
|
276
|
+
|
277
|
+
- (UIView *)subview:(NSString *)name
|
278
|
+
{
|
279
|
+
if ( nil == name || 0 == [name length] )
|
280
|
+
return nil;
|
281
|
+
|
282
|
+
NSObject * view = [self valueForKey:name];
|
283
|
+
|
284
|
+
if ( [view isKindOfClass:[UIView class]] )
|
285
|
+
{
|
286
|
+
return (UIView *)view;
|
287
|
+
}
|
288
|
+
else
|
289
|
+
{
|
290
|
+
return nil;
|
291
|
+
}
|
292
|
+
}
|
293
|
+
|
294
|
+
- (UIView *)prevSibling
|
295
|
+
{
|
296
|
+
if ( nil == self.superview )
|
297
|
+
return nil;
|
298
|
+
|
299
|
+
if ( self.superview.subviews.count <= 1 )
|
300
|
+
return nil;
|
301
|
+
|
302
|
+
NSUInteger count = self.superview.subviews.count;
|
303
|
+
NSUInteger index = [self.superview.subviews indexOfObject:self];
|
304
|
+
if ( 0 == index )
|
305
|
+
{
|
306
|
+
index = count - 1;
|
307
|
+
}
|
308
|
+
else
|
309
|
+
{
|
310
|
+
index = index - 1;
|
311
|
+
}
|
312
|
+
|
313
|
+
return [self.superview.subviews objectAtIndex:index];
|
314
|
+
}
|
315
|
+
|
316
|
+
- (UIView *)nextSibling
|
317
|
+
{
|
318
|
+
if ( nil == self.superview )
|
319
|
+
return nil;
|
320
|
+
|
321
|
+
if ( self.superview.subviews.count <= 1 )
|
322
|
+
return nil;
|
323
|
+
|
324
|
+
NSUInteger count = self.superview.subviews.count;
|
325
|
+
NSUInteger index = [self.superview.subviews indexOfObject:self];
|
326
|
+
|
327
|
+
return [self.superview.subviews objectAtIndex:(index + 1) % count];
|
328
|
+
}
|
329
|
+
|
330
|
+
- (void)removeAllSubviews
|
331
|
+
{
|
332
|
+
for ( UIView * view in [[self.subviews copy] autorelease] )
|
333
|
+
{
|
334
|
+
[view removeFromSuperview];
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
- (UIViewController *)viewController
|
339
|
+
{
|
340
|
+
if ( nil != self.superview )
|
341
|
+
return nil;
|
342
|
+
|
343
|
+
id nextResponder = [self nextResponder];
|
344
|
+
if ( [nextResponder isKindOfClass:[UIViewController class]] )
|
345
|
+
{
|
346
|
+
return (UIViewController *)nextResponder;
|
347
|
+
}
|
348
|
+
else
|
349
|
+
{
|
350
|
+
return nil;
|
351
|
+
}
|
352
|
+
}
|
353
|
+
|
354
|
+
- (__BeeHintLabel *)__hintLabel
|
355
|
+
{
|
356
|
+
#if defined(__BEE_WIREFRAME__) && __BEE_WIREFRAME__
|
357
|
+
|
358
|
+
__BeeHintLabel * hintLabel = nil;
|
359
|
+
|
360
|
+
for ( UIView * subView in self.subviews )
|
361
|
+
{
|
362
|
+
if ( [subView isKindOfClass:[__BeeHintLabel class]] )
|
363
|
+
{
|
364
|
+
hintLabel = (__BeeHintLabel *)subView;
|
365
|
+
break;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
if ( nil == hintLabel )
|
370
|
+
{
|
371
|
+
hintLabel = [[[__BeeHintLabel alloc] initWithFrame:self.bounds] autorelease];
|
372
|
+
hintLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
373
|
+
hintLabel.backgroundColor = [UIColor darkGrayColor];
|
374
|
+
[self addSubview:hintLabel];
|
375
|
+
}
|
376
|
+
|
377
|
+
hintLabel.frame = self.bounds;
|
378
|
+
[hintLabel setNeedsDisplay];
|
379
|
+
|
380
|
+
[self setAutoresizesSubviews:YES];
|
381
|
+
[self sendSubviewToBack:hintLabel];
|
382
|
+
|
383
|
+
return hintLabel;
|
384
|
+
|
385
|
+
#else // #if defined(__BEE_WIREFRAME__) && __BEE_WIREFRAME__
|
386
|
+
|
387
|
+
return nil;
|
388
|
+
|
389
|
+
#endif // #if defined(__BEE_WIREFRAME__) && __BEE_WIREFRAME__
|
390
|
+
}
|
391
|
+
|
392
|
+
- (NSString *)hintString
|
393
|
+
{
|
394
|
+
return [self __hintLabel].text;
|
395
|
+
}
|
396
|
+
|
397
|
+
- (void)setHintString:(NSString *)string
|
398
|
+
{
|
399
|
+
[self __hintLabel].text = string;
|
400
|
+
}
|
401
|
+
|
402
|
+
- (UIColor *)hintColor
|
403
|
+
{
|
404
|
+
return [self __hintLabel].backgroundColor;
|
405
|
+
}
|
406
|
+
|
407
|
+
- (void)setHintColor:(UIColor *)color
|
408
|
+
{
|
409
|
+
[self __hintLabel].backgroundColor = color;
|
410
|
+
}
|
411
|
+
|
412
|
+
+ (UIView *)spawn
|
413
|
+
{
|
414
|
+
return [[[[self class] alloc] init] autorelease];
|
415
|
+
}
|
416
|
+
|
417
|
+
+ (UIView *)spawn:(NSString *)tagString
|
418
|
+
{
|
419
|
+
UIView * view = [self spawn];
|
420
|
+
view.tagString = tagString;
|
421
|
+
return view;
|
422
|
+
}
|
423
|
+
|
424
|
+
- (CGFloat)top
|
425
|
+
{
|
426
|
+
return self.frame.origin.y;
|
427
|
+
}
|
428
|
+
|
429
|
+
- (void)setTop:(CGFloat)top
|
430
|
+
{
|
431
|
+
CGRect frame = self.frame;
|
432
|
+
frame.origin.y = top;
|
433
|
+
self.frame = frame;
|
434
|
+
}
|
435
|
+
|
436
|
+
- (CGFloat)left
|
437
|
+
{
|
438
|
+
return self.frame.origin.x;
|
439
|
+
}
|
440
|
+
|
441
|
+
- (void)setLeft:(CGFloat)left
|
442
|
+
{
|
443
|
+
CGRect frame = self.frame;
|
444
|
+
frame.origin.x = left;
|
445
|
+
self.frame = frame;
|
446
|
+
}
|
447
|
+
|
448
|
+
- (CGFloat)width
|
449
|
+
{
|
450
|
+
return self.frame.size.width;
|
451
|
+
}
|
452
|
+
|
453
|
+
- (void)setWidth:(CGFloat)width
|
454
|
+
{
|
455
|
+
CGRect frame = self.frame;
|
456
|
+
frame.size.width = width;
|
457
|
+
self.frame = frame;
|
458
|
+
}
|
459
|
+
|
460
|
+
- (CGFloat)height
|
461
|
+
{
|
462
|
+
return self.frame.size.height;
|
463
|
+
}
|
464
|
+
|
465
|
+
- (void)setHeight:(CGFloat)height
|
466
|
+
{
|
467
|
+
CGRect frame = self.frame;
|
468
|
+
frame.size.height = height;
|
469
|
+
self.frame = frame;
|
470
|
+
}
|
471
|
+
|
472
|
+
- (CGFloat)bottom
|
473
|
+
{
|
474
|
+
return self.frame.size.height + self.frame.origin.y;
|
475
|
+
}
|
476
|
+
|
477
|
+
- (void)setBottom:(CGFloat)bottom
|
478
|
+
{
|
479
|
+
CGRect frame = self.frame;
|
480
|
+
frame.origin.y = bottom - frame.size.height;
|
481
|
+
self.frame = frame;
|
482
|
+
}
|
483
|
+
|
484
|
+
- (CGFloat)right
|
485
|
+
{
|
486
|
+
return self.frame.size.width + self.frame.origin.x;
|
487
|
+
}
|
488
|
+
|
489
|
+
- (void)setRight:(CGFloat)right
|
490
|
+
{
|
491
|
+
CGRect frame = self.frame;
|
492
|
+
frame.origin.y = right - frame.size.width;
|
493
|
+
self.frame = frame;
|
494
|
+
}
|
495
|
+
|
496
|
+
- (CGFloat)x
|
497
|
+
{
|
498
|
+
return self.frame.origin.x;
|
499
|
+
}
|
500
|
+
|
501
|
+
- (void)setX:(CGFloat)value
|
502
|
+
{
|
503
|
+
CGRect frame = self.frame;
|
504
|
+
frame.origin.x = value;
|
505
|
+
self.frame = frame;
|
506
|
+
}
|
507
|
+
|
508
|
+
- (CGFloat)y
|
509
|
+
{
|
510
|
+
return self.frame.origin.y;
|
511
|
+
}
|
512
|
+
|
513
|
+
- (void)setY:(CGFloat)value
|
514
|
+
{
|
515
|
+
CGRect frame = self.frame;
|
516
|
+
frame.origin.y = value;
|
517
|
+
self.frame = frame;
|
518
|
+
}
|
519
|
+
|
520
|
+
- (CGFloat)w
|
521
|
+
{
|
522
|
+
return self.frame.size.width;
|
523
|
+
}
|
524
|
+
|
525
|
+
- (void)setW:(CGFloat)width
|
526
|
+
{
|
527
|
+
CGRect frame = self.frame;
|
528
|
+
frame.size.width = width;
|
529
|
+
self.frame = frame;
|
530
|
+
}
|
531
|
+
|
532
|
+
- (CGFloat)h
|
533
|
+
{
|
534
|
+
return self.frame.size.height;
|
535
|
+
}
|
536
|
+
|
537
|
+
- (void)setH:(CGFloat)height
|
538
|
+
{
|
539
|
+
CGRect frame = self.frame;
|
540
|
+
frame.size.height = height;
|
541
|
+
self.frame = frame;
|
542
|
+
}
|
543
|
+
|
544
|
+
- (BOOL)visible
|
545
|
+
{
|
546
|
+
return self.hidden ? NO : YES;
|
547
|
+
}
|
548
|
+
|
549
|
+
- (void)setVisible:(BOOL)flag
|
550
|
+
{
|
551
|
+
self.hidden = flag ? NO : YES;
|
552
|
+
}
|
553
|
+
|
554
|
+
@end
|
555
|
+
|
556
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
//
|
2
|
+
// ______ ______ ______
|
3
|
+
// /\ __ \ /\ ___\ /\ ___\
|
4
|
+
// \ \ __< \ \ __\_ \ \ __\_
|
5
|
+
// \ \_____\ \ \_____\ \ \_____\
|
6
|
+
// \/_____/ \/_____/ \/_____/
|
7
|
+
//
|
8
|
+
// Copyright (c) 2012 BEE creators
|
9
|
+
// http://www.whatsbug.com
|
10
|
+
//
|
11
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
12
|
+
// copy of this software and associated documentation files (the "Software"),
|
13
|
+
// to deal in the Software without restriction, including without limitation
|
14
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
15
|
+
// and/or sell copies of the Software, and to permit persons to whom the
|
16
|
+
// Software is furnished to do so, subject to the following conditions:
|
17
|
+
//
|
18
|
+
// The above copyright notice and this permission notice shall be included in
|
19
|
+
// all copies or substantial portions of the Software.
|
20
|
+
//
|
21
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
27
|
+
// IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
//
|
30
|
+
// UIView+BeeUISignal.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
|
38
|
+
#pragma mark -
|
39
|
+
|
40
|
+
@interface UIView(BeeUISignal)
|
41
|
+
|
42
|
+
+ (NSString *)SIGNAL;
|
43
|
+
+ (NSString *)SIGNAL_TYPE;
|
44
|
+
|
45
|
+
- (void)handleUISignal:(BeeUISignal *)signal;
|
46
|
+
|
47
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name;
|
48
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object;
|
49
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object from:(id)source;
|
50
|
+
|
51
|
+
@end
|
52
|
+
|
53
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,104 @@
|
|
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_UISignal.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
#import "Bee_Log.h"
|
38
|
+
#import "UIView+BeeUISignal.h"
|
39
|
+
#import "UIView+BeeExtension.h"
|
40
|
+
|
41
|
+
#import <objc/runtime.h>
|
42
|
+
|
43
|
+
#pragma mark -
|
44
|
+
|
45
|
+
@implementation UIView(BeeUISignal)
|
46
|
+
|
47
|
+
+ (NSString *)SIGNAL
|
48
|
+
{
|
49
|
+
return [self SIGNAL_TYPE];
|
50
|
+
}
|
51
|
+
|
52
|
+
+ (NSString *)SIGNAL_TYPE
|
53
|
+
{
|
54
|
+
return [NSString stringWithFormat:@"signal.%@.", [self description]];
|
55
|
+
}
|
56
|
+
|
57
|
+
- (void)handleUISignal:(BeeUISignal *)signal
|
58
|
+
{
|
59
|
+
if ( self.superview )
|
60
|
+
{
|
61
|
+
[signal forward:self.superview];
|
62
|
+
}
|
63
|
+
else
|
64
|
+
{
|
65
|
+
signal.reach = YES;
|
66
|
+
|
67
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
68
|
+
CC( @"[%@] > %@", signal.name, signal.callPath );
|
69
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name
|
74
|
+
{
|
75
|
+
return [self sendUISignal:name withObject:nil from:self];
|
76
|
+
}
|
77
|
+
|
78
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object
|
79
|
+
{
|
80
|
+
return [self sendUISignal:name withObject:object from:self];
|
81
|
+
}
|
82
|
+
|
83
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object from:(id)source
|
84
|
+
{
|
85
|
+
BeeUISignal * signal = [[[BeeUISignal alloc] init] autorelease];
|
86
|
+
if ( signal )
|
87
|
+
{
|
88
|
+
NSString * selName = self.tagString.lowercaseString;
|
89
|
+
selName = [selName stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
|
90
|
+
// selName = [selName stringByReplacingOccurrencesOfString:@":" withString:@"_"];
|
91
|
+
|
92
|
+
signal.preSelector = selName; // v0.3.0 new feature, signal binding
|
93
|
+
signal.source = source ? source : self;
|
94
|
+
signal.target = self;
|
95
|
+
signal.name = name;
|
96
|
+
signal.object = object;
|
97
|
+
[signal send];
|
98
|
+
}
|
99
|
+
return signal;
|
100
|
+
}
|
101
|
+
|
102
|
+
@end
|
103
|
+
|
104
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|