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,464 @@
|
|
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
|
+
// NSString+BeeExtension.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "NSString+BeeExtension.h"
|
35
|
+
#import "NSData+BeeExtension.h"
|
36
|
+
#import "NSObject+BeeTypeConversion.h"
|
37
|
+
|
38
|
+
#include <objc/runtime.h>
|
39
|
+
#import <CommonCrypto/CommonDigest.h>
|
40
|
+
|
41
|
+
#pragma mark -
|
42
|
+
|
43
|
+
@implementation NSString(BeeExtension)
|
44
|
+
|
45
|
+
@dynamic data;
|
46
|
+
@dynamic date;
|
47
|
+
|
48
|
+
@dynamic MD5;
|
49
|
+
@dynamic MD5Data;
|
50
|
+
|
51
|
+
@dynamic SHA1;
|
52
|
+
|
53
|
+
@dynamic APPEND;
|
54
|
+
|
55
|
+
- (NSData *)data
|
56
|
+
{
|
57
|
+
return [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
|
58
|
+
}
|
59
|
+
|
60
|
+
- (NSDate *)date
|
61
|
+
{
|
62
|
+
NSTimeZone * local = [NSTimeZone localTimeZone];
|
63
|
+
|
64
|
+
NSString * format = @"yyyy-MM-dd HH:mm:ss";
|
65
|
+
NSString * text = [(NSString *)self substringToIndex:format.length];
|
66
|
+
|
67
|
+
NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
|
68
|
+
[dateFormatter setDateFormat:format];
|
69
|
+
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
|
70
|
+
|
71
|
+
return [NSDate dateWithTimeInterval:(3600 + [local secondsFromGMT])
|
72
|
+
sinceDate:[dateFormatter dateFromString:text]];
|
73
|
+
|
74
|
+
}
|
75
|
+
|
76
|
+
- (NSStringAppendBlock)APPEND
|
77
|
+
{
|
78
|
+
NSStringAppendBlock block = ^ NSString * ( id first, ... )
|
79
|
+
{
|
80
|
+
va_list args;
|
81
|
+
va_start( args, first );
|
82
|
+
|
83
|
+
NSString * className = [[self class] description];
|
84
|
+
|
85
|
+
if ( [className isEqualToString:@"NSMutableString"] )
|
86
|
+
{
|
87
|
+
NSString * append = [[NSString alloc] initWithFormat:first arguments:args];
|
88
|
+
[(NSMutableString *)self appendString:append];
|
89
|
+
[append release];
|
90
|
+
va_end( args );
|
91
|
+
return self;
|
92
|
+
}
|
93
|
+
else
|
94
|
+
{
|
95
|
+
NSMutableString * copy = [self mutableCopy];
|
96
|
+
|
97
|
+
NSString * append = [[NSString alloc] initWithFormat:first arguments:args];
|
98
|
+
[copy appendString:append];
|
99
|
+
[append release];
|
100
|
+
va_end( args );
|
101
|
+
return [copy autorelease];
|
102
|
+
}
|
103
|
+
};
|
104
|
+
|
105
|
+
return [[block copy] autorelease];
|
106
|
+
}
|
107
|
+
|
108
|
+
- (NSArray *)allURLs
|
109
|
+
{
|
110
|
+
NSMutableArray * array = [NSMutableArray array];
|
111
|
+
|
112
|
+
NSInteger stringIndex = 0;
|
113
|
+
while ( stringIndex < self.length )
|
114
|
+
{
|
115
|
+
NSRange searchRange = NSMakeRange(stringIndex, self.length - stringIndex);
|
116
|
+
NSRange httpRange = [self rangeOfString:@"http://" options:NSCaseInsensitiveSearch range:searchRange];
|
117
|
+
NSRange httpsRange = [self rangeOfString:@"https://" options:NSCaseInsensitiveSearch range:searchRange];
|
118
|
+
|
119
|
+
NSRange startRange;
|
120
|
+
if ( httpRange.location == NSNotFound )
|
121
|
+
{
|
122
|
+
startRange = httpsRange;
|
123
|
+
}
|
124
|
+
else if ( httpsRange.location == NSNotFound )
|
125
|
+
{
|
126
|
+
startRange = httpRange;
|
127
|
+
}
|
128
|
+
else
|
129
|
+
{
|
130
|
+
startRange = (httpRange.location < httpsRange.location) ? httpRange : httpsRange;
|
131
|
+
}
|
132
|
+
|
133
|
+
if (startRange.location == NSNotFound)
|
134
|
+
{
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
else
|
138
|
+
{
|
139
|
+
NSRange beforeRange = NSMakeRange( searchRange.location, startRange.location - searchRange.location );
|
140
|
+
if ( beforeRange.length )
|
141
|
+
{
|
142
|
+
// NSString * text = [string substringWithRange:beforeRange];
|
143
|
+
// [array addObject:text];
|
144
|
+
}
|
145
|
+
|
146
|
+
NSRange subSearchRange = NSMakeRange(startRange.location, self.length - startRange.location);
|
147
|
+
NSRange endRange = [self rangeOfString:@" " options:NSCaseInsensitiveSearch range:subSearchRange];
|
148
|
+
if ( endRange.location == NSNotFound)
|
149
|
+
{
|
150
|
+
NSString * url = [self substringWithRange:subSearchRange];
|
151
|
+
[array addObject:url];
|
152
|
+
break;
|
153
|
+
}
|
154
|
+
else
|
155
|
+
{
|
156
|
+
NSRange URLRange = NSMakeRange(startRange.location, endRange.location - startRange.location);
|
157
|
+
NSString * url = [self substringWithRange:URLRange];
|
158
|
+
[array addObject:url];
|
159
|
+
|
160
|
+
stringIndex = endRange.location;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
return array;
|
166
|
+
}
|
167
|
+
|
168
|
+
+ (NSString *)queryStringFromDictionary:(NSDictionary *)dict
|
169
|
+
{
|
170
|
+
NSMutableArray * pairs = [NSMutableArray array];
|
171
|
+
for ( NSString * key in dict.allKeys )
|
172
|
+
{
|
173
|
+
NSString * value = [((NSObject *)[dict objectForKey:key]) asNSString];
|
174
|
+
NSString * urlEncoding = [value URLEncoding];
|
175
|
+
[pairs addObject:[NSString stringWithFormat:@"%@=%@", key, urlEncoding]];
|
176
|
+
}
|
177
|
+
|
178
|
+
return [pairs componentsJoinedByString:@"&"];
|
179
|
+
}
|
180
|
+
|
181
|
+
+ (NSString *)queryStringFromArray:(NSArray *)array
|
182
|
+
{
|
183
|
+
NSMutableArray *pairs = [NSMutableArray array];
|
184
|
+
|
185
|
+
for ( NSUInteger i = 0; i < [array count]; i += 2 )
|
186
|
+
{
|
187
|
+
NSObject * obj1 = [array objectAtIndex:i];
|
188
|
+
NSObject * obj2 = [array objectAtIndex:i + 1];
|
189
|
+
|
190
|
+
NSString * key = nil;
|
191
|
+
NSString * value = nil;
|
192
|
+
|
193
|
+
if ( [obj1 isKindOfClass:[NSNumber class]] )
|
194
|
+
{
|
195
|
+
key = [(NSNumber *)obj1 stringValue];
|
196
|
+
}
|
197
|
+
else if ( [obj1 isKindOfClass:[NSString class]] )
|
198
|
+
{
|
199
|
+
key = (NSString *)obj1;
|
200
|
+
}
|
201
|
+
else
|
202
|
+
{
|
203
|
+
continue;
|
204
|
+
}
|
205
|
+
|
206
|
+
if ( [obj2 isKindOfClass:[NSNumber class]] )
|
207
|
+
{
|
208
|
+
value = [(NSNumber *)obj2 stringValue];
|
209
|
+
}
|
210
|
+
else if ( [obj1 isKindOfClass:[NSString class]] )
|
211
|
+
{
|
212
|
+
value = (NSString *)obj2;
|
213
|
+
}
|
214
|
+
else
|
215
|
+
{
|
216
|
+
continue;
|
217
|
+
}
|
218
|
+
|
219
|
+
NSString * urlEncoding = [value URLEncoding];
|
220
|
+
[pairs addObject:[NSString stringWithFormat:@"%@=%@", key, urlEncoding]];
|
221
|
+
}
|
222
|
+
|
223
|
+
return [pairs componentsJoinedByString:@"&"];
|
224
|
+
}
|
225
|
+
|
226
|
+
+ (NSString *)queryStringFromKeyValues:(id)first, ...
|
227
|
+
{
|
228
|
+
NSMutableDictionary * dict = [NSMutableDictionary dictionary];
|
229
|
+
|
230
|
+
va_list args;
|
231
|
+
va_start( args, first );
|
232
|
+
|
233
|
+
for ( ;; )
|
234
|
+
{
|
235
|
+
NSObject<NSCopying> * key = [dict count] ? va_arg( args, NSObject * ) : first;
|
236
|
+
if ( nil == key )
|
237
|
+
break;
|
238
|
+
|
239
|
+
NSObject * value = va_arg( args, NSObject * );
|
240
|
+
if ( nil == value )
|
241
|
+
break;
|
242
|
+
|
243
|
+
[dict setObject:value forKey:key];
|
244
|
+
}
|
245
|
+
va_end( args );
|
246
|
+
return [NSString queryStringFromDictionary:dict];
|
247
|
+
}
|
248
|
+
|
249
|
+
- (NSString *)urlByAppendingDict:(NSDictionary *)params
|
250
|
+
{
|
251
|
+
NSURL * parsedURL = [NSURL URLWithString:self];
|
252
|
+
NSString * queryPrefix = parsedURL.query ? @"&" : @"?";
|
253
|
+
NSString * query = [NSString queryStringFromDictionary:params];
|
254
|
+
return [NSString stringWithFormat:@"%@%@%@", self, queryPrefix, query];
|
255
|
+
}
|
256
|
+
|
257
|
+
- (NSString *)urlByAppendingArray:(NSArray *)params
|
258
|
+
{
|
259
|
+
NSURL * parsedURL = [NSURL URLWithString:self];
|
260
|
+
NSString * queryPrefix = parsedURL.query ? @"&" : @"?";
|
261
|
+
NSString * query = [NSString queryStringFromArray:params];
|
262
|
+
return [NSString stringWithFormat:@"%@%@%@", self, queryPrefix, query];
|
263
|
+
}
|
264
|
+
|
265
|
+
- (NSString *)urlByAppendingKeyValues:(id)first, ...
|
266
|
+
{
|
267
|
+
NSMutableDictionary * dict = [NSMutableDictionary dictionary];
|
268
|
+
|
269
|
+
va_list args;
|
270
|
+
va_start( args, first );
|
271
|
+
|
272
|
+
for ( ;; )
|
273
|
+
{
|
274
|
+
NSObject<NSCopying> * key = [dict count] ? va_arg( args, NSObject * ) : first;
|
275
|
+
if ( nil == key )
|
276
|
+
break;
|
277
|
+
|
278
|
+
NSObject * value = va_arg( args, NSObject * );
|
279
|
+
if ( nil == value )
|
280
|
+
break;
|
281
|
+
|
282
|
+
[dict setObject:value forKey:key];
|
283
|
+
}
|
284
|
+
va_end( args );
|
285
|
+
return [self urlByAppendingDict:dict];
|
286
|
+
}
|
287
|
+
|
288
|
+
- (BOOL)empty
|
289
|
+
{
|
290
|
+
return [self length] > 0 ? NO : YES;
|
291
|
+
}
|
292
|
+
|
293
|
+
- (BOOL)notEmpty
|
294
|
+
{
|
295
|
+
return [self length] > 0 ? YES : NO;
|
296
|
+
}
|
297
|
+
|
298
|
+
- (BOOL)is:(NSString *)other
|
299
|
+
{
|
300
|
+
return [self isEqualToString:other];
|
301
|
+
}
|
302
|
+
|
303
|
+
- (BOOL)isNot:(NSString *)other
|
304
|
+
{
|
305
|
+
return NO == [self isEqualToString:other];
|
306
|
+
}
|
307
|
+
|
308
|
+
- (BOOL)isValueOf:(NSArray *)array
|
309
|
+
{
|
310
|
+
return [self isValueOf:array caseInsens:NO];
|
311
|
+
}
|
312
|
+
|
313
|
+
- (BOOL)isValueOf:(NSArray *)array caseInsens:(BOOL)caseInsens
|
314
|
+
{
|
315
|
+
NSStringCompareOptions option = caseInsens ? NSCaseInsensitiveSearch : 0;
|
316
|
+
|
317
|
+
for ( NSObject * obj in array )
|
318
|
+
{
|
319
|
+
if ( NO == [obj isKindOfClass:[NSString class]] )
|
320
|
+
continue;
|
321
|
+
|
322
|
+
if ( [(NSString *)obj compare:self options:option] )
|
323
|
+
return YES;
|
324
|
+
}
|
325
|
+
|
326
|
+
return NO;
|
327
|
+
}
|
328
|
+
|
329
|
+
- (NSString *)URLEncoding
|
330
|
+
{
|
331
|
+
NSString * result = (NSString *)CFURLCreateStringByAddingPercentEscapes( kCFAllocatorDefault,
|
332
|
+
(CFStringRef)self,
|
333
|
+
NULL,
|
334
|
+
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
|
335
|
+
kCFStringEncodingUTF8 );
|
336
|
+
return [result autorelease];
|
337
|
+
}
|
338
|
+
|
339
|
+
- (NSString *)URLDecoding
|
340
|
+
{
|
341
|
+
NSMutableString * string = [NSMutableString stringWithString:self];
|
342
|
+
[string replaceOccurrencesOfString:@"+"
|
343
|
+
withString:@" "
|
344
|
+
options:NSLiteralSearch
|
345
|
+
range:NSMakeRange(0, [string length])];
|
346
|
+
return [string stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
347
|
+
}
|
348
|
+
|
349
|
+
- (NSString *)MD5
|
350
|
+
{
|
351
|
+
NSData * value;
|
352
|
+
|
353
|
+
value = [NSData dataWithBytes:[self UTF8String] length:[self length]];
|
354
|
+
value = [value MD5];
|
355
|
+
|
356
|
+
if ( value )
|
357
|
+
{
|
358
|
+
char tmp[16];
|
359
|
+
unsigned char * hex = (unsigned char *)malloc( 2048 + 1 );
|
360
|
+
unsigned char * bytes = (unsigned char *)[value bytes];
|
361
|
+
unsigned long length = [value length];
|
362
|
+
|
363
|
+
hex[0] = '\0';
|
364
|
+
|
365
|
+
for ( unsigned long i = 0; i < length; ++i )
|
366
|
+
{
|
367
|
+
sprintf( tmp, "%02X", bytes[i] );
|
368
|
+
strcat( (char *)hex, tmp );
|
369
|
+
}
|
370
|
+
|
371
|
+
NSString * result = [NSString stringWithUTF8String:(const char *)hex];
|
372
|
+
free( hex );
|
373
|
+
return result;
|
374
|
+
}
|
375
|
+
else
|
376
|
+
{
|
377
|
+
return nil;
|
378
|
+
}
|
379
|
+
}
|
380
|
+
|
381
|
+
- (NSData *)MD5Data
|
382
|
+
{
|
383
|
+
// TODO:
|
384
|
+
return nil;
|
385
|
+
}
|
386
|
+
|
387
|
+
// thanks to @uxyheaven
|
388
|
+
- (NSString *)SHA1
|
389
|
+
{
|
390
|
+
const char * cstr = [self cStringUsingEncoding:NSUTF8StringEncoding];
|
391
|
+
NSData * data = [NSData dataWithBytes:cstr length:self.length];
|
392
|
+
|
393
|
+
uint8_t digest[CC_SHA1_DIGEST_LENGTH] = { 0 };
|
394
|
+
CC_SHA1( data.bytes, data.length, digest );
|
395
|
+
|
396
|
+
NSMutableString * output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];
|
397
|
+
for ( int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++ )
|
398
|
+
{
|
399
|
+
[output appendFormat:@"%02x", digest[i]];
|
400
|
+
}
|
401
|
+
|
402
|
+
return output;
|
403
|
+
}
|
404
|
+
|
405
|
+
- (NSString *)trim
|
406
|
+
{
|
407
|
+
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
408
|
+
}
|
409
|
+
|
410
|
+
- (NSString *)unwrap
|
411
|
+
{
|
412
|
+
if ( self.length >= 2 )
|
413
|
+
{
|
414
|
+
if ( self.length == 2 )
|
415
|
+
return @"";
|
416
|
+
|
417
|
+
if ( [self hasPrefix:@"\""] && [self hasSuffix:@"\""] )
|
418
|
+
{
|
419
|
+
return [self substringWithRange:NSMakeRange(1, self.length - 2)];
|
420
|
+
}
|
421
|
+
|
422
|
+
if ( [self hasPrefix:@"'"] && [self hasSuffix:@"'"] )
|
423
|
+
{
|
424
|
+
return [self substringWithRange:NSMakeRange(1, self.length - 2)];
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
return self;
|
429
|
+
}
|
430
|
+
|
431
|
+
#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
432
|
+
- (CGSize)sizeWithFont:(UIFont *)font byWidth:(CGFloat)width
|
433
|
+
{
|
434
|
+
return [self sizeWithFont:font
|
435
|
+
constrainedToSize:CGSizeMake(width, 999999.0f)
|
436
|
+
lineBreakMode:UILineBreakModeWordWrap];
|
437
|
+
}
|
438
|
+
|
439
|
+
- (CGSize)sizeWithFont:(UIFont *)font byHeight:(CGFloat)height
|
440
|
+
{
|
441
|
+
return [self sizeWithFont:font
|
442
|
+
constrainedToSize:CGSizeMake(999999.0f, height)
|
443
|
+
lineBreakMode:UILineBreakModeWordWrap];
|
444
|
+
}
|
445
|
+
#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
|
446
|
+
|
447
|
+
- (BOOL)match:(NSString *)expression
|
448
|
+
{
|
449
|
+
NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:expression
|
450
|
+
options:NSRegularExpressionCaseInsensitive
|
451
|
+
error:nil];
|
452
|
+
if ( nil == regex )
|
453
|
+
return NO;
|
454
|
+
|
455
|
+
NSUInteger numberOfMatches = [regex numberOfMatchesInString:self
|
456
|
+
options:0
|
457
|
+
range:NSMakeRange(0, self.length)];
|
458
|
+
if ( 0 == numberOfMatches )
|
459
|
+
return NO;
|
460
|
+
|
461
|
+
return YES;
|
462
|
+
}
|
463
|
+
|
464
|
+
@end
|
@@ -0,0 +1,36 @@
|
|
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_Network.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Request.h"
|
34
|
+
#import "Bee_Request.h"
|
35
|
+
#import "Bee_RequestQueue.h"
|
36
|
+
#import "NSObject+BeeRequest.h"
|
@@ -0,0 +1,33 @@
|
|
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_Network.m
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Network.h"
|
@@ -0,0 +1,144 @@
|
|
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_Request.h
|
31
|
+
//
|
32
|
+
|
33
|
+
#import "Bee_Precompile.h"
|
34
|
+
#import "Bee_Singleton.h"
|
35
|
+
#import "NSObject+BeeProperty.h"
|
36
|
+
|
37
|
+
#import "ASIHTTPRequest.h"
|
38
|
+
#import "ASIDataDecompressor.h"
|
39
|
+
#import "ASIFormDataRequest.h"
|
40
|
+
|
41
|
+
#pragma mark -
|
42
|
+
|
43
|
+
@class ASIFormDataRequest;
|
44
|
+
@class BeeRequest;
|
45
|
+
|
46
|
+
#pragma mark -
|
47
|
+
|
48
|
+
typedef void (^BeeRequestBlock)( BeeRequest * req );
|
49
|
+
typedef BeeRequest * (^BeeRequestBlockV)( void );
|
50
|
+
typedef BeeRequest * (^BeeRequestBlockN)( id key, ... );
|
51
|
+
typedef BeeRequest * (^BeeRequestBlockS)( NSString * string );
|
52
|
+
|
53
|
+
#pragma mark -
|
54
|
+
|
55
|
+
@interface BeeRequest : ASIFormDataRequest
|
56
|
+
{
|
57
|
+
NSUInteger _state;
|
58
|
+
NSMutableArray * _responders;
|
59
|
+
// id _responder;
|
60
|
+
|
61
|
+
NSInteger _errorCode;
|
62
|
+
NSMutableDictionary * _userInfo;
|
63
|
+
|
64
|
+
BOOL _sendProgressed;
|
65
|
+
BOOL _recvProgressed;
|
66
|
+
BeeRequestBlock _whenUpdate;
|
67
|
+
|
68
|
+
NSTimeInterval _initTimeStamp;
|
69
|
+
NSTimeInterval _sendTimeStamp;
|
70
|
+
NSTimeInterval _recvTimeStamp;
|
71
|
+
NSTimeInterval _doneTimeStamp;
|
72
|
+
|
73
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
74
|
+
NSMutableArray * _callstack;
|
75
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
76
|
+
}
|
77
|
+
|
78
|
+
AS_INT( STATE_CREATED );
|
79
|
+
AS_INT( STATE_SENDING );
|
80
|
+
AS_INT( STATE_RECVING );
|
81
|
+
AS_INT( STATE_FAILED );
|
82
|
+
AS_INT( STATE_SUCCEED );
|
83
|
+
AS_INT( STATE_CANCELLED );
|
84
|
+
|
85
|
+
@property (nonatomic, readonly) BeeRequestBlockN HEADER; // directly set header
|
86
|
+
@property (nonatomic, readonly) BeeRequestBlockN BODY; // directly set body
|
87
|
+
@property (nonatomic, readonly) BeeRequestBlockN PARAM; // add key value
|
88
|
+
@property (nonatomic, readonly) BeeRequestBlockN FILE; // add file data
|
89
|
+
|
90
|
+
@property (nonatomic, assign) NSUInteger state;
|
91
|
+
@property (nonatomic, retain) NSMutableArray * responders;
|
92
|
+
//@property (nonatomic, assign) id responder;
|
93
|
+
|
94
|
+
@property (nonatomic, assign) NSInteger errorCode;
|
95
|
+
@property (nonatomic, retain) NSMutableDictionary * userInfo;
|
96
|
+
|
97
|
+
@property (nonatomic, copy) BeeRequestBlock whenUpdate;
|
98
|
+
|
99
|
+
@property (nonatomic, assign) NSTimeInterval initTimeStamp;
|
100
|
+
@property (nonatomic, assign) NSTimeInterval sendTimeStamp;
|
101
|
+
@property (nonatomic, assign) NSTimeInterval recvTimeStamp;
|
102
|
+
@property (nonatomic, assign) NSTimeInterval doneTimeStamp;
|
103
|
+
|
104
|
+
@property (nonatomic, readonly) NSTimeInterval timeCostPending; // 排队等待耗时
|
105
|
+
@property (nonatomic, readonly) NSTimeInterval timeCostOverDNS; // 网络连接耗时(DNS)
|
106
|
+
@property (nonatomic, readonly) NSTimeInterval timeCostRecving; // 网络收包耗时
|
107
|
+
@property (nonatomic, readonly) NSTimeInterval timeCostOverAir; // 网络整体耗时
|
108
|
+
|
109
|
+
#if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
110
|
+
@property (nonatomic, readonly) NSMutableArray * callstack;
|
111
|
+
#endif // #if defined(__BEE_DEVELOPMENT__) && __BEE_DEVELOPMENT__
|
112
|
+
|
113
|
+
@property (nonatomic, readonly) BOOL created;
|
114
|
+
@property (nonatomic, readonly) BOOL sending;
|
115
|
+
@property (nonatomic, readonly) BOOL recving;
|
116
|
+
@property (nonatomic, readonly) BOOL failed;
|
117
|
+
@property (nonatomic, readonly) BOOL succeed;
|
118
|
+
@property (nonatomic, readonly) BOOL cancelled;
|
119
|
+
@property (nonatomic, readonly) BOOL sendProgressed;
|
120
|
+
@property (nonatomic, readonly) BOOL recvProgressed;
|
121
|
+
|
122
|
+
@property (nonatomic, readonly) CGFloat uploadPercent;
|
123
|
+
@property (nonatomic, readonly) NSUInteger uploadBytes;
|
124
|
+
@property (nonatomic, readonly) NSUInteger uploadTotalBytes;
|
125
|
+
|
126
|
+
@property (nonatomic, readonly) CGFloat downloadPercent;
|
127
|
+
@property (nonatomic, readonly) NSUInteger downloadBytes;
|
128
|
+
@property (nonatomic, readonly) NSUInteger downloadTotalBytes;
|
129
|
+
|
130
|
+
- (BOOL)is:(NSString *)url;
|
131
|
+
- (void)changeState:(NSUInteger)state;
|
132
|
+
|
133
|
+
- (BOOL)hasResponder:(id)responder;
|
134
|
+
- (void)addResponder:(id)responder;
|
135
|
+
- (void)removeResponder:(id)responder;
|
136
|
+
- (void)removeAllResponders;
|
137
|
+
|
138
|
+
- (void)callResponders;
|
139
|
+
- (void)forwardResponder:(NSObject *)obj;
|
140
|
+
|
141
|
+
- (void)updateSendProgress;
|
142
|
+
- (void)updateRecvProgress;
|
143
|
+
|
144
|
+
@end
|