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,509 @@
|
|
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
|
+
// NSDictionary+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Runtime.h"
|
35
|
+
#import "NSDictionary+BeeExtension.h"
|
36
|
+
#import "NSObject+BeeTypeConversion.h"
|
37
|
+
|
38
|
+
#include <objc/runtime.h>
|
39
|
+
|
40
|
+
#pragma mark -
|
41
|
+
|
42
|
+
@implementation NSDictionary(BeeExtension)
|
43
|
+
|
44
|
+
- (NSDictionaryAppendBlock)APPEND
|
45
|
+
{
|
46
|
+
NSDictionaryAppendBlock block = ^ NSDictionary * ( NSString * key, id value )
|
47
|
+
{
|
48
|
+
if ( key && value )
|
49
|
+
{
|
50
|
+
NSString * className = [[self class] description];
|
51
|
+
|
52
|
+
if ( [className isEqualToString:@"NSMutableDictionary"] )
|
53
|
+
{
|
54
|
+
[(NSMutableDictionary *)self setObject:value atPath:key];
|
55
|
+
return self;
|
56
|
+
}
|
57
|
+
else
|
58
|
+
{
|
59
|
+
NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:self];
|
60
|
+
[dict setObject:value atPath:key];
|
61
|
+
return dict;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
return self;
|
66
|
+
};
|
67
|
+
|
68
|
+
return [[block copy] autorelease];
|
69
|
+
}
|
70
|
+
|
71
|
+
- (NSObject *)objectOfAny:(NSArray *)array
|
72
|
+
{
|
73
|
+
for ( NSString * key in array )
|
74
|
+
{
|
75
|
+
NSObject * obj = [self objectForKey:key];
|
76
|
+
if ( obj )
|
77
|
+
return obj;
|
78
|
+
}
|
79
|
+
|
80
|
+
return nil;
|
81
|
+
}
|
82
|
+
|
83
|
+
- (NSString *)stringOfAny:(NSArray *)array
|
84
|
+
{
|
85
|
+
NSObject * obj = [self objectOfAny:array];
|
86
|
+
if ( obj && [obj isKindOfClass:[NSString class]] )
|
87
|
+
return (NSString *)obj;
|
88
|
+
|
89
|
+
return nil;
|
90
|
+
}
|
91
|
+
|
92
|
+
- (NSObject *)objectAtPath:(NSString *)path
|
93
|
+
{
|
94
|
+
return [self objectAtPath:path separator:nil];
|
95
|
+
}
|
96
|
+
|
97
|
+
- (NSObject *)objectAtPath:(NSString *)path separator:(NSString *)separator
|
98
|
+
{
|
99
|
+
if ( nil == separator )
|
100
|
+
{
|
101
|
+
path = [path stringByReplacingOccurrencesOfString:@"." withString:@"/"];
|
102
|
+
separator = @"/";
|
103
|
+
}
|
104
|
+
|
105
|
+
#if 1
|
106
|
+
|
107
|
+
NSArray * array = [path componentsSeparatedByString:separator];
|
108
|
+
if ( 0 == [array count] )
|
109
|
+
{
|
110
|
+
return nil;
|
111
|
+
}
|
112
|
+
|
113
|
+
NSObject * result = nil;
|
114
|
+
NSDictionary * dict = self;
|
115
|
+
|
116
|
+
for ( NSString * subPath in array )
|
117
|
+
{
|
118
|
+
if ( 0 == [subPath length] )
|
119
|
+
continue;
|
120
|
+
|
121
|
+
result = [dict objectForKey:subPath];
|
122
|
+
if ( nil == result )
|
123
|
+
return nil;
|
124
|
+
|
125
|
+
if ( [array lastObject] == subPath )
|
126
|
+
{
|
127
|
+
return result;
|
128
|
+
}
|
129
|
+
else if ( NO == [result isKindOfClass:[NSDictionary class]] )
|
130
|
+
{
|
131
|
+
return nil;
|
132
|
+
}
|
133
|
+
|
134
|
+
dict = (NSDictionary *)result;
|
135
|
+
}
|
136
|
+
|
137
|
+
return (result == [NSNull null]) ? nil : result;
|
138
|
+
|
139
|
+
#else
|
140
|
+
|
141
|
+
// thanks @lancy, changed: use native keyPath
|
142
|
+
|
143
|
+
NSString * keyPath = [path stringByReplacingOccurrencesOfString:separator withString:@"."];
|
144
|
+
NSRange range = NSMakeRange( 0, 1 );
|
145
|
+
|
146
|
+
if ( [[keyPath substringWithRange:range] isEqualToString:@"."] )
|
147
|
+
{
|
148
|
+
keyPath = [keyPath substringFromIndex:1];
|
149
|
+
}
|
150
|
+
|
151
|
+
NSObject * result = [self valueForKeyPath:keyPath];
|
152
|
+
return (result == [NSNull null]) ? nil : result;
|
153
|
+
|
154
|
+
#endif
|
155
|
+
}
|
156
|
+
|
157
|
+
- (NSObject *)objectAtPath:(NSString *)path otherwise:(NSObject *)other
|
158
|
+
{
|
159
|
+
NSObject * obj = [self objectAtPath:path];
|
160
|
+
return obj ? obj : other;
|
161
|
+
}
|
162
|
+
|
163
|
+
- (NSObject *)objectAtPath:(NSString *)path otherwise:(NSObject *)other separator:(NSString *)separator
|
164
|
+
{
|
165
|
+
NSObject * obj = [self objectAtPath:path separator:separator];
|
166
|
+
return obj ? obj : other;
|
167
|
+
}
|
168
|
+
|
169
|
+
- (BOOL)boolAtPath:(NSString *)path
|
170
|
+
{
|
171
|
+
return [self boolAtPath:path otherwise:NO];
|
172
|
+
}
|
173
|
+
|
174
|
+
- (BOOL)boolAtPath:(NSString *)path otherwise:(BOOL)other
|
175
|
+
{
|
176
|
+
NSObject * obj = [self objectAtPath:path];
|
177
|
+
if ( [obj isKindOfClass:[NSNull class]] )
|
178
|
+
{
|
179
|
+
return NO;
|
180
|
+
}
|
181
|
+
else if ( [obj isKindOfClass:[NSNumber class]] )
|
182
|
+
{
|
183
|
+
return [(NSNumber *)obj intValue] ? YES : NO;
|
184
|
+
}
|
185
|
+
else if ( [obj isKindOfClass:[NSString class]] )
|
186
|
+
{
|
187
|
+
if ( [(NSString *)obj hasPrefix:@"y"] ||
|
188
|
+
[(NSString *)obj hasPrefix:@"Y"] ||
|
189
|
+
[(NSString *)obj hasPrefix:@"T"] ||
|
190
|
+
[(NSString *)obj hasPrefix:@"t"] ||
|
191
|
+
[(NSString *)obj isEqualToString:@"1"] )
|
192
|
+
{
|
193
|
+
// YES/Yes/yes/TRUE/Ture/true/1
|
194
|
+
return YES;
|
195
|
+
}
|
196
|
+
else
|
197
|
+
{
|
198
|
+
return NO;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
return other;
|
203
|
+
}
|
204
|
+
|
205
|
+
- (NSNumber *)numberAtPath:(NSString *)path
|
206
|
+
{
|
207
|
+
NSObject * obj = [self objectAtPath:path];
|
208
|
+
if ( [obj isKindOfClass:[NSNull class]] )
|
209
|
+
{
|
210
|
+
return nil;
|
211
|
+
}
|
212
|
+
else if ( [obj isKindOfClass:[NSNumber class]] )
|
213
|
+
{
|
214
|
+
return (NSNumber *)obj;
|
215
|
+
}
|
216
|
+
else if ( [obj isKindOfClass:[NSString class]] )
|
217
|
+
{
|
218
|
+
return [NSNumber numberWithDouble:[(NSString *)obj doubleValue]];
|
219
|
+
}
|
220
|
+
|
221
|
+
return nil;
|
222
|
+
}
|
223
|
+
|
224
|
+
- (NSNumber *)numberAtPath:(NSString *)path otherwise:(NSNumber *)other
|
225
|
+
{
|
226
|
+
NSNumber * obj = [self numberAtPath:path];
|
227
|
+
return obj ? obj : other;
|
228
|
+
}
|
229
|
+
|
230
|
+
- (NSString *)stringAtPath:(NSString *)path
|
231
|
+
{
|
232
|
+
NSObject * obj = [self objectAtPath:path];
|
233
|
+
if ( [obj isKindOfClass:[NSNull class]] )
|
234
|
+
{
|
235
|
+
return nil;
|
236
|
+
}
|
237
|
+
else if ( [obj isKindOfClass:[NSNumber class]] )
|
238
|
+
{
|
239
|
+
return [NSString stringWithFormat:@"%d", [(NSNumber *)obj intValue]];
|
240
|
+
}
|
241
|
+
else if ( [obj isKindOfClass:[NSString class]] )
|
242
|
+
{
|
243
|
+
return (NSString *)obj;
|
244
|
+
}
|
245
|
+
|
246
|
+
return nil;
|
247
|
+
}
|
248
|
+
|
249
|
+
- (NSString *)stringAtPath:(NSString *)path otherwise:(NSString *)other
|
250
|
+
{
|
251
|
+
NSString * obj = [self stringAtPath:path];
|
252
|
+
return obj ? obj : other;
|
253
|
+
}
|
254
|
+
|
255
|
+
- (NSArray *)arrayAtPath:(NSString *)path
|
256
|
+
{
|
257
|
+
NSObject * obj = [self objectAtPath:path];
|
258
|
+
return [obj isKindOfClass:[NSArray class]] ? (NSArray *)obj : nil;
|
259
|
+
}
|
260
|
+
|
261
|
+
- (NSArray *)arrayAtPath:(NSString *)path otherwise:(NSArray *)other
|
262
|
+
{
|
263
|
+
NSArray * obj = [self arrayAtPath:path];
|
264
|
+
return obj ? obj : other;
|
265
|
+
}
|
266
|
+
|
267
|
+
- (NSMutableArray *)mutableArrayAtPath:(NSString *)path
|
268
|
+
{
|
269
|
+
NSObject * obj = [self objectAtPath:path];
|
270
|
+
return [obj isKindOfClass:[NSMutableArray class]] ? (NSMutableArray *)obj : nil;
|
271
|
+
}
|
272
|
+
|
273
|
+
- (NSMutableArray *)mutableArrayAtPath:(NSString *)path otherwise:(NSMutableArray *)other
|
274
|
+
{
|
275
|
+
NSMutableArray * obj = [self mutableArrayAtPath:path];
|
276
|
+
return obj ? obj : other;
|
277
|
+
}
|
278
|
+
|
279
|
+
- (NSDictionary *)dictAtPath:(NSString *)path
|
280
|
+
{
|
281
|
+
NSObject * obj = [self objectAtPath:path];
|
282
|
+
return [obj isKindOfClass:[NSDictionary class]] ? (NSDictionary *)obj : nil;
|
283
|
+
}
|
284
|
+
|
285
|
+
- (NSDictionary *)dictAtPath:(NSString *)path otherwise:(NSDictionary *)other
|
286
|
+
{
|
287
|
+
NSDictionary * obj = [self dictAtPath:path];
|
288
|
+
return obj ? obj : other;
|
289
|
+
}
|
290
|
+
|
291
|
+
- (NSMutableDictionary *)mutableDictAtPath:(NSString *)path
|
292
|
+
{
|
293
|
+
NSObject * obj = [self objectAtPath:path];
|
294
|
+
return [obj isKindOfClass:[NSMutableDictionary class]] ? (NSMutableDictionary *)obj : nil;
|
295
|
+
}
|
296
|
+
|
297
|
+
- (NSMutableDictionary *)mutableDictAtPath:(NSString *)path otherwise:(NSMutableDictionary *)other
|
298
|
+
{
|
299
|
+
NSMutableDictionary * obj = [self mutableDictAtPath:path];
|
300
|
+
return obj ? obj : other;
|
301
|
+
}
|
302
|
+
|
303
|
+
// thanks to @ilikeido
|
304
|
+
- (NSObject *)objectForClass:(Class)clazz
|
305
|
+
{
|
306
|
+
if ( [clazz respondsToSelector:@selector(initFromDictionary:)] )
|
307
|
+
{
|
308
|
+
return [clazz performSelector:@selector(initFromDictionary:) withObject:self];
|
309
|
+
}
|
310
|
+
|
311
|
+
id object = [[clazz alloc] init];
|
312
|
+
|
313
|
+
NSUInteger propertyCount = 0;
|
314
|
+
objc_property_t * properties = class_copyPropertyList( clazz, &propertyCount );
|
315
|
+
|
316
|
+
for ( NSUInteger i = 0; i < propertyCount; i++ )
|
317
|
+
{
|
318
|
+
const char * name = property_getName(properties[i]);
|
319
|
+
NSString * propertyName = [NSString stringWithCString:name encoding:NSUTF8StringEncoding];
|
320
|
+
const char * attr = property_getAttributes(properties[i]);
|
321
|
+
NSUInteger type = [BeeTypeEncoding typeOf:attr];
|
322
|
+
|
323
|
+
NSObject * tempValue = [self objectForKey:propertyName];
|
324
|
+
NSObject * value = nil;
|
325
|
+
|
326
|
+
if ( tempValue )
|
327
|
+
{
|
328
|
+
if ( BeeTypeEncoding.NSNUMBER == type )
|
329
|
+
{
|
330
|
+
value = [tempValue asNSNumber];
|
331
|
+
}
|
332
|
+
else if ( BeeTypeEncoding.NSSTRING == type )
|
333
|
+
{
|
334
|
+
value = [tempValue asNSString];
|
335
|
+
}
|
336
|
+
else if ( BeeTypeEncoding.NSDATE == type )
|
337
|
+
{
|
338
|
+
value = [tempValue asNSDate];
|
339
|
+
}
|
340
|
+
else if ( BeeTypeEncoding.NSARRAY == type )
|
341
|
+
{
|
342
|
+
if ( [tempValue isKindOfClass:[NSArray class]] )
|
343
|
+
{
|
344
|
+
SEL seltemp = NSSelectorFromString( [NSString stringWithFormat:@"%@ConvertClass", propertyName] );
|
345
|
+
if ( [clazz respondsToSelector:seltemp] )
|
346
|
+
{
|
347
|
+
Class classTemp = [clazz performSelector:seltemp];
|
348
|
+
NSMutableArray * arrayTemp = [NSMutableArray array];
|
349
|
+
|
350
|
+
for ( NSObject * tempObject in (NSArray *)tempValue )
|
351
|
+
{
|
352
|
+
if ( [tempObject isKindOfClass:[NSDictionary class]] )
|
353
|
+
{
|
354
|
+
[arrayTemp addObject:[(NSDictionary *)tempObject objectForClass:classTemp]];
|
355
|
+
}
|
356
|
+
}
|
357
|
+
|
358
|
+
value = arrayTemp;
|
359
|
+
}
|
360
|
+
else
|
361
|
+
{
|
362
|
+
value = tempValue;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
else if ( BeeTypeEncoding.NSDICTIONARY == type )
|
367
|
+
{
|
368
|
+
if ( [tempValue isKindOfClass:[NSDictionary class]] )
|
369
|
+
{
|
370
|
+
value = tempValue;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
else if ( BeeTypeEncoding.OBJECT == type )
|
374
|
+
{
|
375
|
+
NSString * className = [BeeTypeEncoding classNameOf:attr];
|
376
|
+
if ( [tempValue isKindOfClass:NSClassFromString(className)] )
|
377
|
+
{
|
378
|
+
value = tempValue;
|
379
|
+
}
|
380
|
+
else if ( [tempValue isKindOfClass:[NSDictionary class]] )
|
381
|
+
{
|
382
|
+
value = [(NSDictionary *)tempValue objectForClass:NSClassFromString(className)];
|
383
|
+
}
|
384
|
+
}
|
385
|
+
}
|
386
|
+
|
387
|
+
[object setValue:value forKey:propertyName];
|
388
|
+
}
|
389
|
+
|
390
|
+
free( properties );
|
391
|
+
|
392
|
+
return [object autorelease];
|
393
|
+
}
|
394
|
+
|
395
|
+
@end
|
396
|
+
|
397
|
+
#pragma mark -
|
398
|
+
|
399
|
+
@implementation NSMutableDictionary(BeeExtension)
|
400
|
+
|
401
|
+
- (BOOL)setObject:(NSObject *)obj atPath:(NSString *)path
|
402
|
+
{
|
403
|
+
return [self setObject:obj atPath:path separator:nil];
|
404
|
+
}
|
405
|
+
|
406
|
+
- (BOOL)setObject:(NSObject *)obj atPath:(NSString *)path separator:(NSString *)separator
|
407
|
+
{
|
408
|
+
if ( 0 == [path length] )
|
409
|
+
return NO;
|
410
|
+
|
411
|
+
if ( nil == separator )
|
412
|
+
{
|
413
|
+
path = [path stringByReplacingOccurrencesOfString:@"." withString:@"/"];
|
414
|
+
separator = @"/";
|
415
|
+
}
|
416
|
+
|
417
|
+
NSArray * array = [path componentsSeparatedByString:separator];
|
418
|
+
if ( 0 == [array count] )
|
419
|
+
{
|
420
|
+
[self setObject:obj forKey:path];
|
421
|
+
return YES;
|
422
|
+
}
|
423
|
+
|
424
|
+
NSMutableDictionary * upperDict = self;
|
425
|
+
NSDictionary * dict = nil;
|
426
|
+
NSString * subPath = nil;
|
427
|
+
|
428
|
+
for ( subPath in array )
|
429
|
+
{
|
430
|
+
if ( 0 == [subPath length] )
|
431
|
+
continue;
|
432
|
+
|
433
|
+
if ( [array lastObject] == subPath )
|
434
|
+
break;
|
435
|
+
|
436
|
+
dict = [upperDict objectForKey:subPath];
|
437
|
+
if ( nil == dict )
|
438
|
+
{
|
439
|
+
dict = [NSMutableDictionary dictionary];
|
440
|
+
[upperDict setObject:dict forKey:subPath];
|
441
|
+
}
|
442
|
+
else
|
443
|
+
{
|
444
|
+
if ( NO == [dict isKindOfClass:[NSDictionary class]] )
|
445
|
+
return NO;
|
446
|
+
|
447
|
+
if ( NO == [dict isKindOfClass:[NSMutableDictionary class]] )
|
448
|
+
{
|
449
|
+
dict = [NSMutableDictionary dictionaryWithDictionary:dict];
|
450
|
+
[upperDict setObject:dict forKey:subPath];
|
451
|
+
}
|
452
|
+
}
|
453
|
+
|
454
|
+
upperDict = (NSMutableDictionary *)dict;
|
455
|
+
}
|
456
|
+
|
457
|
+
[upperDict setObject:obj forKey:subPath];
|
458
|
+
return YES;
|
459
|
+
}
|
460
|
+
|
461
|
+
- (BOOL)setKeyValues:(id)first, ...
|
462
|
+
{
|
463
|
+
va_list args;
|
464
|
+
va_start( args, first );
|
465
|
+
|
466
|
+
for ( ;; first = nil )
|
467
|
+
{
|
468
|
+
NSObject * key = first ? first : va_arg( args, NSObject * );
|
469
|
+
if ( nil == key || NO == [key isKindOfClass:[NSString class]] )
|
470
|
+
break;
|
471
|
+
|
472
|
+
NSObject * value = va_arg( args, NSObject * );
|
473
|
+
if ( nil == value )
|
474
|
+
break;
|
475
|
+
|
476
|
+
BOOL ret = [self setObject:value atPath:(NSString *)key];
|
477
|
+
if ( NO == ret ) {
|
478
|
+
va_end( args );
|
479
|
+
return NO;
|
480
|
+
}
|
481
|
+
}
|
482
|
+
va_end( args );
|
483
|
+
return YES;
|
484
|
+
}
|
485
|
+
|
486
|
+
+ (NSMutableDictionary *)keyValues:(id)first, ...
|
487
|
+
{
|
488
|
+
NSMutableDictionary * dict = [NSMutableDictionary dictionary];
|
489
|
+
|
490
|
+
va_list args;
|
491
|
+
va_start( args, first );
|
492
|
+
|
493
|
+
for ( ;; first = nil )
|
494
|
+
{
|
495
|
+
NSObject * key = first ? first : va_arg( args, NSObject * );
|
496
|
+
if ( nil == key || NO == [key isKindOfClass:[NSString class]] )
|
497
|
+
break;
|
498
|
+
|
499
|
+
NSObject * value = va_arg( args, NSObject * );
|
500
|
+
if ( nil == value )
|
501
|
+
break;
|
502
|
+
|
503
|
+
[dict setObject:value atPath:(NSString *)key];
|
504
|
+
}
|
505
|
+
va_end( args );
|
506
|
+
return dict;
|
507
|
+
}
|
508
|
+
|
509
|
+
@end
|
@@ -0,0 +1,50 @@
|
|
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
|
+
// NSNumber+BeeExtension.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
|
35
|
+
#pragma mark -
|
36
|
+
|
37
|
+
#define __INT( __x ) [NSNumber numberWithInt:(NSInteger)__x]
|
38
|
+
#define __UINT( __x ) [NSNumber numberWithUnsignedInt:(NSUInteger)__x]
|
39
|
+
#define __FLOAT( __x ) [NSNumber numberWithFloat:(float)__x]
|
40
|
+
#define __DOUBLE( __x ) [NSNumber numberWithDouble:(double)__x]
|
41
|
+
|
42
|
+
#pragma mark -
|
43
|
+
|
44
|
+
@interface NSNumber(BeeExtension)
|
45
|
+
|
46
|
+
@property (nonatomic, readonly) NSDate * date;
|
47
|
+
|
48
|
+
- (NSString *)stringWithDateFormat:(NSString *)format;
|
49
|
+
|
50
|
+
@end
|
@@ -0,0 +1,64 @@
|
|
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
|
+
// NSNumber+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "NSNumber+BeeExtension.h"
|
35
|
+
|
36
|
+
@implementation NSNumber(BeeExtension)
|
37
|
+
|
38
|
+
@dynamic date;
|
39
|
+
|
40
|
+
- (NSDate *)date
|
41
|
+
{
|
42
|
+
return [NSDate dateWithTimeIntervalSince1970:self.doubleValue];
|
43
|
+
}
|
44
|
+
|
45
|
+
- (NSString *)stringWithDateFormat:(NSString *)format
|
46
|
+
{
|
47
|
+
#if 0
|
48
|
+
|
49
|
+
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
|
50
|
+
[dateFormatter setDateFormat:format];
|
51
|
+
NSString * result = [dateFormatter stringFromDate:[NSDate dateWithTimeIntervalSince1970:[self doubleValue]]];
|
52
|
+
[dateFormatter release];
|
53
|
+
return result;
|
54
|
+
|
55
|
+
#else
|
56
|
+
|
57
|
+
// thanks @lancy, changed: "NSDate depend on NSNumber" to "NSNumber depend on NSDate"
|
58
|
+
|
59
|
+
return [[NSDate dateWithTimeIntervalSince1970:[self doubleValue]] stringWithDateFormat:format];
|
60
|
+
|
61
|
+
#endif
|
62
|
+
}
|
63
|
+
|
64
|
+
@end
|
@@ -0,0 +1,43 @@
|
|
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
|
+
// NSObject+BeeJSON.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
|
35
|
+
#pragma mark -
|
36
|
+
|
37
|
+
@interface NSObject(BeeJSON)
|
38
|
+
|
39
|
+
- (NSData *)JSONData;
|
40
|
+
- (NSString *)JSONString;
|
41
|
+
- (NSDictionary *)JSONDictionary;
|
42
|
+
|
43
|
+
@end
|