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,821 @@
|
|
1
|
+
//
|
2
|
+
// ______ ______ ______
|
3
|
+
// /\ __ \ /\ ___\ /\ ___\
|
4
|
+
// \ \ __< \ \ __\_ \ \ __\_
|
5
|
+
// \ \_____\ \ \_____\ \ \_____\
|
6
|
+
// \/_____/ \/_____/ \/_____/
|
7
|
+
//
|
8
|
+
// Copyright (c) 2013 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_UIMatrixView.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#undef MAX_QUEUED_ITEMS
|
34
|
+
#define MAX_QUEUED_ITEMS (32)
|
35
|
+
|
36
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
37
|
+
|
38
|
+
#import "Bee_Precompile.h"
|
39
|
+
#import "Bee_UIMatrixView.h"
|
40
|
+
#import "Bee_Runtime.h"
|
41
|
+
#import "Bee_Log.h"
|
42
|
+
#import "Bee_Performance.h"
|
43
|
+
#import "UIView+BeeExtension.h"
|
44
|
+
#import "UIView+BeeUISignal.h"
|
45
|
+
|
46
|
+
#pragma mark -
|
47
|
+
|
48
|
+
@interface BeeUIMatrixCol : NSObject
|
49
|
+
{
|
50
|
+
BOOL _visible;
|
51
|
+
NSInteger _index;
|
52
|
+
CGRect _rect;
|
53
|
+
UIView * _view;
|
54
|
+
}
|
55
|
+
|
56
|
+
@property (nonatomic, assign) BOOL visible;
|
57
|
+
@property (nonatomic, assign) NSInteger index;
|
58
|
+
@property (nonatomic, assign) CGRect rect;
|
59
|
+
@property (nonatomic, assign) UIView * view;
|
60
|
+
|
61
|
+
@end
|
62
|
+
|
63
|
+
#pragma mark -
|
64
|
+
|
65
|
+
@interface BeeUIMatrixRow : NSObject
|
66
|
+
{
|
67
|
+
BOOL _visible;
|
68
|
+
NSInteger _index;
|
69
|
+
NSMutableArray * _cols;
|
70
|
+
CGRect _rect;
|
71
|
+
}
|
72
|
+
|
73
|
+
@property (nonatomic, assign) BOOL visible;
|
74
|
+
@property (nonatomic, assign) NSInteger index;
|
75
|
+
@property (nonatomic, retain) NSMutableArray * cols;
|
76
|
+
@property (nonatomic, assign) CGRect rect;
|
77
|
+
|
78
|
+
@end
|
79
|
+
|
80
|
+
#pragma mark -
|
81
|
+
|
82
|
+
@implementation BeeUIMatrixCol
|
83
|
+
|
84
|
+
@synthesize visible = _visible;
|
85
|
+
@synthesize index = _index;
|
86
|
+
@synthesize rect = _rect;
|
87
|
+
@synthesize view = _view;
|
88
|
+
|
89
|
+
- (id)init
|
90
|
+
{
|
91
|
+
self = [super init];
|
92
|
+
if ( self )
|
93
|
+
{
|
94
|
+
_visible = NO;
|
95
|
+
_index = 0;
|
96
|
+
_rect = CGRectZero;
|
97
|
+
_view = nil;
|
98
|
+
}
|
99
|
+
return self;
|
100
|
+
}
|
101
|
+
|
102
|
+
- (void)dealloc
|
103
|
+
{
|
104
|
+
[_view removeFromSuperview];
|
105
|
+
[_view release];
|
106
|
+
|
107
|
+
[super dealloc];
|
108
|
+
}
|
109
|
+
|
110
|
+
@end
|
111
|
+
|
112
|
+
#pragma mark -
|
113
|
+
|
114
|
+
@implementation BeeUIMatrixRow
|
115
|
+
|
116
|
+
@synthesize visible = _visible;
|
117
|
+
@synthesize index = _index;
|
118
|
+
@synthesize rect = _rect;
|
119
|
+
@synthesize cols = _cols;
|
120
|
+
|
121
|
+
- (id)init
|
122
|
+
{
|
123
|
+
self = [super init];
|
124
|
+
if ( self )
|
125
|
+
{
|
126
|
+
_visible = NO;
|
127
|
+
_index = 0;
|
128
|
+
_rect = CGRectZero;
|
129
|
+
_cols = [[NSMutableArray alloc] init];
|
130
|
+
}
|
131
|
+
return self;
|
132
|
+
}
|
133
|
+
|
134
|
+
- (void)dealloc
|
135
|
+
{
|
136
|
+
[_cols removeAllObjects];
|
137
|
+
[_cols release];
|
138
|
+
|
139
|
+
[super dealloc];
|
140
|
+
}
|
141
|
+
|
142
|
+
@end
|
143
|
+
|
144
|
+
#pragma mark -
|
145
|
+
|
146
|
+
@interface BeeUIMatrixView(Private)
|
147
|
+
- (void)initSelf;
|
148
|
+
- (void)syncPositions;
|
149
|
+
- (void)calcPositions;
|
150
|
+
- (void)operateReloadData;
|
151
|
+
- (void)internalReloadData;
|
152
|
+
@end
|
153
|
+
|
154
|
+
#pragma mark -
|
155
|
+
|
156
|
+
@implementation BeeUIMatrixView
|
157
|
+
|
158
|
+
DEF_SIGNAL( RELOADED ) // 数据重新加载
|
159
|
+
DEF_SIGNAL( REACH_TOP ) // 触顶
|
160
|
+
DEF_SIGNAL( REACH_BOTTOM ) // 触底
|
161
|
+
DEF_SIGNAL( REACH_LEFT ) // 触左边
|
162
|
+
DEF_SIGNAL( REACH_RIGHT ) // 触右边
|
163
|
+
|
164
|
+
DEF_SIGNAL( DID_STOP )
|
165
|
+
DEF_SIGNAL( DID_SCROLL )
|
166
|
+
|
167
|
+
@synthesize dataSource = _dataSource;
|
168
|
+
|
169
|
+
@synthesize rowTotal = _rowTotal;
|
170
|
+
@synthesize colTotal = _colTotal;
|
171
|
+
|
172
|
+
@dynamic rowVisibleRange;
|
173
|
+
@dynamic colVisibleRange;
|
174
|
+
|
175
|
+
@synthesize items = _items;
|
176
|
+
|
177
|
+
@synthesize reachTop = _reachTop;
|
178
|
+
@synthesize reachBottom = _reachBottom;
|
179
|
+
@synthesize reachLeft = _reachLeft;
|
180
|
+
@synthesize reachRight = _reachRight;
|
181
|
+
|
182
|
+
@synthesize reloaded = _reloaded;
|
183
|
+
@synthesize reloading = _reloading;
|
184
|
+
@synthesize reuseQueue = _reuseQueue;
|
185
|
+
|
186
|
+
@synthesize scrollSpeed = _scrollSpeed;
|
187
|
+
|
188
|
+
+ (BeeUIMatrixView *)spawn
|
189
|
+
{
|
190
|
+
return [[[BeeUIMatrixView alloc] initWithFrame:CGRectZero] autorelease];
|
191
|
+
}
|
192
|
+
|
193
|
+
+ (BeeUIMatrixView *)spawn:(NSString *)tagString
|
194
|
+
{
|
195
|
+
BeeUIMatrixView * view = [[[BeeUIMatrixView alloc] init] autorelease];
|
196
|
+
view.tagString = tagString;
|
197
|
+
return view;
|
198
|
+
}
|
199
|
+
|
200
|
+
- (id)init
|
201
|
+
{
|
202
|
+
self = [super initWithFrame:CGRectZero];
|
203
|
+
if ( self )
|
204
|
+
{
|
205
|
+
[self initSelf];
|
206
|
+
}
|
207
|
+
return self;
|
208
|
+
}
|
209
|
+
|
210
|
+
- (id)initWithFrame:(CGRect)frame
|
211
|
+
{
|
212
|
+
self = [super initWithFrame:frame];
|
213
|
+
if ( self )
|
214
|
+
{
|
215
|
+
[self initSelf];
|
216
|
+
}
|
217
|
+
return self;
|
218
|
+
}
|
219
|
+
|
220
|
+
- (void)initSelf
|
221
|
+
{
|
222
|
+
_dataSource = self;
|
223
|
+
|
224
|
+
_reloaded = NO;
|
225
|
+
_shouldNotify = YES;
|
226
|
+
|
227
|
+
[_items release];
|
228
|
+
_items = [[NSMutableArray alloc] init];
|
229
|
+
|
230
|
+
[_reuseQueue release];
|
231
|
+
_reuseQueue = [[NSMutableArray alloc] init];
|
232
|
+
|
233
|
+
_rowTotal = 0;
|
234
|
+
_colTotal = 0;
|
235
|
+
_itemSize = CGSizeZero;
|
236
|
+
|
237
|
+
_rowVisibleRange = NSMakeRange( 0, 0 );
|
238
|
+
_colVisibleRange = NSMakeRange( 0, 0 );
|
239
|
+
|
240
|
+
_reachTop = NO;
|
241
|
+
_reachBottom = NO;
|
242
|
+
_reachLeft = NO;
|
243
|
+
_reachRight = NO;
|
244
|
+
|
245
|
+
_baseInsets = UIEdgeInsetsZero;
|
246
|
+
|
247
|
+
self.backgroundColor = [UIColor clearColor];
|
248
|
+
self.contentSize = self.bounds.size;
|
249
|
+
self.contentInset = _baseInsets;
|
250
|
+
self.alwaysBounceVertical = YES;
|
251
|
+
self.alwaysBounceHorizontal = YES;
|
252
|
+
self.bounces = YES;
|
253
|
+
self.scrollEnabled = YES;
|
254
|
+
self.showsVerticalScrollIndicator = NO;
|
255
|
+
self.showsHorizontalScrollIndicator = NO;
|
256
|
+
self.alpha = 1.0f;
|
257
|
+
self.delegate = self;
|
258
|
+
self.directionalLockEnabled = YES;
|
259
|
+
self.layer.masksToBounds = YES;
|
260
|
+
}
|
261
|
+
|
262
|
+
- (void)dealloc
|
263
|
+
{
|
264
|
+
[_reuseQueue removeAllObjects];
|
265
|
+
[_reuseQueue release];
|
266
|
+
_reuseQueue = nil;
|
267
|
+
|
268
|
+
[_items removeAllObjects];
|
269
|
+
[_items release];
|
270
|
+
_items = nil;
|
271
|
+
|
272
|
+
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
273
|
+
|
274
|
+
[super dealloc];
|
275
|
+
}
|
276
|
+
|
277
|
+
- (void)setBaseInsets:(UIEdgeInsets)insets
|
278
|
+
{
|
279
|
+
_baseInsets = insets;
|
280
|
+
self.contentInset = insets;
|
281
|
+
}
|
282
|
+
|
283
|
+
- (UIEdgeInsets)getBaseInsets
|
284
|
+
{
|
285
|
+
return _baseInsets;
|
286
|
+
}
|
287
|
+
|
288
|
+
- (void)reloadData
|
289
|
+
{
|
290
|
+
[self syncReloadData];
|
291
|
+
}
|
292
|
+
|
293
|
+
- (void)syncReloadData
|
294
|
+
{
|
295
|
+
self.userInteractionEnabled = NO;
|
296
|
+
|
297
|
+
[self cancelReloadData];
|
298
|
+
_reloading = YES;
|
299
|
+
[self operateReloadData];
|
300
|
+
|
301
|
+
self.userInteractionEnabled = YES;
|
302
|
+
}
|
303
|
+
|
304
|
+
- (void)asyncReloadData
|
305
|
+
{
|
306
|
+
if ( NO == _reloading )
|
307
|
+
{
|
308
|
+
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(operateReloadData) object:nil];
|
309
|
+
[self performSelector:@selector(operateReloadData) withObject:nil afterDelay:0.2f];
|
310
|
+
_reloading = YES;
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
- (void)cancelReloadData
|
315
|
+
{
|
316
|
+
if ( YES == _reloading )
|
317
|
+
{
|
318
|
+
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(operateReloadData) object:nil];
|
319
|
+
_reloading = NO;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
|
323
|
+
- (void)operateReloadData
|
324
|
+
{
|
325
|
+
if ( YES == _reloading )
|
326
|
+
{
|
327
|
+
_reloading = NO;
|
328
|
+
|
329
|
+
[self internalReloadData];
|
330
|
+
|
331
|
+
if ( _shouldNotify )
|
332
|
+
{
|
333
|
+
[self sendUISignal:self.RELOADED];
|
334
|
+
}
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
- (void)internalReloadData
|
339
|
+
{
|
340
|
+
CGSize newItemSize = [_dataSource sizeOfViewForMatrixView:self];
|
341
|
+
NSInteger newRowTotal = [_dataSource numberOfRowsInMatrixView:self];
|
342
|
+
NSInteger newColTotal = [_dataSource numberOfColsInMatrixView:self];
|
343
|
+
|
344
|
+
BOOL changed = NO;
|
345
|
+
|
346
|
+
if ( NO == CGSizeEqualToSize(newItemSize, _itemSize) )
|
347
|
+
{
|
348
|
+
changed = YES;
|
349
|
+
}
|
350
|
+
else if ( newRowTotal != _rowTotal )
|
351
|
+
{
|
352
|
+
changed = YES;
|
353
|
+
}
|
354
|
+
else if ( newColTotal != _colTotal )
|
355
|
+
{
|
356
|
+
changed = YES;
|
357
|
+
}
|
358
|
+
|
359
|
+
if ( changed )
|
360
|
+
{
|
361
|
+
_itemSize = newItemSize;
|
362
|
+
_rowTotal = newRowTotal;
|
363
|
+
_colTotal = newColTotal;
|
364
|
+
|
365
|
+
CGSize contSize = CGSizeZero;
|
366
|
+
contSize.width = _itemSize.width * newColTotal;
|
367
|
+
contSize.height = _itemSize.height * newRowTotal;
|
368
|
+
self.contentSize = contSize;
|
369
|
+
|
370
|
+
[_items removeAllObjects];
|
371
|
+
|
372
|
+
for ( NSInteger i = 0; i < _rowTotal; ++i )
|
373
|
+
{
|
374
|
+
CGRect rowRect;
|
375
|
+
rowRect.size.width = _itemSize.width * _colTotal;
|
376
|
+
rowRect.size.height = _itemSize.height;
|
377
|
+
rowRect.origin.x = 0.0f;
|
378
|
+
rowRect.origin.y = _itemSize.height * i;
|
379
|
+
|
380
|
+
BeeUIMatrixRow * row = [[[BeeUIMatrixRow alloc] init] autorelease];
|
381
|
+
row.index = i;
|
382
|
+
row.rect = rowRect;
|
383
|
+
|
384
|
+
for ( NSInteger j = 0; j < _colTotal; ++j )
|
385
|
+
{
|
386
|
+
CGRect colRect;
|
387
|
+
colRect.size.width = _itemSize.width;
|
388
|
+
colRect.size.height = _itemSize.height;
|
389
|
+
colRect.origin.x = rowRect.origin.x + _itemSize.width * j;
|
390
|
+
colRect.origin.y = rowRect.origin.y;
|
391
|
+
|
392
|
+
BeeUIMatrixCol * col = [[[BeeUIMatrixCol alloc] init] autorelease];
|
393
|
+
col.index = j;
|
394
|
+
col.rect = colRect;
|
395
|
+
|
396
|
+
[row.cols addObject:col];
|
397
|
+
}
|
398
|
+
|
399
|
+
[_items addObject:row];
|
400
|
+
}
|
401
|
+
|
402
|
+
[self calcPositions];
|
403
|
+
[self syncPositions];
|
404
|
+
}
|
405
|
+
|
406
|
+
_reloaded = YES;
|
407
|
+
}
|
408
|
+
|
409
|
+
- (void)setFrame:(CGRect)frame
|
410
|
+
{
|
411
|
+
_shouldNotify = NO;
|
412
|
+
|
413
|
+
[super setFrame:frame];
|
414
|
+
|
415
|
+
if ( CGSizeEqualToSize(self.contentSize, CGSizeZero) )
|
416
|
+
{
|
417
|
+
self.contentSize = frame.size;
|
418
|
+
self.contentInset = _baseInsets;
|
419
|
+
}
|
420
|
+
|
421
|
+
_shouldNotify = YES;
|
422
|
+
|
423
|
+
if ( NO == _reloaded )
|
424
|
+
{
|
425
|
+
[self syncReloadData];
|
426
|
+
}
|
427
|
+
else
|
428
|
+
{
|
429
|
+
[self asyncReloadData];
|
430
|
+
}
|
431
|
+
}
|
432
|
+
|
433
|
+
- (id)dequeueWithContentClass:(Class)clazz
|
434
|
+
{
|
435
|
+
for ( UIView * reuseView in _reuseQueue )
|
436
|
+
{
|
437
|
+
if ( [reuseView isKindOfClass:clazz] )
|
438
|
+
{
|
439
|
+
CC( @"UIMatrixView, dequeue <= (%p)", reuseView );
|
440
|
+
|
441
|
+
[reuseView retain];
|
442
|
+
[_reuseQueue removeObject:reuseView];
|
443
|
+
// return reuseView;
|
444
|
+
return [reuseView autorelease];
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
UIView * newView = (UIView *)[BeeRuntime allocByClass:clazz];
|
449
|
+
return [[newView initWithFrame:CGRectZero] autorelease];
|
450
|
+
}
|
451
|
+
|
452
|
+
- (void)syncPositions
|
453
|
+
{
|
454
|
+
// if ( self.contentOffset.x < 0 || self.contentOffset.x + self.bounds.size.width > self.contentSize.width )
|
455
|
+
// {
|
456
|
+
// if ( _colVisibleRange.length > 0 )
|
457
|
+
// return;
|
458
|
+
// }
|
459
|
+
//
|
460
|
+
// if ( self.contentOffset.y < 0 || self.contentOffset.y + self.bounds.size.height > self.contentSize.height )
|
461
|
+
// {
|
462
|
+
// if ( _rowVisibleRange.length > 0 )
|
463
|
+
// return;
|
464
|
+
// }
|
465
|
+
|
466
|
+
CC( @"UIMatrixView, subviews = %d", [self.subviews count] );
|
467
|
+
|
468
|
+
PERF_ENTER
|
469
|
+
|
470
|
+
CGRect visibleRect;
|
471
|
+
visibleRect.origin = self.contentOffset;
|
472
|
+
visibleRect.size = self.bounds.size;
|
473
|
+
|
474
|
+
NSInteger rowVisibleBegin = 0;
|
475
|
+
NSInteger rowVisibleEnd = 0;
|
476
|
+
|
477
|
+
NSInteger colVisibleBegin = 0;
|
478
|
+
NSInteger colVisibleEnd = 0;
|
479
|
+
|
480
|
+
for ( BeeUIMatrixRow * row in _items )
|
481
|
+
{
|
482
|
+
PERF_ENTER_( row_visible )
|
483
|
+
row.visible = CGRectIntersectsRect( row.rect, visibleRect );
|
484
|
+
PERF_LEAVE_( row_visible )
|
485
|
+
|
486
|
+
if ( row.visible )
|
487
|
+
{
|
488
|
+
if ( rowVisibleBegin < 0 )
|
489
|
+
{
|
490
|
+
rowVisibleBegin = row.index;
|
491
|
+
}
|
492
|
+
|
493
|
+
rowVisibleEnd = row.index;
|
494
|
+
}
|
495
|
+
|
496
|
+
for ( BeeUIMatrixCol * col in row.cols )
|
497
|
+
{
|
498
|
+
PERF_ENTER_( row_visible )
|
499
|
+
col.visible = row.visible ? CGRectIntersectsRect(col.rect, visibleRect) : NO;
|
500
|
+
PERF_LEAVE_( col_visible )
|
501
|
+
|
502
|
+
if ( col.visible )
|
503
|
+
{
|
504
|
+
if ( colVisibleBegin < 0 )
|
505
|
+
{
|
506
|
+
colVisibleBegin = col.index;
|
507
|
+
}
|
508
|
+
|
509
|
+
colVisibleEnd = col.index;
|
510
|
+
}
|
511
|
+
|
512
|
+
// CC( @"UIMatrixView, syncPositions(%d, %d), %@", row.index, col.index, col.visible ? @"visible" : @"" );
|
513
|
+
|
514
|
+
if ( NO == col.visible )
|
515
|
+
{
|
516
|
+
PERF_ENTER_( enqueue )
|
517
|
+
if ( col.view )
|
518
|
+
{
|
519
|
+
if ( _reuseQueue.count >= MAX_QUEUED_ITEMS )
|
520
|
+
{
|
521
|
+
[_reuseQueue removeObject:[_reuseQueue objectAtIndex:0]];
|
522
|
+
}
|
523
|
+
|
524
|
+
CC( @"UIMatrixView, enqueue => (%p)", col.view );
|
525
|
+
[_reuseQueue addObject:col.view];
|
526
|
+
|
527
|
+
[col.view removeFromSuperview];
|
528
|
+
col.view = nil;
|
529
|
+
}
|
530
|
+
PERF_LEAVE_( enqueue )
|
531
|
+
}
|
532
|
+
else
|
533
|
+
{
|
534
|
+
PERF_ENTER_( dequeue )
|
535
|
+
if ( nil == col.view )
|
536
|
+
{
|
537
|
+
col.view = [_dataSource matrixView:self row:row.index col:col.index];
|
538
|
+
col.view.frame = col.rect;
|
539
|
+
}
|
540
|
+
|
541
|
+
if ( col.view && col.view.superview != self )
|
542
|
+
{
|
543
|
+
// [col.view retain];
|
544
|
+
[col.view removeFromSuperview];
|
545
|
+
[self addSubview:col.view];
|
546
|
+
// [col.view release];
|
547
|
+
}
|
548
|
+
|
549
|
+
// CC( @"%p, (%f, %f), (%f, %f)",
|
550
|
+
// col.view,
|
551
|
+
// col.rect.origin.x, col.rect.origin.y,
|
552
|
+
// col.rect.size.width, col.rect.size.height );
|
553
|
+
PERF_LEAVE_( dequeue )
|
554
|
+
}
|
555
|
+
}
|
556
|
+
}
|
557
|
+
|
558
|
+
PERF_ENTER_( signal )
|
559
|
+
|
560
|
+
_colVisibleRange = NSMakeRange( colVisibleBegin, colVisibleEnd - colVisibleBegin + 1 );
|
561
|
+
_rowVisibleRange = NSMakeRange( rowVisibleBegin, rowVisibleEnd - rowVisibleBegin + 1 );
|
562
|
+
|
563
|
+
BOOL reachTop = (0 == _rowVisibleRange.location) ? YES : NO;
|
564
|
+
if ( reachTop )
|
565
|
+
{
|
566
|
+
if ( NO == _reachTop )
|
567
|
+
{
|
568
|
+
if ( _shouldNotify )
|
569
|
+
{
|
570
|
+
[self sendUISignal:BeeUIMatrixView.REACH_TOP];
|
571
|
+
}
|
572
|
+
|
573
|
+
_reachTop = YES;
|
574
|
+
}
|
575
|
+
}
|
576
|
+
else
|
577
|
+
{
|
578
|
+
_reachTop = NO;
|
579
|
+
}
|
580
|
+
|
581
|
+
BOOL reachBottom = (_rowVisibleRange.location + _rowVisibleRange.length >= _rowTotal - 1) ? YES : NO;
|
582
|
+
if ( reachBottom )
|
583
|
+
{
|
584
|
+
if ( NO == _reachBottom )
|
585
|
+
{
|
586
|
+
if ( _shouldNotify )
|
587
|
+
{
|
588
|
+
[self sendUISignal:BeeUIMatrixView.REACH_BOTTOM];
|
589
|
+
}
|
590
|
+
|
591
|
+
_reachBottom = YES;
|
592
|
+
}
|
593
|
+
}
|
594
|
+
else
|
595
|
+
{
|
596
|
+
_reachBottom = NO;
|
597
|
+
}
|
598
|
+
|
599
|
+
BOOL reachLeft = (0 == _colVisibleRange.location) ? YES : NO;
|
600
|
+
if ( reachLeft )
|
601
|
+
{
|
602
|
+
if ( NO == _reachLeft )
|
603
|
+
{
|
604
|
+
if ( _shouldNotify )
|
605
|
+
{
|
606
|
+
[self sendUISignal:BeeUIMatrixView.REACH_LEFT];
|
607
|
+
}
|
608
|
+
|
609
|
+
_reachLeft = YES;
|
610
|
+
}
|
611
|
+
}
|
612
|
+
else
|
613
|
+
{
|
614
|
+
_reachLeft = NO;
|
615
|
+
}
|
616
|
+
|
617
|
+
BOOL reachRight = (_colVisibleRange.location + _colVisibleRange.length >= _colTotal - 1) ? YES : NO;
|
618
|
+
if ( reachRight )
|
619
|
+
{
|
620
|
+
if ( NO == _reachRight )
|
621
|
+
{
|
622
|
+
if ( _shouldNotify )
|
623
|
+
{
|
624
|
+
[self sendUISignal:BeeUIMatrixView.REACH_RIGHT];
|
625
|
+
}
|
626
|
+
|
627
|
+
_reachRight = YES;
|
628
|
+
}
|
629
|
+
}
|
630
|
+
else
|
631
|
+
{
|
632
|
+
_reachRight = NO;
|
633
|
+
}
|
634
|
+
|
635
|
+
PERF_LEAVE_( signal )
|
636
|
+
PERF_LEAVE
|
637
|
+
}
|
638
|
+
|
639
|
+
- (void)calcPositions
|
640
|
+
{
|
641
|
+
}
|
642
|
+
|
643
|
+
#pragma mark -
|
644
|
+
#pragma mark BeeUIScrollViewDelegate
|
645
|
+
|
646
|
+
- (CGSize)sizeOfViewForMatrixView:(BeeUIMatrixView *)matrixView
|
647
|
+
{
|
648
|
+
return CGSizeZero;
|
649
|
+
}
|
650
|
+
|
651
|
+
- (NSInteger)numberOfRowsInMatrixView:(BeeUIMatrixView *)matrixView
|
652
|
+
{
|
653
|
+
return 0;
|
654
|
+
}
|
655
|
+
|
656
|
+
- (NSInteger)numberOfColsInMatrixView:(BeeUIMatrixView *)matrixView
|
657
|
+
{
|
658
|
+
return 0;
|
659
|
+
}
|
660
|
+
|
661
|
+
- (UIView *)matrixView:(BeeUIMatrixView *)matrixView row:(NSInteger)row col:(NSInteger)col
|
662
|
+
{
|
663
|
+
return nil;
|
664
|
+
}
|
665
|
+
|
666
|
+
#pragma mark -
|
667
|
+
#pragma mark UIScrollViewDelegate
|
668
|
+
|
669
|
+
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
670
|
+
{
|
671
|
+
// if ( scrollView.dragging )
|
672
|
+
// {
|
673
|
+
// if ( NO == _pullLoader.hidden && BeeUIScrollView.STATE_LOADING != _pullLoader.state )
|
674
|
+
// {
|
675
|
+
// if ( BeeUIScrollView.STATE_NORMAL == _pullLoader.state )
|
676
|
+
// {
|
677
|
+
// _baseInsets = scrollView.contentInset;
|
678
|
+
// }
|
679
|
+
//
|
680
|
+
// CGFloat offset = scrollView.contentOffset.y;
|
681
|
+
// CGFloat boundY = -(_baseInsets.top + 60.0f);
|
682
|
+
//
|
683
|
+
// if ( offset < boundY )
|
684
|
+
// {
|
685
|
+
// if ( BeeUIScrollView.STATE_PULLING != _pullLoader.state )
|
686
|
+
// {
|
687
|
+
// [_pullLoader changeState:BeeUIScrollView.STATE_PULLING animated:YES];
|
688
|
+
// }
|
689
|
+
// }
|
690
|
+
// else if ( offset < 0.0f )
|
691
|
+
// {
|
692
|
+
// if ( BeeUIScrollView.STATE_NORMAL != _pullLoader.state )
|
693
|
+
// {
|
694
|
+
// [_pullLoader changeState:BeeUIScrollView.STATE_NORMAL animated:YES];
|
695
|
+
// }
|
696
|
+
// }
|
697
|
+
// }
|
698
|
+
// }
|
699
|
+
|
700
|
+
if ( _shouldNotify )
|
701
|
+
{
|
702
|
+
[self sendUISignal:self.DID_SCROLL];
|
703
|
+
}
|
704
|
+
|
705
|
+
[self syncPositions];
|
706
|
+
|
707
|
+
CGPoint currentOffset = self.contentOffset;
|
708
|
+
NSTimeInterval currentTime = [NSDate timeIntervalSinceReferenceDate];
|
709
|
+
NSTimeInterval timeDiff = currentTime - _lastOffsetCapture;
|
710
|
+
|
711
|
+
if ( timeDiff > 0.1 )
|
712
|
+
{
|
713
|
+
_scrollSpeed.x = ((currentOffset.x - _lastOffset.x) / 1000.0f);
|
714
|
+
_scrollSpeed.y = ((currentOffset.y - _lastOffset.y) / 1000.0f);
|
715
|
+
|
716
|
+
_lastOffset = currentOffset;
|
717
|
+
_lastOffsetCapture = currentTime;
|
718
|
+
}
|
719
|
+
|
720
|
+
CC( @"scrollSpeed = (%f, %f)", _scrollSpeed.x, _scrollSpeed.y );
|
721
|
+
}
|
722
|
+
|
723
|
+
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
724
|
+
{
|
725
|
+
[self syncPositions];
|
726
|
+
}
|
727
|
+
|
728
|
+
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
|
729
|
+
{
|
730
|
+
// if ( decelerate )
|
731
|
+
// {
|
732
|
+
// if ( NO == _pullLoader.hidden && BeeUIScrollView.STATE_LOADING != _pullLoader.state )
|
733
|
+
// {
|
734
|
+
// CGFloat offset = scrollView.contentOffset.y;
|
735
|
+
// CGFloat boundY = -(_baseInsets.top + 80.0f);
|
736
|
+
//
|
737
|
+
// if ( offset <= boundY )
|
738
|
+
// {
|
739
|
+
// if ( BeeUIScrollView.STATE_LOADING != _pullLoader.state )
|
740
|
+
// {
|
741
|
+
// [UIView beginAnimations:nil context:NULL];
|
742
|
+
// [UIView setAnimationDuration:0.3f];
|
743
|
+
// UIEdgeInsets insets = _baseInsets;
|
744
|
+
// insets.top += _pullLoader.bounds.size.height;
|
745
|
+
// scrollView.contentInset = insets;
|
746
|
+
// [UIView commitAnimations];
|
747
|
+
//
|
748
|
+
// [_pullLoader changeState:BeeUIScrollView.STATE_LOADING animated:YES];
|
749
|
+
//
|
750
|
+
// [self sendUISignal:BeeUIFlowBoard.PULL_REFRESH];
|
751
|
+
// }
|
752
|
+
// }
|
753
|
+
// else
|
754
|
+
// {
|
755
|
+
// if ( BeeUIScrollView.STATE_NORMAL != _pullLoader.state )
|
756
|
+
// {
|
757
|
+
// [UIView beginAnimations:nil context:NULL];
|
758
|
+
// [UIView setAnimationDuration:0.3f];
|
759
|
+
// scrollView.contentInset = _baseInsets;
|
760
|
+
// [UIView commitAnimations];
|
761
|
+
//
|
762
|
+
// [_pullLoader changeState:BeeUIScrollView.STATE_NORMAL animated:YES];
|
763
|
+
// }
|
764
|
+
// }
|
765
|
+
// }
|
766
|
+
// }
|
767
|
+
|
768
|
+
if ( NO == decelerate )
|
769
|
+
{
|
770
|
+
if ( _shouldNotify )
|
771
|
+
{
|
772
|
+
[self sendUISignal:self.DID_STOP];
|
773
|
+
}
|
774
|
+
|
775
|
+
if ( self.contentOffset.x < 0 )
|
776
|
+
{
|
777
|
+
_reachLeft = NO;
|
778
|
+
}
|
779
|
+
|
780
|
+
if ( self.contentOffset.x + self.bounds.size.width >= self.contentSize.width )
|
781
|
+
{
|
782
|
+
_reachRight = NO;
|
783
|
+
}
|
784
|
+
|
785
|
+
if ( self.contentOffset.y < 0 )
|
786
|
+
{
|
787
|
+
_reachTop = NO;
|
788
|
+
}
|
789
|
+
|
790
|
+
if ( self.contentOffset.y + self.bounds.size.height >= self.contentSize.height )
|
791
|
+
{
|
792
|
+
_reachBottom = NO;
|
793
|
+
}
|
794
|
+
}
|
795
|
+
|
796
|
+
[self syncPositions];
|
797
|
+
}
|
798
|
+
|
799
|
+
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
|
800
|
+
{
|
801
|
+
[self syncPositions];
|
802
|
+
}
|
803
|
+
|
804
|
+
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
|
805
|
+
{
|
806
|
+
if ( _shouldNotify )
|
807
|
+
{
|
808
|
+
[self sendUISignal:self.DID_STOP];
|
809
|
+
}
|
810
|
+
|
811
|
+
[self syncPositions];
|
812
|
+
}
|
813
|
+
|
814
|
+
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
|
815
|
+
{
|
816
|
+
[self syncPositions];
|
817
|
+
}
|
818
|
+
|
819
|
+
@end
|
820
|
+
|
821
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|