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,1219 @@
|
|
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_UIBoard.h"
|
37
|
+
#import "Bee_UIStack.h"
|
38
|
+
#import "Bee_Runtime.h"
|
39
|
+
#import "Bee_SystemInfo.h"
|
40
|
+
#import "Bee_Log.h"
|
41
|
+
|
42
|
+
#import "Bee_Network.h"
|
43
|
+
#import "Bee_Controller.h"
|
44
|
+
#import "Bee_SystemInfo.h"
|
45
|
+
|
46
|
+
#import "NSObject+BeeMessage.h"
|
47
|
+
#import "NSObject+BeeRequest.h"
|
48
|
+
|
49
|
+
#import "UIView+BeeExtension.h"
|
50
|
+
#import "UIFont+BeeExtension.h"
|
51
|
+
#import "NSObject+BeeNotification.h"
|
52
|
+
#import "NSObject+BeeTicker.h"
|
53
|
+
#import "NSArray+BeeExtension.h"
|
54
|
+
#import "UIViewController+BeeExtension.h"
|
55
|
+
#import "UIView+BeeUISignal.h"
|
56
|
+
#import "UIViewController+BeeUISignal.h"
|
57
|
+
|
58
|
+
#pragma mark -
|
59
|
+
|
60
|
+
#undef MODAL_ANIMATION_DURATION
|
61
|
+
#define MODAL_ANIMATION_DURATION (0.6f)
|
62
|
+
|
63
|
+
#undef UNUSED
|
64
|
+
#define UNUSED( __x ) (void)(__x)
|
65
|
+
|
66
|
+
#undef MAX_SIGNALS
|
67
|
+
#define MAX_SIGNALS (50)
|
68
|
+
|
69
|
+
//// thanks to @inonomori
|
70
|
+
//#undef ORIENTATIONMASK
|
71
|
+
//#define ORIENTATIONMASK( __x ) ( 1 << __x )
|
72
|
+
|
73
|
+
#pragma mark -
|
74
|
+
|
75
|
+
@interface BeeUIBoardView : UIView
|
76
|
+
{
|
77
|
+
BeeUIBoard * _owner;
|
78
|
+
}
|
79
|
+
|
80
|
+
@property (nonatomic, assign) BeeUIBoard * owner;
|
81
|
+
|
82
|
+
@end
|
83
|
+
|
84
|
+
#pragma mark -
|
85
|
+
|
86
|
+
@implementation UIView(BeeUIBoard)
|
87
|
+
|
88
|
+
- (BeeUIBoard *)board
|
89
|
+
{
|
90
|
+
UIView * topView = self;
|
91
|
+
|
92
|
+
while ( topView.superview )
|
93
|
+
{
|
94
|
+
topView = topView.superview;
|
95
|
+
|
96
|
+
if ( [topView isKindOfClass:[UIWindow class]] )
|
97
|
+
{
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
else if ( [topView isKindOfClass:[BeeUIBoardView class]] )
|
101
|
+
{
|
102
|
+
break;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
UIViewController * controller = [topView viewController];
|
107
|
+
|
108
|
+
if ( controller && [controller isKindOfClass:[BeeUIBoard class]] )
|
109
|
+
{
|
110
|
+
return (BeeUIBoard *)controller;
|
111
|
+
}
|
112
|
+
else
|
113
|
+
{
|
114
|
+
return nil;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
@end
|
119
|
+
|
120
|
+
#pragma mark -
|
121
|
+
|
122
|
+
@interface BeeUIBoard(Private)
|
123
|
+
|
124
|
+
- (void)createViews;
|
125
|
+
- (void)deleteViews;
|
126
|
+
- (void)loadDatas;
|
127
|
+
- (void)freeDatas;
|
128
|
+
- (void)enableUserInteraction;
|
129
|
+
- (void)disableUserInteraction;
|
130
|
+
|
131
|
+
- (void)changeStateDeactivated;
|
132
|
+
- (void)changeStateDeactivating;
|
133
|
+
- (void)changeStateActivated;
|
134
|
+
- (void)changeStateActivating;
|
135
|
+
|
136
|
+
- (void)didModalMaskTouched;
|
137
|
+
|
138
|
+
- (void)didAppearingAnimationDone;
|
139
|
+
- (void)didDisappearingAnimationDone;
|
140
|
+
|
141
|
+
- (void)bounce1ForAppearingAnimationStopped;
|
142
|
+
- (void)bounce2ForAppearingAnimationStopped;
|
143
|
+
|
144
|
+
- (void)resignFirstResponderWalkThrough:(UIView *)rootView;
|
145
|
+
- (void)becomeFirstResponderWalkThrough:(UIView *)rootView;
|
146
|
+
|
147
|
+
@end
|
148
|
+
|
149
|
+
#pragma mark -
|
150
|
+
|
151
|
+
@implementation BeeUIBoardView
|
152
|
+
|
153
|
+
@synthesize owner = _owner;
|
154
|
+
|
155
|
+
- (void)setFrame:(CGRect)rect
|
156
|
+
{
|
157
|
+
// if ( CGRectEqualToRect(rect, super.frame) )
|
158
|
+
// {
|
159
|
+
[super setFrame:rect];
|
160
|
+
|
161
|
+
if ( _owner )
|
162
|
+
{
|
163
|
+
[_owner sendUISignal:BeeUIBoard.LAYOUT_VIEWS];
|
164
|
+
}
|
165
|
+
// }
|
166
|
+
}
|
167
|
+
|
168
|
+
- (void)layoutSubviews
|
169
|
+
{
|
170
|
+
[super layoutSubviews];
|
171
|
+
|
172
|
+
if ( _owner )
|
173
|
+
{
|
174
|
+
[_owner sendUISignal:BeeUIBoard.LAYOUT_VIEWS];
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
- (void)dealloc
|
179
|
+
{
|
180
|
+
[super dealloc];
|
181
|
+
}
|
182
|
+
|
183
|
+
- (UIViewController *)viewController
|
184
|
+
{
|
185
|
+
return _owner ? _owner : [super viewController];
|
186
|
+
}
|
187
|
+
|
188
|
+
- (void)handleUISignal:(BeeUISignal *)signal
|
189
|
+
{
|
190
|
+
if ( _owner )
|
191
|
+
{
|
192
|
+
[signal forward:_owner];
|
193
|
+
}
|
194
|
+
else
|
195
|
+
{
|
196
|
+
[super handleUISignal:signal];
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
@end
|
201
|
+
|
202
|
+
#pragma mark -
|
203
|
+
|
204
|
+
@implementation BeeUIBoard
|
205
|
+
|
206
|
+
@synthesize containedPopover = _containedPopover;
|
207
|
+
@synthesize stackAnimationType = _stackAnimationType;
|
208
|
+
|
209
|
+
@synthesize lastSleep = _lastSleep;
|
210
|
+
@synthesize lastWeekup = _lastWeekup;
|
211
|
+
@synthesize parentBoard = _parentBoard;
|
212
|
+
|
213
|
+
@synthesize firstEnter = _firstEnter;
|
214
|
+
@synthesize presenting = _presenting;
|
215
|
+
@synthesize viewBuilt = _viewBuilt;
|
216
|
+
@synthesize dataLoaded = _dataLoaded;
|
217
|
+
@synthesize state = _state;
|
218
|
+
|
219
|
+
@synthesize createDate = _createDate;
|
220
|
+
|
221
|
+
@synthesize modalBoard = _modalBoard;
|
222
|
+
@synthesize modalMaskView = _modalMaskView;
|
223
|
+
@synthesize modalContentView = _modalContentView;
|
224
|
+
@synthesize modalAnimationType = _modalAnimationType;
|
225
|
+
|
226
|
+
@synthesize zoomed = _zoomed;
|
227
|
+
@synthesize zoomRect = _zoomRect;
|
228
|
+
@synthesize animationBlock = _animationBlock;
|
229
|
+
|
230
|
+
@synthesize deactivated;
|
231
|
+
@synthesize deactivating;
|
232
|
+
@synthesize activating;
|
233
|
+
@synthesize activated;
|
234
|
+
|
235
|
+
@dynamic sleepDuration;
|
236
|
+
@dynamic weekDuration;
|
237
|
+
@dynamic stack;
|
238
|
+
@dynamic previousBoard;
|
239
|
+
@dynamic nextBoard;
|
240
|
+
|
241
|
+
@synthesize allowedPortrait = _allowedPortrait;
|
242
|
+
@synthesize allowedLandscape = _allowedLandscape;
|
243
|
+
|
244
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
245
|
+
@synthesize createSeq = _createSeq;
|
246
|
+
@synthesize signalSeq = _signalSeq;
|
247
|
+
@synthesize signals = _signals;
|
248
|
+
@synthesize callstack = _callstack;
|
249
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
250
|
+
|
251
|
+
DEF_SIGNAL( CREATE_VIEWS ) // 创建视图
|
252
|
+
DEF_SIGNAL( DELETE_VIEWS ) // 释放视图
|
253
|
+
DEF_SIGNAL( LAYOUT_VIEWS ) // 布局视图
|
254
|
+
DEF_SIGNAL( LOAD_DATAS ) // 加载数据
|
255
|
+
DEF_SIGNAL( FREE_DATAS ) // 释放数据
|
256
|
+
DEF_SIGNAL( WILL_APPEAR ) // 将要显示
|
257
|
+
DEF_SIGNAL( DID_APPEAR ) // 已经显示
|
258
|
+
DEF_SIGNAL( WILL_DISAPPEAR ) // 将要隐藏
|
259
|
+
DEF_SIGNAL( DID_DISAPPEAR ) // 已经隐藏
|
260
|
+
DEF_SIGNAL( ORIENTATION_CHANGED ) // 方向变化
|
261
|
+
|
262
|
+
DEF_SIGNAL( ANIMATION_BEGIN ) // 动画开始
|
263
|
+
DEF_SIGNAL( ANIMATION_FINISH ) // 动画结束
|
264
|
+
|
265
|
+
DEF_SIGNAL( MODALVIEW_WILL_SHOW ) // ModalView将要显示
|
266
|
+
DEF_SIGNAL( MODALVIEW_DID_SHOWN ) // ModalView已经显示
|
267
|
+
DEF_SIGNAL( MODALVIEW_WILL_HIDE ) // ModalView将要隐藏
|
268
|
+
DEF_SIGNAL( MODALVIEW_DID_HIDDEN ) // ModalView已经隐藏
|
269
|
+
|
270
|
+
DEF_SIGNAL( POPOVER_WILL_PRESENT ) // Popover将要显示
|
271
|
+
DEF_SIGNAL( POPOVER_DID_PRESENT ) // Popover已经显示
|
272
|
+
DEF_SIGNAL( POPOVER_WILL_DISMISS ) // Popover将要隐藏
|
273
|
+
DEF_SIGNAL( POPOVER_DID_DISMISSED ) // Popover已经隐藏
|
274
|
+
|
275
|
+
DEF_INT( STATE_DEACTIVATED, 0 )
|
276
|
+
DEF_INT( STATE_DEACTIVATING, 1 )
|
277
|
+
DEF_INT( STATE_ACTIVATING, 2 )
|
278
|
+
DEF_INT( STATE_ACTIVATED, 3 )
|
279
|
+
|
280
|
+
DEF_INT( ANIMATION_TYPE_DEFAULT, 0 )
|
281
|
+
DEF_INT( ANIMATION_TYPE_ALPHA, 0 )
|
282
|
+
DEF_INT( ANIMATION_TYPE_BOUNCE, 1 )
|
283
|
+
|
284
|
+
DEF_INT( BARBUTTON_LEFT, UINavigationBar.BARBUTTON_LEFT )
|
285
|
+
DEF_INT( BARBUTTON_RIGHT, UINavigationBar.BARBUTTON_RIGHT )
|
286
|
+
|
287
|
+
static NSUInteger __createSeed = 0;
|
288
|
+
static NSMutableArray * __allBoards;
|
289
|
+
|
290
|
+
+ (NSArray *)allBoards
|
291
|
+
{
|
292
|
+
return __allBoards;
|
293
|
+
}
|
294
|
+
|
295
|
+
+ (BeeUIBoard *)board
|
296
|
+
{
|
297
|
+
return [[(BeeUIBoard *)[BeeRuntime allocByClass:[self class]] init] autorelease];
|
298
|
+
}
|
299
|
+
|
300
|
+
+ (BeeUIBoard *)boardWithNibName:(NSString *)nibNameOrNil
|
301
|
+
{
|
302
|
+
return [[[self alloc] initWithNibName:nibNameOrNil bundle:nil] autorelease];
|
303
|
+
}
|
304
|
+
|
305
|
+
- (id)init
|
306
|
+
{
|
307
|
+
self = [super init];
|
308
|
+
if ( self )
|
309
|
+
{
|
310
|
+
if ( nil == __allBoards )
|
311
|
+
{
|
312
|
+
__allBoards = [[NSMutableArray nonRetainingArray] retain];
|
313
|
+
}
|
314
|
+
|
315
|
+
[__allBoards insertObject:self atIndex:0];
|
316
|
+
|
317
|
+
_lastSleep = [NSDate timeIntervalSinceReferenceDate];
|
318
|
+
_lastWeekup = [NSDate timeIntervalSinceReferenceDate];
|
319
|
+
|
320
|
+
_zoomed = NO;
|
321
|
+
_zoomRect = CGRectZero;
|
322
|
+
|
323
|
+
_firstEnter = YES;
|
324
|
+
_presenting = NO;
|
325
|
+
_viewBuilt = NO;
|
326
|
+
_dataLoaded = NO;
|
327
|
+
_state = BeeUIBoard.STATE_DEACTIVATED;
|
328
|
+
|
329
|
+
_createDate = [[NSDate date] retain];
|
330
|
+
|
331
|
+
_modalAnimationType = BeeUIBoard.ANIMATION_TYPE_ALPHA;
|
332
|
+
|
333
|
+
_allowedPortrait = YES;
|
334
|
+
_allowedLandscape = NO;
|
335
|
+
|
336
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
337
|
+
_createSeq = __createSeed++;
|
338
|
+
_signalSeq = 0;
|
339
|
+
_signals = [[NSMutableArray alloc] init];
|
340
|
+
|
341
|
+
_callstack = [[NSMutableArray alloc] init];
|
342
|
+
[_callstack addObjectsFromArray:[BeeRuntime callstack:16]];
|
343
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
344
|
+
|
345
|
+
[self load];
|
346
|
+
}
|
347
|
+
return self;
|
348
|
+
}
|
349
|
+
|
350
|
+
- (void)load
|
351
|
+
{
|
352
|
+
}
|
353
|
+
|
354
|
+
- (void)unload
|
355
|
+
{
|
356
|
+
}
|
357
|
+
|
358
|
+
- (void)dealloc
|
359
|
+
{
|
360
|
+
[self unload];
|
361
|
+
|
362
|
+
[self cancelMessages];
|
363
|
+
[self cancelRequests];
|
364
|
+
|
365
|
+
[self unobserveTick];
|
366
|
+
[self unobserveAllNotifications];
|
367
|
+
|
368
|
+
[self freeDatas];
|
369
|
+
[self deleteViews];
|
370
|
+
|
371
|
+
self.animationBlock = nil;
|
372
|
+
|
373
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
374
|
+
[_signals removeAllObjects];
|
375
|
+
[_signals release];
|
376
|
+
|
377
|
+
[_callstack removeAllObjects];
|
378
|
+
[_callstack release];
|
379
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
380
|
+
|
381
|
+
[_createDate release];
|
382
|
+
|
383
|
+
if ( _modalBoard.viewBuilt )
|
384
|
+
{
|
385
|
+
[_modalBoard.view removeFromSuperview];
|
386
|
+
[_modalBoard release];
|
387
|
+
_modalBoard = nil;
|
388
|
+
}
|
389
|
+
|
390
|
+
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
391
|
+
|
392
|
+
[__allBoards removeObject:self];
|
393
|
+
|
394
|
+
[super dealloc];
|
395
|
+
}
|
396
|
+
|
397
|
+
- (void)changeStateDeactivated
|
398
|
+
{
|
399
|
+
if ( BeeUIBoard.STATE_DEACTIVATED != _state )
|
400
|
+
{
|
401
|
+
_state = BeeUIBoard.STATE_DEACTIVATED;
|
402
|
+
|
403
|
+
[self sendUISignal:BeeUIBoard.DID_DISAPPEAR];
|
404
|
+
}
|
405
|
+
}
|
406
|
+
|
407
|
+
- (void)changeStateDeactivating
|
408
|
+
{
|
409
|
+
if ( BeeUIBoard.STATE_DEACTIVATING != _state )
|
410
|
+
{
|
411
|
+
_state = BeeUIBoard.STATE_DEACTIVATING;
|
412
|
+
|
413
|
+
[self sendUISignal:BeeUIBoard.WILL_DISAPPEAR];
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
- (void)changeStateActivated
|
418
|
+
{
|
419
|
+
if ( BeeUIBoard.STATE_ACTIVATED != _state )
|
420
|
+
{
|
421
|
+
_state = BeeUIBoard.STATE_ACTIVATED;
|
422
|
+
|
423
|
+
[self sendUISignal:BeeUIBoard.DID_APPEAR];
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
- (void)changeStateActivating
|
428
|
+
{
|
429
|
+
if ( BeeUIBoard.STATE_ACTIVATING != _state )
|
430
|
+
{
|
431
|
+
_state = BeeUIBoard.STATE_ACTIVATING;
|
432
|
+
|
433
|
+
[self sendUISignal:BeeUIBoard.WILL_APPEAR];
|
434
|
+
}
|
435
|
+
}
|
436
|
+
|
437
|
+
// Called when the view is about to made visible. Default does nothing
|
438
|
+
- (void)viewWillAppear:(BOOL)animated
|
439
|
+
{
|
440
|
+
if ( NO == _viewBuilt )
|
441
|
+
return;
|
442
|
+
|
443
|
+
_presenting = YES;
|
444
|
+
|
445
|
+
[super viewWillAppear:animated];
|
446
|
+
|
447
|
+
[self createViews];
|
448
|
+
[self loadDatas];
|
449
|
+
|
450
|
+
[self disableUserInteraction];
|
451
|
+
[self changeStateActivating];
|
452
|
+
|
453
|
+
_lastWeekup = [NSDate timeIntervalSinceReferenceDate];
|
454
|
+
}
|
455
|
+
|
456
|
+
// Called when the view has been fully transitioned onto the screen. Default does nothing
|
457
|
+
- (void)viewDidAppear:(BOOL)animated
|
458
|
+
{
|
459
|
+
if ( NO == _viewBuilt )
|
460
|
+
return;
|
461
|
+
|
462
|
+
[super viewDidAppear:animated];
|
463
|
+
|
464
|
+
[self enableUserInteraction];
|
465
|
+
[self changeStateActivated];
|
466
|
+
|
467
|
+
_firstEnter = NO;
|
468
|
+
}
|
469
|
+
|
470
|
+
// Called when the view is dismissed, covered or otherwise hidden. Default does nothing
|
471
|
+
- (void)viewWillDisappear:(BOOL)animated
|
472
|
+
{
|
473
|
+
if ( NO == _viewBuilt )
|
474
|
+
return;
|
475
|
+
|
476
|
+
[super viewWillDisappear:animated];
|
477
|
+
|
478
|
+
[self disableUserInteraction];
|
479
|
+
[self changeStateDeactivating];
|
480
|
+
}
|
481
|
+
|
482
|
+
// Called after the view was dismissed, covered or otherwise hidden. Default does nothing
|
483
|
+
- (void)viewDidDisappear:(BOOL)animated
|
484
|
+
{
|
485
|
+
if ( NO == _viewBuilt )
|
486
|
+
return;
|
487
|
+
|
488
|
+
[super viewDidDisappear:animated];
|
489
|
+
|
490
|
+
_presenting = NO;
|
491
|
+
|
492
|
+
[self disableUserInteraction];
|
493
|
+
[self changeStateDeactivated];
|
494
|
+
|
495
|
+
_lastSleep = [NSDate timeIntervalSinceReferenceDate];
|
496
|
+
}
|
497
|
+
|
498
|
+
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
|
499
|
+
{
|
500
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
501
|
+
CC( @"[%@] presentModalViewController", [[self class] description] );
|
502
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
503
|
+
|
504
|
+
[super presentModalViewController:modalViewController animated:animated];
|
505
|
+
|
506
|
+
// [self viewWillDisappear:animated];
|
507
|
+
// [self viewDidDisappear:animated];
|
508
|
+
}
|
509
|
+
|
510
|
+
- (void)dismissModalViewControllerAnimated:(BOOL)animated
|
511
|
+
{
|
512
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
513
|
+
CC( @"[%@] dismissModalViewControllerAnimated", [[self class] description] );
|
514
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
515
|
+
|
516
|
+
[super dismissModalViewControllerAnimated:animated];
|
517
|
+
|
518
|
+
// [self viewWillAppear:animated];
|
519
|
+
// [self viewDidAppear:animated];
|
520
|
+
}
|
521
|
+
|
522
|
+
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
523
|
+
- (void)loadView
|
524
|
+
{
|
525
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
526
|
+
CC( @"[%@] loadView", [[self class] description] );
|
527
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
528
|
+
|
529
|
+
if ( self.nibName )
|
530
|
+
{
|
531
|
+
[super loadView];
|
532
|
+
return;
|
533
|
+
}
|
534
|
+
|
535
|
+
CGRect boardViewBound = [UIScreen mainScreen].bounds;
|
536
|
+
BeeUIBoardView * boardView = [[BeeUIBoardView alloc] initWithFrame:boardViewBound];
|
537
|
+
boardView.owner = self;
|
538
|
+
|
539
|
+
self.view = boardView;
|
540
|
+
self.view.userInteractionEnabled = NO;
|
541
|
+
self.view.backgroundColor = [UIColor clearColor];
|
542
|
+
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
543
|
+
[boardView release];
|
544
|
+
}
|
545
|
+
|
546
|
+
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
547
|
+
- (void)viewDidLoad
|
548
|
+
{
|
549
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
550
|
+
CC( @"[%@] viewDidLoad", [[self class] description] );
|
551
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
552
|
+
|
553
|
+
[super viewDidLoad];
|
554
|
+
|
555
|
+
[self createViews];
|
556
|
+
[self loadDatas];
|
557
|
+
}
|
558
|
+
|
559
|
+
// Override to allow orientations other than the default portrait orientation.
|
560
|
+
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
561
|
+
{
|
562
|
+
if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown )
|
563
|
+
{
|
564
|
+
return _allowedPortrait ? YES : NO;
|
565
|
+
}
|
566
|
+
else if ( interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight )
|
567
|
+
{
|
568
|
+
return _allowedLandscape ? YES : NO;
|
569
|
+
}
|
570
|
+
|
571
|
+
return NO;
|
572
|
+
}
|
573
|
+
|
574
|
+
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
|
575
|
+
duration:(NSTimeInterval)duration
|
576
|
+
{
|
577
|
+
if ( _viewBuilt )
|
578
|
+
{
|
579
|
+
[self sendUISignal:BeeUIBoard.LAYOUT_VIEWS];
|
580
|
+
[self sendUISignal:BeeUIBoard.ORIENTATION_CHANGED];
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
585
|
+
{
|
586
|
+
if ( _viewBuilt )
|
587
|
+
{
|
588
|
+
[self sendUISignal:BeeUIBoard.LAYOUT_VIEWS];
|
589
|
+
[self sendUISignal:BeeUIBoard.ORIENTATION_CHANGED];
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
593
|
+
#if defined(__IPHONE_6_0)
|
594
|
+
|
595
|
+
-(NSUInteger)supportedInterfaceOrientations
|
596
|
+
{
|
597
|
+
NSUInteger orientation = 0;
|
598
|
+
|
599
|
+
if ( _allowedPortrait )
|
600
|
+
{
|
601
|
+
orientation |= UIInterfaceOrientationMaskPortrait;
|
602
|
+
}
|
603
|
+
|
604
|
+
if ( _allowedLandscape )
|
605
|
+
{
|
606
|
+
orientation |= UIInterfaceOrientationMaskLandscape;
|
607
|
+
}
|
608
|
+
|
609
|
+
return orientation;
|
610
|
+
}
|
611
|
+
|
612
|
+
- (BOOL)shouldAutorotate
|
613
|
+
{
|
614
|
+
if ( _allowedLandscape )
|
615
|
+
{
|
616
|
+
return YES;
|
617
|
+
}
|
618
|
+
|
619
|
+
if ( _allowedPortrait )
|
620
|
+
{
|
621
|
+
return YES;
|
622
|
+
}
|
623
|
+
|
624
|
+
return NO;
|
625
|
+
}
|
626
|
+
|
627
|
+
#endif // #if defined(__IPHONE_6_0)
|
628
|
+
|
629
|
+
- (void)didReceiveMemoryWarning
|
630
|
+
{
|
631
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
632
|
+
CC( @"%p(%@) didReceiveMemoryWarning", self, [[self class] description] );
|
633
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
634
|
+
|
635
|
+
// Releases the view if it doesn't have a superview.
|
636
|
+
if ( YES == _viewBuilt )
|
637
|
+
{
|
638
|
+
[super didReceiveMemoryWarning];
|
639
|
+
}
|
640
|
+
|
641
|
+
// Release any cached data, images, etc. that aren't in use.
|
642
|
+
// if ( NO == _presenting )
|
643
|
+
// {
|
644
|
+
// [self freeDatas];
|
645
|
+
// [self deleteViews];
|
646
|
+
//
|
647
|
+
// self.view = nil;
|
648
|
+
// }
|
649
|
+
// else
|
650
|
+
// {
|
651
|
+
// }
|
652
|
+
}
|
653
|
+
|
654
|
+
- (void)viewDidUnload
|
655
|
+
{
|
656
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
657
|
+
CC( @"[%@] viewDidUnload", [[self class] description] );
|
658
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
659
|
+
|
660
|
+
// Release any retained subviews of the main view.
|
661
|
+
// e.g. self.myOutlet = nil;
|
662
|
+
|
663
|
+
[self deleteViews];
|
664
|
+
[self freeDatas];
|
665
|
+
|
666
|
+
[super viewDidUnload];
|
667
|
+
}
|
668
|
+
|
669
|
+
- (NSTimeInterval)sleepDuration
|
670
|
+
{
|
671
|
+
if ( YES == _presenting )
|
672
|
+
{
|
673
|
+
return 0.0f;
|
674
|
+
}
|
675
|
+
else
|
676
|
+
{
|
677
|
+
return [NSDate timeIntervalSinceReferenceDate] - _lastSleep;
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
- (NSTimeInterval)weekupDuration
|
682
|
+
{
|
683
|
+
if ( YES == _presenting )
|
684
|
+
{
|
685
|
+
return [NSDate timeIntervalSinceReferenceDate] - _lastWeekup;
|
686
|
+
}
|
687
|
+
else
|
688
|
+
{
|
689
|
+
return 0.0f;
|
690
|
+
}
|
691
|
+
}
|
692
|
+
|
693
|
+
- (void)createViews
|
694
|
+
{
|
695
|
+
if ( NO == _viewBuilt )
|
696
|
+
{
|
697
|
+
[self sendUISignal:BeeUIBoard.CREATE_VIEWS];
|
698
|
+
[self sendUISignal:BeeUIBoard.LAYOUT_VIEWS];
|
699
|
+
|
700
|
+
_viewBuilt = YES;
|
701
|
+
}
|
702
|
+
}
|
703
|
+
|
704
|
+
- (void)deleteViews
|
705
|
+
{
|
706
|
+
if ( YES == _viewBuilt )
|
707
|
+
{
|
708
|
+
[self sendUISignal:BeeUIBoard.DELETE_VIEWS];
|
709
|
+
|
710
|
+
_viewBuilt = NO;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
|
714
|
+
- (void)loadDatas
|
715
|
+
{
|
716
|
+
if ( NO == _dataLoaded )
|
717
|
+
{
|
718
|
+
[self sendUISignal:BeeUIBoard.LOAD_DATAS];
|
719
|
+
|
720
|
+
_dataLoaded = YES;
|
721
|
+
}
|
722
|
+
}
|
723
|
+
|
724
|
+
- (void)reloadBoardDatas
|
725
|
+
{
|
726
|
+
[self freeDatas];
|
727
|
+
[self loadDatas];
|
728
|
+
}
|
729
|
+
|
730
|
+
- (void)freeDatas
|
731
|
+
{
|
732
|
+
if ( YES == _dataLoaded )
|
733
|
+
{
|
734
|
+
[self sendUISignal:BeeUIBoard.FREE_DATAS];
|
735
|
+
|
736
|
+
_dataLoaded = NO;
|
737
|
+
}
|
738
|
+
}
|
739
|
+
|
740
|
+
- (void)enableUserInteraction
|
741
|
+
{
|
742
|
+
if ( _viewBuilt )
|
743
|
+
{
|
744
|
+
self.view.userInteractionEnabled = YES;
|
745
|
+
}
|
746
|
+
}
|
747
|
+
|
748
|
+
- (void)disableUserInteraction
|
749
|
+
{
|
750
|
+
if ( _viewBuilt )
|
751
|
+
{
|
752
|
+
self.view.userInteractionEnabled = NO;
|
753
|
+
}
|
754
|
+
}
|
755
|
+
|
756
|
+
- (void)__enterBackground
|
757
|
+
{
|
758
|
+
[self freeDatas];
|
759
|
+
}
|
760
|
+
|
761
|
+
- (void)__enterForeground
|
762
|
+
{
|
763
|
+
[self loadDatas];
|
764
|
+
}
|
765
|
+
|
766
|
+
- (BeeUIStack *)stack
|
767
|
+
{
|
768
|
+
if ( self.navigationController )
|
769
|
+
{
|
770
|
+
return (BeeUIStack *)self.navigationController;
|
771
|
+
}
|
772
|
+
else
|
773
|
+
{
|
774
|
+
return nil;
|
775
|
+
}
|
776
|
+
}
|
777
|
+
|
778
|
+
- (BeeUIBoard *)previousBoard
|
779
|
+
{
|
780
|
+
BeeUIStack * stack = [self stack];
|
781
|
+
if ( stack )
|
782
|
+
{
|
783
|
+
NSArray * boards = stack.boards;
|
784
|
+
NSInteger index = [boards indexOfObject:self];
|
785
|
+
if ( index <= 0 )
|
786
|
+
return nil;
|
787
|
+
|
788
|
+
return [boards objectAtIndex:index - 1];
|
789
|
+
}
|
790
|
+
|
791
|
+
return nil;
|
792
|
+
}
|
793
|
+
|
794
|
+
- (BeeUIBoard *)nextBoard
|
795
|
+
{
|
796
|
+
BeeUIStack * stack = [self stack];
|
797
|
+
if ( stack )
|
798
|
+
{
|
799
|
+
NSArray * boards = stack.boards;
|
800
|
+
if ( [boards count] <= 1 )
|
801
|
+
return nil;
|
802
|
+
|
803
|
+
NSInteger index = [boards indexOfObject:self];
|
804
|
+
if ( index >= ([boards count] - 1) )
|
805
|
+
return nil;
|
806
|
+
|
807
|
+
return [boards objectAtIndex:index + 1];
|
808
|
+
}
|
809
|
+
|
810
|
+
return nil;
|
811
|
+
}
|
812
|
+
|
813
|
+
- (void)handleUISignal:(BeeUISignal *)signal
|
814
|
+
{
|
815
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
816
|
+
_signalSeq += 1;
|
817
|
+
|
818
|
+
[_signals addObject:signal];
|
819
|
+
[_signals keepTail:MAX_SIGNALS];
|
820
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
821
|
+
|
822
|
+
[super handleUISignal:signal];
|
823
|
+
|
824
|
+
if ( [signal isKindOf:BeeUIBoard.SIGNAL] )
|
825
|
+
{
|
826
|
+
if ( [signal is:BeeUIBoard.CREATE_VIEWS] )
|
827
|
+
{
|
828
|
+
self.view.backgroundColor = [UIColor clearColor];
|
829
|
+
// self.navigationController.navigationBarHidden = YES;
|
830
|
+
|
831
|
+
if ( _zoomed )
|
832
|
+
{
|
833
|
+
[self transformZoom:_zoomRect];
|
834
|
+
}
|
835
|
+
|
836
|
+
_modalMaskView = [[UIButton alloc] initWithFrame:self.viewBound];
|
837
|
+
_modalMaskView.hidden = YES;
|
838
|
+
_modalMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.1f];
|
839
|
+
[_modalMaskView addTarget:self action:@selector(didModalMaskTouched) forControlEvents:UIControlEventTouchUpInside];
|
840
|
+
[self.view addSubview:_modalMaskView];
|
841
|
+
}
|
842
|
+
else if ( [signal is:BeeUIBoard.DELETE_VIEWS] )
|
843
|
+
{
|
844
|
+
SAFE_RELEASE_SUBVIEW( _modalMaskView );
|
845
|
+
SAFE_RELEASE_SUBVIEW( _modalContentView );
|
846
|
+
}
|
847
|
+
else if ( [signal is:BeeUIBoard.LAYOUT_VIEWS] )
|
848
|
+
{
|
849
|
+
self.modalMaskView.frame = self.viewBound;
|
850
|
+
}
|
851
|
+
else if ( [signal is:BeeUIBoard.WILL_APPEAR] )
|
852
|
+
{
|
853
|
+
[self.view bringSubviewToFront:_modalMaskView];
|
854
|
+
[self.view bringSubviewToFront:_modalContentView];
|
855
|
+
}
|
856
|
+
else if ( [signal is:BeeUIBoard.DID_APPEAR] )
|
857
|
+
{
|
858
|
+
}
|
859
|
+
else if ( [signal is:BeeUIBoard.WILL_DISAPPEAR] )
|
860
|
+
{
|
861
|
+
}
|
862
|
+
else if ( [signal is:BeeUIBoard.DID_DISAPPEAR] )
|
863
|
+
{
|
864
|
+
}
|
865
|
+
}
|
866
|
+
|
867
|
+
if ( self.parentBoard && NO == [signal isKindOf:BeeUIBoard.SIGNAL] )
|
868
|
+
{
|
869
|
+
[signal forward:self.parentBoard.view];
|
870
|
+
}
|
871
|
+
}
|
872
|
+
|
873
|
+
- (void)didModalMaskTouched
|
874
|
+
{
|
875
|
+
[self dismissModalViewAnimated:YES];
|
876
|
+
}
|
877
|
+
|
878
|
+
- (void)presentModalView:(UIView *)view animated:(BOOL)animated
|
879
|
+
{
|
880
|
+
[self presentModalView:view animated:animated animationType:BeeUIBoard.ANIMATION_TYPE_BOUNCE];
|
881
|
+
}
|
882
|
+
|
883
|
+
- (void)presentModalView:(UIView *)view animated:(BOOL)animated animationType:(NSInteger)type
|
884
|
+
{
|
885
|
+
if ( self.modalContentView || view.superview == self.view )
|
886
|
+
return;
|
887
|
+
|
888
|
+
[self sendUISignal:BeeUIBoard.MODALVIEW_WILL_SHOW];
|
889
|
+
|
890
|
+
self.modalMaskView.hidden = NO;
|
891
|
+
self.modalMaskView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.0f];
|
892
|
+
|
893
|
+
self.modalContentView = view;
|
894
|
+
self.modalContentView.hidden = NO;
|
895
|
+
|
896
|
+
[self.view addSubview:self.modalContentView];
|
897
|
+
[self.view bringSubviewToFront:self.modalMaskView];
|
898
|
+
[self.view bringSubviewToFront:self.modalContentView];
|
899
|
+
|
900
|
+
_modalAnimationType = type;
|
901
|
+
|
902
|
+
if ( animated )
|
903
|
+
{
|
904
|
+
if ( BeeUIBoard.ANIMATION_TYPE_ALPHA == type )
|
905
|
+
{
|
906
|
+
self.modalMaskView.alpha = 0.0f;
|
907
|
+
self.modalContentView.alpha = 0.0f;
|
908
|
+
|
909
|
+
[UIView beginAnimations:nil context:nil];
|
910
|
+
[UIView setAnimationDuration:MODAL_ANIMATION_DURATION];
|
911
|
+
[UIView setAnimationDelegate:self];
|
912
|
+
[UIView setAnimationDidStopSelector:@selector(didAppearingAnimationDone)];
|
913
|
+
|
914
|
+
self.modalMaskView.alpha = 1.0f;
|
915
|
+
self.modalContentView.alpha = 1.0f;
|
916
|
+
|
917
|
+
[UIView commitAnimations];
|
918
|
+
}
|
919
|
+
else if ( BeeUIBoard.ANIMATION_TYPE_BOUNCE == type )
|
920
|
+
{
|
921
|
+
self.modalMaskView.alpha = 0.0f;
|
922
|
+
self.modalContentView.alpha = 0.0f;
|
923
|
+
self.modalContentView.transform = CGAffineTransformScale( CGAffineTransformIdentity, 0.001, 0.001 );
|
924
|
+
|
925
|
+
[UIView beginAnimations:nil context:nil];
|
926
|
+
[UIView setAnimationDuration:(MODAL_ANIMATION_DURATION / 4.0f)];
|
927
|
+
[UIView setAnimationDelegate:self];
|
928
|
+
[UIView setAnimationDidStopSelector:@selector(bounce1ForAppearingAnimationStopped)];
|
929
|
+
|
930
|
+
self.modalContentView.transform = CGAffineTransformScale( CGAffineTransformIdentity, 1.05, 1.05 );
|
931
|
+
self.modalMaskView.alpha = 1.0f;
|
932
|
+
self.modalContentView.alpha = 1.0f;
|
933
|
+
|
934
|
+
[UIView commitAnimations];
|
935
|
+
}
|
936
|
+
}
|
937
|
+
else
|
938
|
+
{
|
939
|
+
self.modalMaskView.alpha = 1.0f;
|
940
|
+
self.modalContentView.alpha = 1.0f;
|
941
|
+
|
942
|
+
[self didAppearingAnimationDone];
|
943
|
+
}
|
944
|
+
}
|
945
|
+
|
946
|
+
- (void)bounce1ForAppearingAnimationStopped
|
947
|
+
{
|
948
|
+
[UIView beginAnimations:nil context:nil];
|
949
|
+
[UIView setAnimationDuration:(MODAL_ANIMATION_DURATION / 4.0f)];
|
950
|
+
[UIView setAnimationDelegate:self];
|
951
|
+
[UIView setAnimationDidStopSelector:@selector(bounce2ForAppearingAnimationStopped)];
|
952
|
+
|
953
|
+
self.modalContentView.transform = CGAffineTransformScale( CGAffineTransformIdentity, 0.95, 0.95 );
|
954
|
+
|
955
|
+
[UIView commitAnimations];
|
956
|
+
}
|
957
|
+
|
958
|
+
- (void)bounce2ForAppearingAnimationStopped
|
959
|
+
{
|
960
|
+
[UIView beginAnimations:nil context:nil];
|
961
|
+
[UIView setAnimationDuration:(MODAL_ANIMATION_DURATION / 4.0f)];
|
962
|
+
[UIView setAnimationDelegate:self];
|
963
|
+
[UIView setAnimationDidStopSelector:@selector(didAppearingAnimationDone)];
|
964
|
+
|
965
|
+
self.modalContentView.transform = CGAffineTransformIdentity;
|
966
|
+
|
967
|
+
[UIView commitAnimations];
|
968
|
+
}
|
969
|
+
|
970
|
+
- (void)didAppearingAnimationDone
|
971
|
+
{
|
972
|
+
[self sendUISignal:BeeUIBoard.MODALVIEW_DID_SHOWN];
|
973
|
+
}
|
974
|
+
|
975
|
+
- (void)dismissModalViewAnimated:(BOOL)animated
|
976
|
+
{
|
977
|
+
if ( nil == self.modalContentView )
|
978
|
+
return;
|
979
|
+
|
980
|
+
self.modalMaskView.hidden = NO;
|
981
|
+
self.modalContentView.hidden = NO;
|
982
|
+
|
983
|
+
[self sendUISignal:BeeUIBoard.MODALVIEW_WILL_HIDE];
|
984
|
+
|
985
|
+
if ( animated )
|
986
|
+
{
|
987
|
+
if ( BeeUIBoard.ANIMATION_TYPE_ALPHA == _modalAnimationType )
|
988
|
+
{
|
989
|
+
[UIView beginAnimations:nil context:nil];
|
990
|
+
[UIView setAnimationDuration:MODAL_ANIMATION_DURATION];
|
991
|
+
[UIView setAnimationDelegate:self];
|
992
|
+
[UIView setAnimationDidStopSelector:@selector(didDisappearingAnimationDone)];
|
993
|
+
|
994
|
+
self.modalMaskView.alpha = 0.0f;
|
995
|
+
self.modalContentView.alpha = 0.0f;
|
996
|
+
|
997
|
+
[UIView commitAnimations];
|
998
|
+
}
|
999
|
+
else if ( BeeUIBoard.ANIMATION_TYPE_BOUNCE == _modalAnimationType )
|
1000
|
+
{
|
1001
|
+
[UIView beginAnimations:nil context:nil];
|
1002
|
+
[UIView setAnimationDuration:(MODAL_ANIMATION_DURATION / 4.0f)];
|
1003
|
+
[UIView setAnimationDelegate:self];
|
1004
|
+
[UIView setAnimationDidStopSelector:@selector(didDisappearingAnimationDone)];
|
1005
|
+
|
1006
|
+
self.modalMaskView.alpha = 0.0f;
|
1007
|
+
self.modalContentView.alpha = 0.0f;
|
1008
|
+
self.modalContentView.transform = CGAffineTransformScale( CGAffineTransformIdentity, 0.001, 0.001 );
|
1009
|
+
|
1010
|
+
[UIView commitAnimations];
|
1011
|
+
}
|
1012
|
+
}
|
1013
|
+
else
|
1014
|
+
{
|
1015
|
+
[self didDisappearingAnimationDone];
|
1016
|
+
}
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
- (void)didDisappearingAnimationDone
|
1020
|
+
{
|
1021
|
+
self.modalMaskView.hidden = YES;
|
1022
|
+
SAFE_RELEASE_SUBVIEW( _modalContentView );
|
1023
|
+
|
1024
|
+
[self sendUISignal:BeeUIBoard.MODALVIEW_DID_HIDDEN];
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
- (void)presentModalBoard:(BeeUIBoard *)board animated:(BOOL)animated
|
1028
|
+
{
|
1029
|
+
if ( self.modalBoard )
|
1030
|
+
return;
|
1031
|
+
|
1032
|
+
if ( animated )
|
1033
|
+
{
|
1034
|
+
CATransition * transition = [CATransition animation];
|
1035
|
+
[transition setDuration:0.2f];
|
1036
|
+
[transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
|
1037
|
+
// [transition setType:kCATransitionMoveIn];
|
1038
|
+
// [transition setSubtype:kCATransitionFromBottom];
|
1039
|
+
[transition setType:kCATransitionFade];
|
1040
|
+
[self.view.layer addAnimation:transition forKey:nil];
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
self.modalBoard = board;
|
1044
|
+
[self.view addSubview:self.modalBoard.view];
|
1045
|
+
|
1046
|
+
board.parentBoard = self;
|
1047
|
+
}
|
1048
|
+
|
1049
|
+
- (void)dismissModalBoardAnimated:(BOOL)animated
|
1050
|
+
{
|
1051
|
+
if ( animated )
|
1052
|
+
{
|
1053
|
+
CATransition * transition = [CATransition animation];
|
1054
|
+
[transition setDuration:0.2f];
|
1055
|
+
[transition setTimingFunction:[CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]];
|
1056
|
+
// [transition setType:kCATransitionReveal];
|
1057
|
+
// [transition setSubtype:kCATransitionFromTop];
|
1058
|
+
[transition setType:kCATransitionFade];
|
1059
|
+
[self.view.layer addAnimation:transition forKey:nil];
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
[self.modalBoard.view removeFromSuperview];
|
1063
|
+
self.modalBoard.parentBoard = nil;
|
1064
|
+
self.modalBoard = nil;
|
1065
|
+
}
|
1066
|
+
|
1067
|
+
- (void)resignFirstResponderWalkThrough:(UIView *)rootView
|
1068
|
+
{
|
1069
|
+
for ( UIView * subview in rootView.subviews )
|
1070
|
+
{
|
1071
|
+
if ( [subview respondsToSelector:@selector(resignFirstResponder)] )
|
1072
|
+
{
|
1073
|
+
[subview performSelector:@selector(resignFirstResponder)];
|
1074
|
+
}
|
1075
|
+
|
1076
|
+
[self resignFirstResponderWalkThrough:subview];
|
1077
|
+
}
|
1078
|
+
}
|
1079
|
+
|
1080
|
+
- (BOOL)resignFirstResponder
|
1081
|
+
{
|
1082
|
+
[self resignFirstResponderWalkThrough:self.view];
|
1083
|
+
return YES;
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
- (BOOL)deactivated
|
1087
|
+
{
|
1088
|
+
return BeeUIBoard.STATE_DEACTIVATED == _state ? YES : NO;
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
- (BOOL)deactivating
|
1092
|
+
{
|
1093
|
+
return BeeUIBoard.STATE_DEACTIVATING == _state ? YES : NO;
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
- (BOOL)activating
|
1097
|
+
{
|
1098
|
+
return BeeUIBoard.STATE_ACTIVATING == _state ? YES : NO;
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
- (BOOL)activated
|
1102
|
+
{
|
1103
|
+
return BeeUIBoard.STATE_ACTIVATED == _state ? YES : NO;
|
1104
|
+
}
|
1105
|
+
|
1106
|
+
- (void)presentPopoverForView:(UIView *)view
|
1107
|
+
contentSize:(CGSize)size
|
1108
|
+
direction:(UIPopoverArrowDirection)direction
|
1109
|
+
animated:(BOOL)animated
|
1110
|
+
{
|
1111
|
+
self.view.frame = CGRectMake( 0.0f, 0.0f, size.width, size.height );
|
1112
|
+
|
1113
|
+
self.containedPopover = [[[UIPopoverController alloc] initWithContentViewController:[BeeUIStack stackWithFirstBoard:self]] autorelease];
|
1114
|
+
self.containedPopover.delegate = self;
|
1115
|
+
self.contentSizeForViewInPopover = size;
|
1116
|
+
[self.containedPopover setPopoverContentSize:size];
|
1117
|
+
|
1118
|
+
[self sendUISignal:BeeUIBoard.POPOVER_WILL_PRESENT];
|
1119
|
+
|
1120
|
+
[self.containedPopover presentPopoverFromRect:view.frame
|
1121
|
+
inView:view.superview
|
1122
|
+
permittedArrowDirections:direction
|
1123
|
+
animated:animated];
|
1124
|
+
|
1125
|
+
[self sendUISignal:BeeUIBoard.POPOVER_DID_PRESENT];
|
1126
|
+
}
|
1127
|
+
|
1128
|
+
- (void)dismissPopoverAnimated:(BOOL)animated
|
1129
|
+
{
|
1130
|
+
[self.containedPopover dismissPopoverAnimated:animated];
|
1131
|
+
self.containedPopover = nil;
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
|
1135
|
+
{
|
1136
|
+
[self sendUISignal:BeeUIBoard.POPOVER_WILL_DISMISS];
|
1137
|
+
return YES;
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController
|
1141
|
+
{
|
1142
|
+
[self sendUISignal:BeeUIBoard.POPOVER_DID_DISMISSED];
|
1143
|
+
self.containedPopover = nil;
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
- (void)beginAnimation
|
1147
|
+
{
|
1148
|
+
[UIView beginAnimations:nil context:nil];
|
1149
|
+
[UIView setAnimationBeginsFromCurrentState:YES];
|
1150
|
+
}
|
1151
|
+
|
1152
|
+
- (void)changeAnimationCurve:(UIViewAnimationCurve)curve
|
1153
|
+
{
|
1154
|
+
[UIView setAnimationCurve:curve];
|
1155
|
+
}
|
1156
|
+
|
1157
|
+
- (void)changeAnimationDuration:(NSTimeInterval)duration
|
1158
|
+
{
|
1159
|
+
[UIView setAnimationDuration:duration];
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
- (void)changeAnimationDelay:(NSTimeInterval)delay
|
1163
|
+
{
|
1164
|
+
[UIView setAnimationDelay:delay];
|
1165
|
+
}
|
1166
|
+
|
1167
|
+
- (void)didAnimationDone
|
1168
|
+
{
|
1169
|
+
[self sendUISignal:self.ANIMATION_FINISH];
|
1170
|
+
|
1171
|
+
if ( self.animationBlock )
|
1172
|
+
{
|
1173
|
+
self.animationBlock();
|
1174
|
+
}
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
- (void)commitAnimation:(BeeUIBoardBlock)block
|
1178
|
+
{
|
1179
|
+
self.animationBlock = block;
|
1180
|
+
|
1181
|
+
[self sendUISignal:self.ANIMATION_BEGIN];
|
1182
|
+
|
1183
|
+
[UIView setAnimationDelegate:self];
|
1184
|
+
[UIView setAnimationDidStopSelector:@selector(didAnimationDone)];
|
1185
|
+
[UIView commitAnimations];
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
- (void)transformZoom:(CGRect)rect
|
1189
|
+
{
|
1190
|
+
CGPoint center1 = CGPointMake( self.view.bounds.origin.x + (self.view.bounds.size.width / 2.0f), self.view.bounds.origin.y + (self.view.bounds.size.height / 2.0f) );
|
1191
|
+
CGPoint center2 = CGPointMake( rect.origin.x + (rect.size.width / 2.0f), rect.origin.y + (rect.size.height / 2.0f) );
|
1192
|
+
|
1193
|
+
CGFloat depthZ = rect.size.width;
|
1194
|
+
CGFloat transZ = rect.size.width * ((self.view.bounds.size.width - rect.size.width) / self.view.bounds.size.width);
|
1195
|
+
CGFloat transX = center1.x - center2.x;
|
1196
|
+
CGFloat transY = center1.y - center2.y;
|
1197
|
+
|
1198
|
+
CATransform3D transform = self.view.layer.transform;
|
1199
|
+
transform.m34 = -(1.0f / depthZ);
|
1200
|
+
transform = CATransform3DTranslate( transform, transX, transY, transZ );
|
1201
|
+
self.view.layer.transform = transform;
|
1202
|
+
|
1203
|
+
_zoomRect = rect;
|
1204
|
+
_zoomed = YES;
|
1205
|
+
}
|
1206
|
+
|
1207
|
+
- (void)transformReset
|
1208
|
+
{
|
1209
|
+
[UIView setAnimationBeginsFromCurrentState:NO];
|
1210
|
+
|
1211
|
+
self.view.layer.transform = CATransform3DIdentity;
|
1212
|
+
|
1213
|
+
_zoomRect = CGRectZero;
|
1214
|
+
_zoomed = NO;
|
1215
|
+
}
|
1216
|
+
|
1217
|
+
@end
|
1218
|
+
|
1219
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|