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,288 @@
|
|
1
|
+
//
|
2
|
+
// ______ ______ ______
|
3
|
+
// /\ __ \ /\ ___\ /\ ___\
|
4
|
+
// \ \ __< \ \ __\_ \ \ __\_
|
5
|
+
// \ \_____\ \ \_____\ \ \_____\
|
6
|
+
// \/_____/ \/_____/ \/_____/
|
7
|
+
//
|
8
|
+
// Copyright (c) 2012 BEE creators
|
9
|
+
// http://www.whatsbug.com
|
10
|
+
//
|
11
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
12
|
+
// copy of this software and associated documentation files (the "Software"),
|
13
|
+
// to deal in the Software without restriction, including without limitation
|
14
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
15
|
+
// and/or sell copies of the Software, and to permit persons to whom the
|
16
|
+
// Software is furnished to do so, subject to the following conditions:
|
17
|
+
//
|
18
|
+
// The above copyright notice and this permission notice shall be included in
|
19
|
+
// all copies or substantial portions of the Software.
|
20
|
+
//
|
21
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
26
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
27
|
+
// IN THE SOFTWARE.
|
28
|
+
//
|
29
|
+
//
|
30
|
+
// UIView+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "CGRect+BeeExtension.h"
|
37
|
+
|
38
|
+
#pragma mark -
|
39
|
+
|
40
|
+
CGSize AspectFitSizeByWidth( CGSize size, CGFloat width )
|
41
|
+
{
|
42
|
+
float scale = size.width / width;
|
43
|
+
return CGSizeMake( size.width / scale, size.height / scale );
|
44
|
+
}
|
45
|
+
|
46
|
+
CGSize AspectFitSizeByHeight( CGSize size, CGFloat height )
|
47
|
+
{
|
48
|
+
float scale = size.height / height;
|
49
|
+
return CGSizeMake( size.width / scale, size.height / scale );
|
50
|
+
}
|
51
|
+
|
52
|
+
CGSize AspectFitSize( CGSize size, CGSize bound )
|
53
|
+
{
|
54
|
+
CGSize newSize = size;
|
55
|
+
CGFloat newScale = 1.0f;
|
56
|
+
|
57
|
+
float scaleX = bound.width / newSize.width;
|
58
|
+
float scaleY = bound.height / newSize.height;
|
59
|
+
|
60
|
+
newScale = fminf( scaleX, scaleY );
|
61
|
+
|
62
|
+
newSize.width *= newScale;
|
63
|
+
newSize.height *= newScale;
|
64
|
+
|
65
|
+
newSize.width = floorf( newSize.width );
|
66
|
+
newSize.height = floorf( newSize.height );
|
67
|
+
|
68
|
+
return newSize;
|
69
|
+
}
|
70
|
+
|
71
|
+
CGRect AspectFitRect( CGRect rect, CGRect bound )
|
72
|
+
{
|
73
|
+
CGSize newSize = AspectFitSize( rect.size, bound.size );
|
74
|
+
newSize.width = floorf( newSize.width );
|
75
|
+
newSize.height = floorf( newSize.height );
|
76
|
+
|
77
|
+
CGRect newRect;
|
78
|
+
newRect.origin.x = (bound.size.width - newSize.width) / 2;
|
79
|
+
newRect.origin.y = (bound.size.height - newSize.height) / 2;
|
80
|
+
newRect.size.width = newSize.width;
|
81
|
+
newRect.size.height = newSize.height;
|
82
|
+
|
83
|
+
return newRect;
|
84
|
+
}
|
85
|
+
|
86
|
+
CGSize AspectFillSize( CGSize size, CGSize bound )
|
87
|
+
{
|
88
|
+
CGSize newSize = size;
|
89
|
+
CGFloat newScale = 1.0f;
|
90
|
+
|
91
|
+
float scaleX = bound.width / newSize.width;
|
92
|
+
float scaleY = bound.height / newSize.height;
|
93
|
+
|
94
|
+
newScale = fmaxf( scaleX, scaleY );
|
95
|
+
|
96
|
+
newSize.width *= newScale;
|
97
|
+
newSize.height *= newScale;
|
98
|
+
newSize.width = floorf( newSize.width );
|
99
|
+
newSize.height = floorf( newSize.height );
|
100
|
+
|
101
|
+
return newSize;
|
102
|
+
}
|
103
|
+
|
104
|
+
CGRect AspectFillRect( CGRect rect, CGRect bound )
|
105
|
+
{
|
106
|
+
CGSize newSize = AspectFillSize( rect.size, bound.size );
|
107
|
+
newSize.width = floorf( newSize.width );
|
108
|
+
newSize.height = floorf( newSize.height );
|
109
|
+
|
110
|
+
CGRect newRect;
|
111
|
+
newRect.origin.x = (bound.size.width - newSize.width) / 2;
|
112
|
+
newRect.origin.y = (bound.size.height - newSize.height) / 2;
|
113
|
+
newRect.size.width = newSize.width;
|
114
|
+
newRect.size.height = newSize.height;
|
115
|
+
|
116
|
+
return newRect;
|
117
|
+
}
|
118
|
+
|
119
|
+
CGRect CGRectFromString( NSString * str )
|
120
|
+
{
|
121
|
+
CGRect rect = CGRectZero;
|
122
|
+
|
123
|
+
NSArray * array = [str componentsSeparatedByString:@","];
|
124
|
+
if ( array && array.count == 4 )
|
125
|
+
{
|
126
|
+
NSString * x = [array objectAtIndex:0];
|
127
|
+
NSString * y = [array objectAtIndex:1];
|
128
|
+
NSString * w = [array objectAtIndex:2];
|
129
|
+
NSString * h = [array objectAtIndex:3];
|
130
|
+
|
131
|
+
rect.origin.x = x.floatValue;
|
132
|
+
rect.origin.y = y.floatValue;
|
133
|
+
rect.size.width = w.floatValue;
|
134
|
+
rect.size.height = h.floatValue;
|
135
|
+
}
|
136
|
+
|
137
|
+
return rect;
|
138
|
+
}
|
139
|
+
|
140
|
+
CGPoint CGPointZeroNan( CGPoint point )
|
141
|
+
{
|
142
|
+
point.x = isnan( point.x ) ? 0.0f : point.x;
|
143
|
+
point.y = isnan( point.y ) ? 0.0f : point.y;
|
144
|
+
return point;
|
145
|
+
}
|
146
|
+
|
147
|
+
CGSize CGSizeZeroNan( CGSize size )
|
148
|
+
{
|
149
|
+
size.width = isnan( size.width ) ? 0.0f : size.width;
|
150
|
+
size.height = isnan( size.height ) ? 0.0f : size.height;
|
151
|
+
return size;
|
152
|
+
}
|
153
|
+
|
154
|
+
CGRect CGRectZeroNan( CGRect rect )
|
155
|
+
{
|
156
|
+
rect.origin = CGPointZeroNan( rect.origin );
|
157
|
+
rect.size = CGSizeZeroNan( rect.size );
|
158
|
+
return rect;
|
159
|
+
}
|
160
|
+
|
161
|
+
CGRect CGRectMakeBound( CGFloat w, CGFloat h )
|
162
|
+
{
|
163
|
+
CGRect rect;
|
164
|
+
rect.origin = CGPointZero;
|
165
|
+
rect.size.width = w;
|
166
|
+
rect.size.height = h;
|
167
|
+
return rect;
|
168
|
+
}
|
169
|
+
|
170
|
+
CGRect CGRectAlignX( CGRect rect1, CGRect rect2 )
|
171
|
+
{
|
172
|
+
rect1.origin.x = CGRectGetMidX( rect2 ) - rect1.size.width / 2.0f;
|
173
|
+
return rect1;
|
174
|
+
}
|
175
|
+
|
176
|
+
CGRect CGRectAlignY( CGRect rect1, CGRect rect2 )
|
177
|
+
{
|
178
|
+
rect1.origin.y = CGRectGetMidY( rect2 ) - rect1.size.height / 2.0f;
|
179
|
+
return rect1;
|
180
|
+
}
|
181
|
+
|
182
|
+
CGRect CGRectAlignCenter( CGRect rect1, CGRect rect2 )
|
183
|
+
{
|
184
|
+
rect1.origin.x = CGRectGetMidX( rect2 ) - rect1.size.width / 2.0f;
|
185
|
+
rect1.origin.y = CGRectGetMidY( rect2 ) - rect1.size.height / 2.0f;
|
186
|
+
return rect1;
|
187
|
+
}
|
188
|
+
|
189
|
+
CGRect CGRectAlignTop( CGRect rect1, CGRect rect2 )
|
190
|
+
{
|
191
|
+
rect1.origin.y = rect2.origin.y;
|
192
|
+
return rect1;
|
193
|
+
}
|
194
|
+
|
195
|
+
CGRect CGRectAlignBottom( CGRect rect1, CGRect rect2 )
|
196
|
+
{
|
197
|
+
rect1.origin.y = CGRectGetMaxY( rect2 ) - rect1.size.height;
|
198
|
+
return rect1;
|
199
|
+
}
|
200
|
+
|
201
|
+
CGRect CGRectAlignLeft( CGRect rect1, CGRect rect2 )
|
202
|
+
{
|
203
|
+
rect1.origin.x = rect2.origin.x;
|
204
|
+
return rect1;
|
205
|
+
}
|
206
|
+
|
207
|
+
CGRect CGRectAlignRight( CGRect rect1, CGRect rect2 )
|
208
|
+
{
|
209
|
+
rect1.origin.x = CGRectGetMaxX( rect2 ) - rect1.size.width;
|
210
|
+
return rect1;
|
211
|
+
}
|
212
|
+
|
213
|
+
CGRect CGRectAlignLeftTop( CGRect rect1, CGRect rect2 )
|
214
|
+
{
|
215
|
+
rect1.origin.x = rect2.origin.x;
|
216
|
+
rect1.origin.y = rect2.origin.y;
|
217
|
+
return rect1;
|
218
|
+
}
|
219
|
+
|
220
|
+
CGRect CGRectAlignLeftBottom( CGRect rect1, CGRect rect2 )
|
221
|
+
{
|
222
|
+
rect1.origin.x = rect2.origin.x;
|
223
|
+
rect1.origin.y = CGRectGetMaxY( rect2 ) - rect1.size.height;
|
224
|
+
return rect1;
|
225
|
+
}
|
226
|
+
|
227
|
+
CGRect CGRectAlignRightTop( CGRect rect1, CGRect rect2 )
|
228
|
+
{
|
229
|
+
rect1.origin.x = CGRectGetMaxX( rect2 ) - rect1.size.width;
|
230
|
+
rect1.origin.y = rect2.origin.y;
|
231
|
+
return rect1;
|
232
|
+
}
|
233
|
+
|
234
|
+
CGRect CGRectAlignRightBottom( CGRect rect1, CGRect rect2 )
|
235
|
+
{
|
236
|
+
rect1.origin.x = CGRectGetMaxX( rect2 ) - rect1.size.width;
|
237
|
+
rect1.origin.y = CGRectGetMaxY( rect2 ) - rect1.size.height;
|
238
|
+
return rect1;
|
239
|
+
}
|
240
|
+
|
241
|
+
CGRect CGRectCloseToTop( CGRect rect1, CGRect rect2 )
|
242
|
+
{
|
243
|
+
rect1.origin.y = CGRectGetMaxY( rect2 );
|
244
|
+
return rect1;
|
245
|
+
}
|
246
|
+
|
247
|
+
CGRect CGRectCloseToBottom( CGRect rect1, CGRect rect2 )
|
248
|
+
{
|
249
|
+
rect1.origin.y = rect2.origin.y - rect1.size.height;
|
250
|
+
return rect1;
|
251
|
+
}
|
252
|
+
|
253
|
+
CGRect CGRectCloseToLeft( CGRect rect1, CGRect rect2 )
|
254
|
+
{
|
255
|
+
rect1.origin.x = CGRectGetMaxX( rect2 );
|
256
|
+
return rect1;
|
257
|
+
}
|
258
|
+
|
259
|
+
CGRect CGRectCloseToRight( CGRect rect1, CGRect rect2 )
|
260
|
+
{
|
261
|
+
rect1.origin.x = rect2.origin.x - rect1.size.width;
|
262
|
+
return rect1;
|
263
|
+
}
|
264
|
+
|
265
|
+
CGRect CGRectMoveCenter( CGRect rect1, CGPoint offset )
|
266
|
+
{
|
267
|
+
rect1.origin.x = offset.x - rect1.size.width / 2.0f;
|
268
|
+
rect1.origin.y = offset.y - rect1.size.height / 2.0f;
|
269
|
+
return rect1;
|
270
|
+
}
|
271
|
+
|
272
|
+
CGRect CGSizeMakeBound( CGSize size )
|
273
|
+
{
|
274
|
+
CGRect rect;
|
275
|
+
rect.origin = CGPointZero;
|
276
|
+
rect.size = size;
|
277
|
+
return rect;
|
278
|
+
}
|
279
|
+
|
280
|
+
CGRect CGRectToBound( CGRect frame )
|
281
|
+
{
|
282
|
+
CGRect rect;
|
283
|
+
rect.origin = CGPointZero;
|
284
|
+
rect.size = frame.size;
|
285
|
+
return rect;
|
286
|
+
}
|
287
|
+
|
288
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,65 @@
|
|
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_UIColor.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
|
37
|
+
#pragma mark -
|
38
|
+
|
39
|
+
#undef RGB
|
40
|
+
#define RGB(R,G,B) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:1.0f]
|
41
|
+
|
42
|
+
#undef RGBA
|
43
|
+
#define RGBA(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
|
44
|
+
|
45
|
+
#undef HEX_RGB
|
46
|
+
#define HEX_RGB(V) [UIColor fromHexValue:V]
|
47
|
+
|
48
|
+
#undef HEX_RGBA
|
49
|
+
#define HEX_RGBA(V, A) [UIColor fromHexValue:V alpha:A]
|
50
|
+
|
51
|
+
#pragma mark -
|
52
|
+
|
53
|
+
@interface UIColor(BeeExtension)
|
54
|
+
|
55
|
+
+ (UIColor *)fromHexValue:(NSUInteger)hex;
|
56
|
+
+ (UIColor *)fromHexValue:(NSUInteger)hex alpha:(CGFloat)alpha;
|
57
|
+
|
58
|
+
+ (UIColor *)fromShortHexValue:(NSUInteger)hex;
|
59
|
+
+ (UIColor *)fromShortHexValue:(NSUInteger)hex alpha:(CGFloat)alpha;
|
60
|
+
|
61
|
+
+ (UIColor *)colorWithString:(NSString *)string; // {#FFF|#FFFFFF|#FFFFFFFF}{,0.6}
|
62
|
+
|
63
|
+
@end
|
64
|
+
|
65
|
+
#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
|
+
// UIColor+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "UIColor+BeeExtension.h"
|
37
|
+
#import "NSString+BeeExtension.h"
|
38
|
+
|
39
|
+
#pragma mark -
|
40
|
+
|
41
|
+
@implementation UIColor(BeeExtension)
|
42
|
+
|
43
|
+
+ (UIColor *)fromHexValue:(NSUInteger)hex
|
44
|
+
{
|
45
|
+
NSUInteger a = ((hex >> 24) & 0x000000FF);
|
46
|
+
float fa = (a * 1.0f) / 255.0f;
|
47
|
+
|
48
|
+
return [UIColor fromHexValue:hex alpha:fa];
|
49
|
+
}
|
50
|
+
|
51
|
+
+ (UIColor *)fromHexValue:(NSUInteger)hex alpha:(CGFloat)alpha
|
52
|
+
{
|
53
|
+
NSUInteger r = ((hex >> 16) & 0x000000FF);
|
54
|
+
NSUInteger g = ((hex >> 8) & 0x000000FF);
|
55
|
+
NSUInteger b = ((hex >> 0) & 0x000000FF);
|
56
|
+
|
57
|
+
float fr = (r * 1.0f) / 255.0f;
|
58
|
+
float fg = (g * 1.0f) / 255.0f;
|
59
|
+
float fb = (b * 1.0f) / 255.0f;
|
60
|
+
|
61
|
+
return [UIColor colorWithRed:fr green:fg blue:fb alpha:alpha];
|
62
|
+
}
|
63
|
+
|
64
|
+
+ (UIColor *)fromShortHexValue:(NSUInteger)hex
|
65
|
+
{
|
66
|
+
return [UIColor fromShortHexValue:hex alpha:1.0f];
|
67
|
+
}
|
68
|
+
|
69
|
+
+ (UIColor *)fromShortHexValue:(NSUInteger)hex alpha:(CGFloat)alpha
|
70
|
+
{
|
71
|
+
NSUInteger r = ((hex >> 8) & 0x0000000F);
|
72
|
+
NSUInteger g = ((hex >> 4) & 0x0000000F);
|
73
|
+
NSUInteger b = ((hex >> 0) & 0x0000000F);
|
74
|
+
|
75
|
+
float fr = (r * 1.0f) / 15.0f;
|
76
|
+
float fg = (g * 1.0f) / 15.0f;
|
77
|
+
float fb = (b * 1.0f) / 15.0f;
|
78
|
+
|
79
|
+
return [UIColor colorWithRed:fr green:fg blue:fb alpha:alpha];
|
80
|
+
}
|
81
|
+
|
82
|
+
+ (UIColor *)colorWithString:(NSString *)string
|
83
|
+
{
|
84
|
+
if ( nil == string || 0 == string.length )
|
85
|
+
return [UIColor clearColor];
|
86
|
+
|
87
|
+
string = string.trim;
|
88
|
+
|
89
|
+
NSArray * array = [string componentsSeparatedByString:@","];
|
90
|
+
NSString * color = [array objectAtIndex:0];
|
91
|
+
CGFloat alpha = 1.0f;
|
92
|
+
|
93
|
+
if ( array.count == 2 )
|
94
|
+
{
|
95
|
+
alpha = [[array objectAtIndex:1] floatValue];
|
96
|
+
}
|
97
|
+
|
98
|
+
if ( [color hasPrefix:@"#"] ) // #FFF
|
99
|
+
{
|
100
|
+
color = [color substringFromIndex:1];
|
101
|
+
|
102
|
+
if ( color.length == 3 )
|
103
|
+
{
|
104
|
+
NSUInteger hexRGB = (NSUInteger)strtol(color.UTF8String , nil, 16);;
|
105
|
+
return [UIColor fromShortHexValue:hexRGB alpha:alpha];
|
106
|
+
}
|
107
|
+
else if ( color.length == 6 )
|
108
|
+
{
|
109
|
+
NSUInteger hexRGB = (NSUInteger)strtol(color.UTF8String , nil, 16);;
|
110
|
+
return [UIColor fromHexValue:hexRGB];
|
111
|
+
}
|
112
|
+
}
|
113
|
+
else if ( [color hasPrefix:@"0x"] || [color hasPrefix:@"0X"] ) // #FFF
|
114
|
+
{
|
115
|
+
color = [color substringFromIndex:2];
|
116
|
+
|
117
|
+
if ( color.length == 8 )
|
118
|
+
{
|
119
|
+
NSUInteger hexRGB = (NSUInteger)strtol(color.UTF8String , nil, 16);;
|
120
|
+
return [UIColor fromHexValue:hexRGB];
|
121
|
+
}
|
122
|
+
else if ( color.length == 6 )
|
123
|
+
{
|
124
|
+
NSUInteger hexRGB = (NSUInteger)strtol(color.UTF8String , nil, 16);;
|
125
|
+
return [UIColor fromHexValue:hexRGB alpha:1.0f];
|
126
|
+
}
|
127
|
+
}
|
128
|
+
else
|
129
|
+
{
|
130
|
+
static NSMutableDictionary * __colors = nil;
|
131
|
+
|
132
|
+
if ( nil == __colors )
|
133
|
+
{
|
134
|
+
__colors = [[NSMutableDictionary alloc] init];
|
135
|
+
[__colors setObject:[UIColor clearColor] forKey:@"clear"];
|
136
|
+
[__colors setObject:[UIColor redColor] forKey:@"red"];
|
137
|
+
[__colors setObject:[UIColor blackColor] forKey:@"black"];
|
138
|
+
[__colors setObject:[UIColor darkGrayColor] forKey:@"darkGray"];
|
139
|
+
[__colors setObject:[UIColor lightGrayColor] forKey:@"lightGray"];
|
140
|
+
[__colors setObject:[UIColor whiteColor] forKey:@"white"];
|
141
|
+
[__colors setObject:[UIColor grayColor] forKey:@"gray"];
|
142
|
+
[__colors setObject:[UIColor redColor] forKey:@"red"];
|
143
|
+
[__colors setObject:[UIColor greenColor] forKey:@"green"];
|
144
|
+
[__colors setObject:[UIColor blueColor] forKey:@"blue"];
|
145
|
+
[__colors setObject:[UIColor cyanColor] forKey:@"cyan"];
|
146
|
+
[__colors setObject:[UIColor yellowColor] forKey:@"yellow"];
|
147
|
+
[__colors setObject:[UIColor magentaColor] forKey:@"magenta"];
|
148
|
+
[__colors setObject:[UIColor orangeColor] forKey:@"orange"];
|
149
|
+
[__colors setObject:[UIColor purpleColor] forKey:@"purple"];
|
150
|
+
[__colors setObject:[UIColor brownColor] forKey:@"brown"];
|
151
|
+
}
|
152
|
+
|
153
|
+
return [__colors objectForKey:color.lowercaseString];
|
154
|
+
}
|
155
|
+
|
156
|
+
return [UIColor clearColor];
|
157
|
+
}
|
158
|
+
|
159
|
+
@end
|
160
|
+
|
161
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,45 @@
|
|
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
|
+
// UIFont+BeeExtension.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
|
37
|
+
#pragma mark -
|
38
|
+
|
39
|
+
@interface UIFont(BeeExtension)
|
40
|
+
+ (void)setFontName:(NSString *)name;
|
41
|
+
+ (void)setBoldFontName:(NSString *)name;
|
42
|
+
+ (void)setItalicFontName:(NSString *)name;
|
43
|
+
@end
|
44
|
+
|
45
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
@@ -0,0 +1,137 @@
|
|
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
|
+
// UIFont+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
34
|
+
|
35
|
+
#import "Bee_Precompile.h"
|
36
|
+
#import "UIFont+BeeExtension.h"
|
37
|
+
|
38
|
+
#import <objc/runtime.h>
|
39
|
+
|
40
|
+
#pragma mark -
|
41
|
+
|
42
|
+
@implementation UIFont(BeeExtension)
|
43
|
+
|
44
|
+
static NSString * __fontName = nil;
|
45
|
+
static NSString * __boldFontName = nil;
|
46
|
+
static NSString * __italicFontName = nil;
|
47
|
+
|
48
|
+
+ (void)swizzle
|
49
|
+
{
|
50
|
+
static BOOL __swizzled = NO;
|
51
|
+
if ( NO == __swizzled )
|
52
|
+
{
|
53
|
+
Method method;
|
54
|
+
IMP implement;
|
55
|
+
|
56
|
+
method = class_getClassMethod( [UIFont class], @selector(systemFontOfSize:) );
|
57
|
+
implement = class_getMethodImplementation( [UIFont class], @selector(mySystemFontOfSize:) );
|
58
|
+
method_setImplementation( method, implement );
|
59
|
+
|
60
|
+
method = class_getClassMethod( [UIFont class], @selector(boldSystemFontOfSize:) );
|
61
|
+
implement = class_getMethodImplementation( [UIFont class], @selector(myBoldSystemFontOfSize:) );
|
62
|
+
method_setImplementation( method, implement );
|
63
|
+
|
64
|
+
method = class_getClassMethod( [UIFont class], @selector(italicSystemFontOfSize:) );
|
65
|
+
implement = class_getMethodImplementation( [UIFont class], @selector(myItalicSystemFontOfSize:) );
|
66
|
+
method_setImplementation( method, implement );
|
67
|
+
|
68
|
+
__swizzled = YES;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
+ (UIFont *)mySystemFontOfSize:(CGFloat)fontSize
|
73
|
+
{
|
74
|
+
if ( __fontName && [__fontName length] )
|
75
|
+
{
|
76
|
+
return [UIFont fontWithName:__fontName size:fontSize];
|
77
|
+
}
|
78
|
+
else
|
79
|
+
{
|
80
|
+
return [UIFont systemFontOfSize:fontSize];
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
+ (UIFont *)myBoldSystemFontOfSize:(CGFloat)fontSize
|
85
|
+
{
|
86
|
+
if ( __boldFontName && [__boldFontName length] )
|
87
|
+
{
|
88
|
+
return [UIFont fontWithName:__boldFontName size:fontSize];
|
89
|
+
}
|
90
|
+
else
|
91
|
+
{
|
92
|
+
return [UIFont systemFontOfSize:fontSize];
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
+ (UIFont *)myItalicSystemFontOfSize:(CGFloat)fontSize
|
97
|
+
{
|
98
|
+
if ( __italicFontName && [__italicFontName length] )
|
99
|
+
{
|
100
|
+
return [UIFont fontWithName:__italicFontName size:fontSize];
|
101
|
+
}
|
102
|
+
else
|
103
|
+
{
|
104
|
+
return [UIFont systemFontOfSize:fontSize];
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
+ (void)setFontName:(NSString *)name
|
109
|
+
{
|
110
|
+
[name retain];
|
111
|
+
[__fontName release];
|
112
|
+
__fontName = name;
|
113
|
+
|
114
|
+
[self swizzle];
|
115
|
+
}
|
116
|
+
|
117
|
+
+ (void)setBoldFontName:(NSString *)name
|
118
|
+
{
|
119
|
+
[name retain];
|
120
|
+
[__boldFontName release];
|
121
|
+
__boldFontName = name;
|
122
|
+
|
123
|
+
[self swizzle];
|
124
|
+
}
|
125
|
+
|
126
|
+
+ (void)setItalicFontName:(NSString *)name
|
127
|
+
{
|
128
|
+
[name retain];
|
129
|
+
[__italicFontName release];
|
130
|
+
__italicFontName = name;
|
131
|
+
|
132
|
+
[self swizzle];
|
133
|
+
}
|
134
|
+
|
135
|
+
@end
|
136
|
+
|
137
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|