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,57 @@
|
|
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_UINavigationBar.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
#import "Bee_UIImageView.h"
|
38
|
+
#import "NSObject+BeeNotification.h"
|
39
|
+
|
40
|
+
#pragma mark -
|
41
|
+
|
42
|
+
@interface BeeUINavigationBar : UINavigationBar
|
43
|
+
{
|
44
|
+
UINavigationController * _navigationController;
|
45
|
+
UIImage * _backgroundImage;
|
46
|
+
}
|
47
|
+
|
48
|
+
AS_NOTIFICATION( BACKGROUND_CHANGED )
|
49
|
+
|
50
|
+
@property (nonatomic, assign) UINavigationController * navigationController;
|
51
|
+
@property (nonatomic, retain) UIImage * backgroundImage;
|
52
|
+
|
53
|
+
+ (void)setBackgroundImage:(UIImage *)image;
|
54
|
+
|
55
|
+
@end
|
56
|
+
|
57
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,161 @@
|
|
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_UINavigationBar.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UINavigationBar.h"
|
37
|
+
#import "Bee_Runtime.h"
|
38
|
+
#import "UIView+BeeExtension.h"
|
39
|
+
#import "UIView+BeeUISignal.h"
|
40
|
+
#import "UIViewController+BeeUISignal.h"
|
41
|
+
|
42
|
+
#pragma mark -
|
43
|
+
|
44
|
+
#undef UNUSED
|
45
|
+
#define UNUSED( __x ) (void)(__x)
|
46
|
+
|
47
|
+
#pragma mark -
|
48
|
+
|
49
|
+
static UIImage * __defaultImage = nil;
|
50
|
+
|
51
|
+
#pragma mark -
|
52
|
+
|
53
|
+
@implementation BeeUINavigationBar
|
54
|
+
|
55
|
+
DEF_NOTIFICATION( BACKGROUND_CHANGED )
|
56
|
+
|
57
|
+
@synthesize navigationController = _navigationController;
|
58
|
+
@dynamic backgroundImage;
|
59
|
+
|
60
|
+
- (id)init
|
61
|
+
{
|
62
|
+
self = [super initWithFrame:CGRectZero];
|
63
|
+
if ( self )
|
64
|
+
{
|
65
|
+
[self initSelf];
|
66
|
+
}
|
67
|
+
return self;
|
68
|
+
}
|
69
|
+
|
70
|
+
- (id)initWithFrame:(CGRect)frame
|
71
|
+
{
|
72
|
+
self = [super initWithFrame:frame];
|
73
|
+
if ( self )
|
74
|
+
{
|
75
|
+
[self initSelf];
|
76
|
+
}
|
77
|
+
return self;
|
78
|
+
}
|
79
|
+
|
80
|
+
- (void)initSelf
|
81
|
+
{
|
82
|
+
[self setBarStyle:UIBarStyleBlackOpaque];
|
83
|
+
[self observeNotification:BeeUINavigationBar.BACKGROUND_CHANGED];
|
84
|
+
|
85
|
+
self.layer.masksToBounds = NO;
|
86
|
+
self.layer.shadowColor = [UIColor blackColor].CGColor;
|
87
|
+
self.layer.shadowOffset = CGSizeMake(0, 2);
|
88
|
+
self.layer.shadowRadius = 0.6f;
|
89
|
+
self.layer.shadowOpacity = 0.6f;
|
90
|
+
}
|
91
|
+
|
92
|
+
- (void)dealloc
|
93
|
+
{
|
94
|
+
[self unobserveAllNotifications];
|
95
|
+
|
96
|
+
[_backgroundImage release];
|
97
|
+
|
98
|
+
[super dealloc];
|
99
|
+
}
|
100
|
+
|
101
|
+
- (void)drawRect:(CGRect)rect
|
102
|
+
{
|
103
|
+
if ( _backgroundImage )
|
104
|
+
{
|
105
|
+
[_backgroundImage drawInRect:rect];
|
106
|
+
}
|
107
|
+
else if ( __defaultImage )
|
108
|
+
{
|
109
|
+
[__defaultImage drawInRect:rect];
|
110
|
+
}
|
111
|
+
else
|
112
|
+
{
|
113
|
+
[super drawRect:rect];
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
- (void)handleNotification:(NSNotification *)notification
|
118
|
+
{
|
119
|
+
if ( [notification is:BeeUINavigationBar.BACKGROUND_CHANGED] )
|
120
|
+
{
|
121
|
+
[self setNeedsDisplay];
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
- (void)handleUISignal:(BeeUISignal *)signal
|
126
|
+
{
|
127
|
+
if ( _navigationController )
|
128
|
+
{
|
129
|
+
UIViewController * vc = _navigationController.topViewController;
|
130
|
+
if ( vc )
|
131
|
+
{
|
132
|
+
[signal forward:vc];
|
133
|
+
}
|
134
|
+
}
|
135
|
+
else
|
136
|
+
{
|
137
|
+
[super handleUISignal:signal];
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
- (void)setBackgroundImage:(UIImage *)image
|
142
|
+
{
|
143
|
+
[image retain];
|
144
|
+
[_backgroundImage release];
|
145
|
+
_backgroundImage = image;
|
146
|
+
|
147
|
+
[self setNeedsDisplay];
|
148
|
+
}
|
149
|
+
|
150
|
+
+ (void)setBackgroundImage:(UIImage *)image
|
151
|
+
{
|
152
|
+
[image retain];
|
153
|
+
[__defaultImage release];
|
154
|
+
__defaultImage = image;
|
155
|
+
|
156
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:BeeUINavigationBar.BACKGROUND_CHANGED object:nil];
|
157
|
+
}
|
158
|
+
|
159
|
+
@end
|
160
|
+
|
161
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,60 @@
|
|
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_Orientation.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
#import "Bee_Singleton.h"
|
38
|
+
#import "NSObject+BeeNotification.h"
|
39
|
+
|
40
|
+
#pragma mark -
|
41
|
+
|
42
|
+
@interface BeeUIOrientation : NSObject<UIAccelerometerDelegate>
|
43
|
+
{
|
44
|
+
UIInterfaceOrientation _orientation;
|
45
|
+
// TODO: 显示方向指示器
|
46
|
+
}
|
47
|
+
|
48
|
+
AS_SINGLETON( BeeUIOrientation );
|
49
|
+
|
50
|
+
AS_NOTIFICATION( ANGLE_CHANGED ); // 设备角度改变
|
51
|
+
AS_NOTIFICATION( DIRECTION_CHANGED ); // 设备方向改变
|
52
|
+
|
53
|
+
@property (nonatomic, assign) UIInterfaceOrientation orientation;
|
54
|
+
|
55
|
+
- (void)startTrack;
|
56
|
+
- (void)stopTrack;
|
57
|
+
|
58
|
+
@end
|
59
|
+
|
60
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,146 @@
|
|
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_Orientation.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UIOrientation.h"
|
37
|
+
#import "Bee_UISignal.h"
|
38
|
+
#import "Bee_Log.h"
|
39
|
+
|
40
|
+
#pragma mark -
|
41
|
+
|
42
|
+
@implementation BeeUIOrientation
|
43
|
+
|
44
|
+
DEF_SINGLETON( BeeUIOrientation );
|
45
|
+
|
46
|
+
DEF_NOTIFICATION( ANGLE_CHANGED );
|
47
|
+
DEF_NOTIFICATION( DIRECTION_CHANGED );
|
48
|
+
|
49
|
+
@synthesize orientation = _orientation;
|
50
|
+
|
51
|
+
- (id)init
|
52
|
+
{
|
53
|
+
self = [super init];
|
54
|
+
if ( self )
|
55
|
+
{
|
56
|
+
_orientation = UIInterfaceOrientationPortrait;
|
57
|
+
|
58
|
+
[UIAccelerometer sharedAccelerometer].updateInterval = 0.1f;
|
59
|
+
}
|
60
|
+
return self;
|
61
|
+
}
|
62
|
+
|
63
|
+
- (void)startTrack
|
64
|
+
{
|
65
|
+
[UIAccelerometer sharedAccelerometer].delegate = self;
|
66
|
+
}
|
67
|
+
|
68
|
+
- (void)stopTrack
|
69
|
+
{
|
70
|
+
[UIAccelerometer sharedAccelerometer].delegate = nil;
|
71
|
+
}
|
72
|
+
|
73
|
+
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
|
74
|
+
{
|
75
|
+
#define kFilterFactor 0.05f
|
76
|
+
|
77
|
+
/*
|
78
|
+
static float prevX = 0;
|
79
|
+
static float prevY = 0;
|
80
|
+
static float prevZ = 0;
|
81
|
+
|
82
|
+
float accelX = (float)acceleration.x * kFilterFactor + (1.0f - kFilterFactor) * prevX;
|
83
|
+
float accelY = (float)acceleration.y * kFilterFactor + (1.0f - kFilterFactor) * prevY;
|
84
|
+
float accelZ = (float)acceleration.z * kFilterFactor + (1.0f - kFilterFactor) * prevZ;
|
85
|
+
|
86
|
+
prevX = accelX;
|
87
|
+
prevY = accelY;
|
88
|
+
prevZ = accelZ;
|
89
|
+
|
90
|
+
CC( @"accelerometer, x = %f, y = %f, z = %f", accelX, accelY, accelZ );
|
91
|
+
*/
|
92
|
+
|
93
|
+
// Get the current device angle
|
94
|
+
float xxx = -[acceleration x];
|
95
|
+
float yyy = [acceleration y];
|
96
|
+
float angle = atan2(yyy, xxx);
|
97
|
+
|
98
|
+
UIInterfaceOrientation newOrient;
|
99
|
+
|
100
|
+
CC( @"accelerometer, angel = %f", angle );
|
101
|
+
|
102
|
+
// Read my blog for more details on the angles. It should be obvious that you
|
103
|
+
// could fire a custom shouldAutorotateToInterfaceOrientation-event here.
|
104
|
+
if ( angle >= -2.25 && angle <= -0.75 )
|
105
|
+
{
|
106
|
+
newOrient = UIInterfaceOrientationPortrait;
|
107
|
+
}
|
108
|
+
else if ( angle >= -0.75 && angle <= 0.75 )
|
109
|
+
{
|
110
|
+
newOrient = UIInterfaceOrientationLandscapeRight;
|
111
|
+
}
|
112
|
+
else if ( angle >= 0.75 && angle <= 2.25 )
|
113
|
+
{
|
114
|
+
newOrient = UIInterfaceOrientationPortraitUpsideDown;
|
115
|
+
}
|
116
|
+
else if ( angle <= -2.25 || angle >= 2.25 )
|
117
|
+
{
|
118
|
+
newOrient = UIInterfaceOrientationLandscapeLeft;
|
119
|
+
}
|
120
|
+
else
|
121
|
+
{
|
122
|
+
newOrient = UIInterfaceOrientationPortrait;
|
123
|
+
}
|
124
|
+
|
125
|
+
[self postNotification:BeeUIOrientation.ANGLE_CHANGED
|
126
|
+
withObject:[NSNumber numberWithFloat:angle]];
|
127
|
+
|
128
|
+
if ( newOrient != _orientation )
|
129
|
+
{
|
130
|
+
_orientation = newOrient;
|
131
|
+
|
132
|
+
[self postNotification:BeeUIOrientation.DIRECTION_CHANGED
|
133
|
+
withObject:[NSNumber numberWithFloat:angle]];
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
- (void)dealloc
|
138
|
+
{
|
139
|
+
[UIAccelerometer sharedAccelerometer].delegate = nil;
|
140
|
+
|
141
|
+
[super dealloc];
|
142
|
+
}
|
143
|
+
|
144
|
+
@end
|
145
|
+
|
146
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,61 @@
|
|
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_UIPageControl.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UISignal.h"
|
37
|
+
|
38
|
+
#pragma mark -
|
39
|
+
|
40
|
+
@interface BeeUIPageControl : UIPageControl
|
41
|
+
{
|
42
|
+
UIImage * _dotImageNormal;
|
43
|
+
UIImage * _dotImageHilite;
|
44
|
+
NSArray * _dotImageNormals;
|
45
|
+
NSArray * _dotImageHilites;
|
46
|
+
NSArray * _dotImageSizes;
|
47
|
+
CGSize _dotSize;
|
48
|
+
}
|
49
|
+
@property (nonatomic,retain) NSArray *dotImageNormals;
|
50
|
+
@property (nonatomic,retain) NSArray *dotImageHilites;
|
51
|
+
@property (nonatomic, retain) UIImage * dotImageNormal;
|
52
|
+
@property (nonatomic, retain) UIImage * dotImageHilite;
|
53
|
+
@property (nonatomic, assign) CGSize dotSize;
|
54
|
+
@property (nonatomic, retain) NSArray *dotImageSizes;
|
55
|
+
|
56
|
+
+ (BeeUIPageControl *)spawn;
|
57
|
+
+ (BeeUIPageControl *)spawn:(NSString *)tagString;
|
58
|
+
|
59
|
+
@end
|
60
|
+
|
61
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,190 @@
|
|
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_UIPageControl.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "Bee_UIPageControl.h"
|
37
|
+
#import "Bee_UISignal.h"
|
38
|
+
#import "Bee_SystemInfo.h"
|
39
|
+
#import "UIView+BeeExtension.h"
|
40
|
+
|
41
|
+
#pragma mark -
|
42
|
+
|
43
|
+
@interface BeeUIPageControl(Private)
|
44
|
+
- (void)initSelf;
|
45
|
+
- (void)updateDotImages;
|
46
|
+
@end
|
47
|
+
|
48
|
+
@implementation BeeUIPageControl
|
49
|
+
@synthesize dotImageNormals = _dotImageNormals;
|
50
|
+
@synthesize dotImageNormal = _dotImageNormal;
|
51
|
+
@synthesize dotImageHilites = _dotImageHilites;
|
52
|
+
@synthesize dotImageHilite = _dotImageHilite;
|
53
|
+
@synthesize dotImageSizes = _dotImageSizes;
|
54
|
+
@synthesize dotSize = _dotSize;
|
55
|
+
|
56
|
+
+ (BeeUIPageControl *)spawn
|
57
|
+
{
|
58
|
+
return [[[BeeUIPageControl alloc] init] autorelease];
|
59
|
+
}
|
60
|
+
|
61
|
+
+ (BeeUIPageControl *)spawn:(NSString *)tagString
|
62
|
+
{
|
63
|
+
BeeUIPageControl * view = [[[BeeUIPageControl alloc] init] autorelease];
|
64
|
+
view.tagString = tagString;
|
65
|
+
return view;
|
66
|
+
}
|
67
|
+
|
68
|
+
- (id)init
|
69
|
+
{
|
70
|
+
self = [super initWithFrame:CGRectZero];
|
71
|
+
if ( self )
|
72
|
+
{
|
73
|
+
[self initSelf];
|
74
|
+
}
|
75
|
+
return self;
|
76
|
+
}
|
77
|
+
|
78
|
+
- (id)initWithFrame:(CGRect)frame
|
79
|
+
{
|
80
|
+
self = [super initWithFrame:frame];
|
81
|
+
if ( self )
|
82
|
+
{
|
83
|
+
[self initSelf];
|
84
|
+
}
|
85
|
+
return self;
|
86
|
+
}
|
87
|
+
|
88
|
+
- (void)initSelf
|
89
|
+
{
|
90
|
+
self.numberOfPages = 0;
|
91
|
+
self.currentPage = 0;
|
92
|
+
self.hidesForSinglePage = YES;
|
93
|
+
self.defersCurrentPageDisplay = NO;
|
94
|
+
}
|
95
|
+
|
96
|
+
- (CGSize)sizeForNumberOfPages:(NSInteger)pageCount
|
97
|
+
{
|
98
|
+
return _dotSize;
|
99
|
+
}
|
100
|
+
|
101
|
+
- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
|
102
|
+
{
|
103
|
+
[super endTrackingWithTouch:touch withEvent:event];
|
104
|
+
[self updateDotImages];
|
105
|
+
}
|
106
|
+
|
107
|
+
- (void)updateDotImages
|
108
|
+
{
|
109
|
+
NSUInteger index = 0;
|
110
|
+
for ( UIView * subView in self.subviews )
|
111
|
+
{
|
112
|
+
if ( [subView isKindOfClass:[UIImageView class]] )
|
113
|
+
{
|
114
|
+
UIImageView * imageView = (UIImageView *)subView;
|
115
|
+
if ( self.currentPage == index )
|
116
|
+
{
|
117
|
+
if (self.dotImageHilites && [self.dotImageHilites count]> self.currentPage && [self.dotImageHilites objectAtIndex:self.currentPage] != [NSNull null]) {
|
118
|
+
imageView.image = [self.dotImageHilites objectAtIndex:self.currentPage];
|
119
|
+
if (self.dotImageSizes && [self.dotImageSizes count]>self.currentPage) {
|
120
|
+
NSNumber *number = [self.dotImageSizes objectAtIndex:self.currentPage];
|
121
|
+
CGSize size = [number CGSizeValue];
|
122
|
+
imageView.frame = CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y, size.width, size.height);
|
123
|
+
}
|
124
|
+
}else if ( self.dotImageHilite )
|
125
|
+
{
|
126
|
+
imageView.image = self.dotImageHilite;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
else
|
130
|
+
{
|
131
|
+
|
132
|
+
if (self.dotImageNormals && [self.dotImageNormals count]> index && [self.dotImageNormals objectAtIndex:self.currentPage] != [NSNull null]) {
|
133
|
+
|
134
|
+
imageView.image = [self.dotImageNormals objectAtIndex:index];
|
135
|
+
if (self.dotImageSizes && [self.dotImageSizes count]>index) {
|
136
|
+
NSNumber *number = [self.dotImageSizes objectAtIndex:index];
|
137
|
+
CGSize size = [number CGSizeValue];
|
138
|
+
imageView.frame = CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y, size.width, size.height);
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
}else if ( self.dotImageNormal )
|
143
|
+
{
|
144
|
+
imageView.image = self.dotImageNormal;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
index += 1;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
-(void) setDotImageNormals:(NSArray *)dotImageNormals{
|
154
|
+
[_dotImageNormals release];
|
155
|
+
_dotImageNormals = [dotImageNormals retain];
|
156
|
+
[self updateDotImages];
|
157
|
+
}
|
158
|
+
|
159
|
+
-(void) setDotImageHilites:(NSArray *)dotImageHilites{
|
160
|
+
[_dotImageHilites release];
|
161
|
+
_dotImageHilites = [dotImageHilites retain];
|
162
|
+
[self updateDotImages];
|
163
|
+
}
|
164
|
+
|
165
|
+
-(void) setDotImageSizes:(NSArray *)dotImageSizes{
|
166
|
+
[_dotImageSizes release];
|
167
|
+
_dotImageSizes = [dotImageSizes retain];
|
168
|
+
[self updateDotImages];
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
-(void) setCurrentPage:(NSInteger)page{
|
173
|
+
[super setCurrentPage:page];
|
174
|
+
[self updateDotImages];
|
175
|
+
}
|
176
|
+
|
177
|
+
- (void)dealloc
|
178
|
+
{
|
179
|
+
[_dotImageNormal release];
|
180
|
+
[_dotImageHilite release];
|
181
|
+
[_dotImageNormals release];
|
182
|
+
[_dotImageHilites release];
|
183
|
+
[_dotImageSizes release];
|
184
|
+
|
185
|
+
[super dealloc];
|
186
|
+
}
|
187
|
+
|
188
|
+
@end
|
189
|
+
|
190
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|