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
data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.m
ADDED
@@ -0,0 +1,92 @@
|
|
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
|
+
// UIViewController+BeeUISignal.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+BeeExtension.h"
|
39
|
+
#import "UIViewController+BeeUISignal.h"
|
40
|
+
|
41
|
+
#import <objc/runtime.h>
|
42
|
+
|
43
|
+
#pragma mark -
|
44
|
+
|
45
|
+
@implementation UIViewController(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
|
+
signal.reach = YES;
|
60
|
+
|
61
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
62
|
+
CC( @"[%@] > %@", signal.name, signal.callPath );
|
63
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
64
|
+
}
|
65
|
+
|
66
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name
|
67
|
+
{
|
68
|
+
return [self sendUISignal:name withObject:nil from:self];
|
69
|
+
}
|
70
|
+
|
71
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object
|
72
|
+
{
|
73
|
+
return [self sendUISignal:name withObject:object from:self];
|
74
|
+
}
|
75
|
+
|
76
|
+
- (BeeUISignal *)sendUISignal:(NSString *)name withObject:(NSObject *)object from:(id)source
|
77
|
+
{
|
78
|
+
BeeUISignal * signal = [[[BeeUISignal alloc] init] autorelease];
|
79
|
+
if ( signal )
|
80
|
+
{
|
81
|
+
signal.source = source ? source : self;
|
82
|
+
signal.target = self;
|
83
|
+
signal.name = name;
|
84
|
+
signal.object = object;
|
85
|
+
[signal send];
|
86
|
+
}
|
87
|
+
return signal;
|
88
|
+
}
|
89
|
+
|
90
|
+
@end
|
91
|
+
|
92
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,72 @@
|
|
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_UIBoard.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
#import "Bee_UILabel.h"
|
38
|
+
#import "Bee_UIStack.h"
|
39
|
+
|
40
|
+
#import "NSObject+BeeProperty.h"
|
41
|
+
|
42
|
+
#pragma mark -
|
43
|
+
|
44
|
+
@interface UINavigationBar(UINavigationBar)
|
45
|
+
|
46
|
+
AS_INT( BARBUTTON_LEFT ) // 左按钮
|
47
|
+
AS_INT( BARBUTTON_RIGHT ) // 右按钮
|
48
|
+
|
49
|
+
AS_SIGNAL( BACK_BUTTON_TOUCHED ) // NavigationBar左按钮被点击
|
50
|
+
AS_SIGNAL( DONE_BUTTON_TOUCHED ) // NavigationBar右按钮被点击
|
51
|
+
|
52
|
+
#define BARBUTTON_LEFT_TOUCHED BACK_BUTTON_TOUCHED
|
53
|
+
#define BARBUTTON_RIGHT_TOUCHED DONE_BUTTON_TOUCHED
|
54
|
+
|
55
|
+
@end
|
56
|
+
|
57
|
+
#pragma mark -
|
58
|
+
|
59
|
+
@interface UIViewController(UINavigationBar)
|
60
|
+
|
61
|
+
- (void)showNavigationBarAnimated:(BOOL)animated;
|
62
|
+
- (void)hideNavigationBarAnimated:(BOOL)animated;
|
63
|
+
|
64
|
+
- (void)showBarButton:(NSInteger)position title:(NSString *)name;
|
65
|
+
- (void)showBarButton:(NSInteger)position image:(UIImage *)image;
|
66
|
+
- (void)showBarButton:(NSInteger)position system:(UIBarButtonSystemItem)index;
|
67
|
+
- (void)showBarButton:(NSInteger)position custom:(UIView *)view;
|
68
|
+
- (void)hideBarButton:(NSInteger)position;
|
69
|
+
|
70
|
+
@end
|
71
|
+
|
72
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,175 @@
|
|
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_UIBoard.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_UISignal.h"
|
38
|
+
#import "UIViewController+UINavigationBar.h"
|
39
|
+
#import "UIViewController+BeeUISignal.h"
|
40
|
+
|
41
|
+
#pragma mark -
|
42
|
+
|
43
|
+
@implementation UINavigationBar(UINavigationBar)
|
44
|
+
|
45
|
+
DEF_SIGNAL( BACK_BUTTON_TOUCHED )
|
46
|
+
DEF_SIGNAL( DONE_BUTTON_TOUCHED )
|
47
|
+
|
48
|
+
DEF_INT( BARBUTTON_LEFT, 0 )
|
49
|
+
DEF_INT( BARBUTTON_RIGHT, 1 )
|
50
|
+
|
51
|
+
@end
|
52
|
+
|
53
|
+
#pragma mark -
|
54
|
+
|
55
|
+
@interface UIViewController(UINavigationBarPrivate)
|
56
|
+
- (void)didLeftBarButtonTouched;
|
57
|
+
- (void)didRightBarButtonTouched;
|
58
|
+
@end
|
59
|
+
|
60
|
+
#pragma mark -
|
61
|
+
|
62
|
+
@implementation UIViewController(UINavigationBar)
|
63
|
+
|
64
|
+
- (void)showNavigationBarAnimated:(BOOL)animated
|
65
|
+
{
|
66
|
+
[self.navigationController setNavigationBarHidden:NO animated:animated];
|
67
|
+
}
|
68
|
+
|
69
|
+
- (void)hideNavigationBarAnimated:(BOOL)animated
|
70
|
+
{
|
71
|
+
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
72
|
+
}
|
73
|
+
|
74
|
+
- (void)didLeftBarButtonTouched
|
75
|
+
{
|
76
|
+
[self sendUISignal:UINavigationBar.BACK_BUTTON_TOUCHED];
|
77
|
+
}
|
78
|
+
|
79
|
+
- (void)didRightBarButtonTouched
|
80
|
+
{
|
81
|
+
[self sendUISignal:UINavigationBar.DONE_BUTTON_TOUCHED];
|
82
|
+
}
|
83
|
+
|
84
|
+
- (void)showBarButton:(NSInteger)position title:(NSString *)name
|
85
|
+
{
|
86
|
+
if ( UINavigationBar.BARBUTTON_LEFT == position )
|
87
|
+
{
|
88
|
+
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:name
|
89
|
+
style:UIBarButtonItemStylePlain
|
90
|
+
target:self
|
91
|
+
action:@selector(didLeftBarButtonTouched)] autorelease];
|
92
|
+
}
|
93
|
+
else
|
94
|
+
{
|
95
|
+
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:name
|
96
|
+
style:UIBarButtonItemStylePlain
|
97
|
+
target:self
|
98
|
+
action:@selector(didRightBarButtonTouched)] autorelease];
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
- (void)showBarButton:(NSInteger)position image:(UIImage *)image
|
103
|
+
{
|
104
|
+
CGRect buttonFrame = CGRectMake(0, 0, image.size.width + 10.0f, self.navigationController.navigationBar.frame.size.height);
|
105
|
+
|
106
|
+
if ( buttonFrame.size.width <= 24.0f )
|
107
|
+
{
|
108
|
+
buttonFrame.size.width = 24.0f;
|
109
|
+
}
|
110
|
+
|
111
|
+
if ( buttonFrame.size.height <= 24.0f )
|
112
|
+
{
|
113
|
+
buttonFrame.size.height = 24.0f;
|
114
|
+
}
|
115
|
+
|
116
|
+
UIButton * button = [[[UIButton alloc] initWithFrame:buttonFrame] autorelease];
|
117
|
+
button.contentMode = UIViewContentModeScaleAspectFit;
|
118
|
+
button.backgroundColor = [UIColor clearColor];
|
119
|
+
[button setImage:image forState:UIControlStateNormal];
|
120
|
+
|
121
|
+
if ( UINavigationBar.BARBUTTON_LEFT == position )
|
122
|
+
{
|
123
|
+
[button addTarget:self action:@selector(didLeftBarButtonTouched) forControlEvents:UIControlEventTouchUpInside];
|
124
|
+
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:button] autorelease];
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{
|
128
|
+
[button addTarget:self action:@selector(didRightBarButtonTouched) forControlEvents:UIControlEventTouchUpInside];
|
129
|
+
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:button] autorelease];
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
- (void)showBarButton:(NSInteger)position system:(UIBarButtonSystemItem)index
|
134
|
+
{
|
135
|
+
if ( UINavigationBar.BARBUTTON_LEFT == position )
|
136
|
+
{
|
137
|
+
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:index
|
138
|
+
target:self
|
139
|
+
action:@selector(didLeftBarButtonTouched)] autorelease];
|
140
|
+
}
|
141
|
+
else
|
142
|
+
{
|
143
|
+
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:index
|
144
|
+
target:self
|
145
|
+
action:@selector(didRightBarButtonTouched)] autorelease];
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
- (void)showBarButton:(NSInteger)position custom:(UIView *)view
|
150
|
+
{
|
151
|
+
if ( UINavigationBar.BARBUTTON_LEFT == position )
|
152
|
+
{
|
153
|
+
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:view] autorelease];
|
154
|
+
}
|
155
|
+
else
|
156
|
+
{
|
157
|
+
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:view] autorelease];
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
- (void)hideBarButton:(NSInteger)position
|
162
|
+
{
|
163
|
+
if ( UINavigationBar.BARBUTTON_LEFT == position )
|
164
|
+
{
|
165
|
+
self.navigationItem.leftBarButtonItem = nil;
|
166
|
+
}
|
167
|
+
else
|
168
|
+
{
|
169
|
+
self.navigationItem.rightBarButtonItem = nil;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
@end
|
174
|
+
|
175
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,59 @@
|
|
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_UICollection.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "NSObject+BeeProperty.h"
|
37
|
+
|
38
|
+
#pragma mark -
|
39
|
+
|
40
|
+
@interface BeeUICollection : NSObject
|
41
|
+
{
|
42
|
+
BOOL _retained;
|
43
|
+
id _object;
|
44
|
+
}
|
45
|
+
|
46
|
+
@property (nonatomic, assign) BOOL retained;
|
47
|
+
@property (nonatomic, assign) id object;
|
48
|
+
@property (nonatomic, retain) id retainedObject;
|
49
|
+
@property (nonatomic, readonly) NSUInteger count;
|
50
|
+
@property (nonatomic, readonly) UIView * view;
|
51
|
+
@property (nonatomic, readonly) NSArray * views;
|
52
|
+
@property (nonatomic, readonly) UIViewController * viewController;
|
53
|
+
@property (nonatomic, readonly) NSArray * viewControllers;
|
54
|
+
|
55
|
+
- (void)copyFrom:(BeeUICollection *)other;
|
56
|
+
|
57
|
+
@end
|
58
|
+
|
59
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,249 @@
|
|
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_UICollection.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UICollection.h"
|
37
|
+
#import "Bee_Log.h"
|
38
|
+
#import "UIView+BeeExtension.h"
|
39
|
+
#import "NSArray+BeeExtension.h"
|
40
|
+
|
41
|
+
#import "JSONKit.h"
|
42
|
+
#import <objc/runtime.h>
|
43
|
+
|
44
|
+
#pragma mark -
|
45
|
+
|
46
|
+
@implementation BeeUICollection
|
47
|
+
|
48
|
+
@synthesize retained = _retained;
|
49
|
+
@dynamic object;
|
50
|
+
@dynamic retainedObject;
|
51
|
+
@dynamic count;
|
52
|
+
@dynamic view;
|
53
|
+
@dynamic views;
|
54
|
+
@dynamic viewController;
|
55
|
+
@dynamic viewControllers;
|
56
|
+
|
57
|
+
- (id)init
|
58
|
+
{
|
59
|
+
self = [super init];
|
60
|
+
if ( self )
|
61
|
+
{
|
62
|
+
_retained = NO;
|
63
|
+
_object = nil;
|
64
|
+
}
|
65
|
+
return self;
|
66
|
+
}
|
67
|
+
|
68
|
+
- (void)dealloc
|
69
|
+
{
|
70
|
+
if ( _retained )
|
71
|
+
{
|
72
|
+
[_object release];
|
73
|
+
}
|
74
|
+
|
75
|
+
[super dealloc];
|
76
|
+
}
|
77
|
+
|
78
|
+
- (id)object
|
79
|
+
{
|
80
|
+
return _object;
|
81
|
+
}
|
82
|
+
|
83
|
+
- (void)setObject:(id)obj
|
84
|
+
{
|
85
|
+
if ( obj == _object )
|
86
|
+
return;
|
87
|
+
|
88
|
+
if ( _retained )
|
89
|
+
{
|
90
|
+
[_object release];
|
91
|
+
}
|
92
|
+
|
93
|
+
_object = obj;
|
94
|
+
_retained = NO;
|
95
|
+
}
|
96
|
+
|
97
|
+
- (id)retainedObject
|
98
|
+
{
|
99
|
+
return _object;
|
100
|
+
}
|
101
|
+
|
102
|
+
- (void)setRetainedObject:(id)obj
|
103
|
+
{
|
104
|
+
if ( obj == _object )
|
105
|
+
return;
|
106
|
+
|
107
|
+
if ( _retained )
|
108
|
+
{
|
109
|
+
[_object release];
|
110
|
+
}
|
111
|
+
|
112
|
+
_object = [obj retain];
|
113
|
+
_retained = YES;
|
114
|
+
}
|
115
|
+
|
116
|
+
- (NSUInteger)count
|
117
|
+
{
|
118
|
+
if ( nil == self.object )
|
119
|
+
return 0;
|
120
|
+
|
121
|
+
if ( [self.object isKindOfClass:[NSArray class]] )
|
122
|
+
{
|
123
|
+
return ((NSArray *)self.object).count;
|
124
|
+
}
|
125
|
+
|
126
|
+
return 1;
|
127
|
+
}
|
128
|
+
|
129
|
+
- (void)copyFrom:(BeeUICollection *)other
|
130
|
+
{
|
131
|
+
if ( other.retained )
|
132
|
+
{
|
133
|
+
_object = [other.object retain];
|
134
|
+
}
|
135
|
+
else
|
136
|
+
{
|
137
|
+
_object = other.object;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
- (UIView *)view
|
142
|
+
{
|
143
|
+
if ( nil == self.object )
|
144
|
+
return nil;
|
145
|
+
|
146
|
+
if ( [self.object isKindOfClass:[UIView class]] )
|
147
|
+
{
|
148
|
+
return (UIView *)self.object;
|
149
|
+
}
|
150
|
+
else if ( [self.object isKindOfClass:[UIViewController class]] )
|
151
|
+
{
|
152
|
+
return ((UIViewController *)self.object).view;
|
153
|
+
}
|
154
|
+
else if ( [self.object isKindOfClass:[NSArray class]] )
|
155
|
+
{
|
156
|
+
for ( NSObject * obj in (NSArray *)self.object )
|
157
|
+
{
|
158
|
+
if ( [obj isKindOfClass:[UIView class]] )
|
159
|
+
{
|
160
|
+
return (UIView *)obj;
|
161
|
+
}
|
162
|
+
else if ( [obj isKindOfClass:[UIViewController class]] )
|
163
|
+
{
|
164
|
+
return ((UIViewController *)obj).view;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
return nil;
|
170
|
+
}
|
171
|
+
|
172
|
+
- (NSArray *)views
|
173
|
+
{
|
174
|
+
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
|
175
|
+
|
176
|
+
if ( [self.object isKindOfClass:[UIView class]] )
|
177
|
+
{
|
178
|
+
[array addObject:self.object];
|
179
|
+
}
|
180
|
+
else if ( [self.object isKindOfClass:[UIViewController class]] )
|
181
|
+
{
|
182
|
+
[array addObject:((UIViewController *)self.object).view];
|
183
|
+
}
|
184
|
+
else if ( [self.object isKindOfClass:[NSArray class]] )
|
185
|
+
{
|
186
|
+
for ( NSObject * obj in (NSArray *)self.object )
|
187
|
+
{
|
188
|
+
if ( [obj isKindOfClass:[UIView class]] )
|
189
|
+
{
|
190
|
+
[array addObject:obj];
|
191
|
+
}
|
192
|
+
else if ( [obj isKindOfClass:[UIViewController class]] )
|
193
|
+
{
|
194
|
+
[array addObject:((UIViewController *)obj).view];
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
return array;
|
200
|
+
}
|
201
|
+
|
202
|
+
- (UIViewController *)viewController
|
203
|
+
{
|
204
|
+
if ( nil == self.object )
|
205
|
+
return nil;
|
206
|
+
|
207
|
+
if ( [self.object isKindOfClass:[UIViewController class]] )
|
208
|
+
{
|
209
|
+
return (UIViewController *)self.object;
|
210
|
+
}
|
211
|
+
else if ( [self.object isKindOfClass:[NSArray class]] )
|
212
|
+
{
|
213
|
+
for ( NSObject * obj in (NSArray *)self.object )
|
214
|
+
{
|
215
|
+
if ( [obj isKindOfClass:[UIViewController class]] )
|
216
|
+
{
|
217
|
+
return (UIViewController *)obj;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
return nil;
|
223
|
+
}
|
224
|
+
|
225
|
+
- (NSArray *)viewControllers
|
226
|
+
{
|
227
|
+
NSMutableArray * array = [[[NSMutableArray alloc] init] autorelease];
|
228
|
+
|
229
|
+
if ( [self.object isKindOfClass:[UIViewController class]] )
|
230
|
+
{
|
231
|
+
[array addObject:((UIViewController *)self.object).view];
|
232
|
+
}
|
233
|
+
else if ( [self.object isKindOfClass:[NSArray array]] )
|
234
|
+
{
|
235
|
+
for ( NSObject * obj in (NSArray *)self.object )
|
236
|
+
{
|
237
|
+
if ( [obj isKindOfClass:[UIViewController class]] )
|
238
|
+
{
|
239
|
+
[array addObject:((UIViewController *)self.object).view];
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
|
244
|
+
return array;
|
245
|
+
}
|
246
|
+
|
247
|
+
@end
|
248
|
+
|
249
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|