appjam 0.1.8.8 → 0.1.8.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -62
- data/lib/appjam/generators/gist.yml +1 -1
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.pbxproj +1166 -482
- data/lib/appjam/generators/templates/blank/EiffelApplication.xcodeproj/project.xcworkspace/xcuserdata/eiffel.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/EiffelApplication-Prefix.pch.tt +26 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenu.h +52 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenu.m +412 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenuItem.h +44 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/AwesomeMenuItem.m +97 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-addbutton@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/bg-menuitem@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus-highlighted.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus-highlighted@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-plus@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-star.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/AwesomeMenu/Images/icon-star@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/CMPopTipView/CMPopTipView.h +167 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/CMPopTipView/CMPopTipView.m +639 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/FXLabel/FXLabel.h +97 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/FXLabel/FXLabel.m +1080 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/MBProgressHUD/MBProgressHUD.h +451 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/MBProgressHUD/MBProgressHUD.m +865 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FacingView.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FacingView.m +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FoldView.h +90 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/FoldView.m +316 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/MultiFoldView.h +104 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/MultiFoldView.m +516 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldConstants.h +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldNavigationController.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldNavigationController.m +88 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_left.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_left@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_right.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldResources.bundle/swipe_guide_right@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldSwipeHintView.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldSwipeHintView.m +76 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldView.h +131 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/PaperFoldView.m +941 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/Resources/swipe_guide.psd +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/Resources/swipe_guide2.psd +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.h +46 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.m +82 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/TouchThroughUIView.h +39 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/TouchThroughUIView.m +72 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/UIView+Screenshot.h +42 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/UIView+Screenshot.m +100 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/NSBubbleData.h +34 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/NSBubbleData.m +140 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleHeaderTableViewCell.h +17 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleHeaderTableViewCell.m +57 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableView.h +30 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableView.m +233 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewCell.h +19 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewCell.m +122 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTableViewDataSource.h +24 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTypingTableViewCell.h +20 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/UIBubbleTypingTableViewCell.m +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleMine.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleMine@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleSomeone.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/bubbleSomeone@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/missingAvatar.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/missingAvatar@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingMine.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingMine@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingSomeone.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIBubbleTableView/images/typingSomeone@2x.png +0 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIGlossyButton.h +124 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIGlossyButton.m +545 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIView+LayerEffects.h +22 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/UIGlossyButton/UIView+LayerEffects.m +32 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFIncrementalStore.h +344 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFIncrementalStore.m +848 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFRESTClient.h +135 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/AFIncrementalStore/AFRESTClient.m +441 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/NSString+InflectorKit.h +40 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/NSString+InflectorKit.m +36 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/TTTStringInflector.h +76 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/InflectorKit/TTTStringInflector.m +270 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/MKAnnotationView+WebCache.h +95 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/MKAnnotationView+WebCache.m +78 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDImageCache.h +144 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDImageCache.m +311 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageCompat.h +40 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageCompat.m +54 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDecoder.h +18 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDecoder.m +70 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloader.h +102 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloader.m +226 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloaderOperation.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageDownloaderOperation.m +339 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageManager.h +167 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageManager.m +244 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImageOperation.h +15 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImagePrefetcher.h +58 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/SDWebImagePrefetcher.m +127 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIButton+WebCache.h +173 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIButton+WebCache.m +129 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIImageView+WebCache.h +140 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/frameworks/SDWebImage/UIImageView+WebCache.m +84 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationProgram.h +28 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationSequence.h +28 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/CPAnimationStep.h +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationProgram.m +100 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationSequence.m +85 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CPAnimationSequence/private/CPAnimationStep.m +122 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaAsyncSocket/GCDAsyncSocket.h +1074 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaAsyncSocket/GCDAsyncSocket.m +7430 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDData.h +14 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDData.m +158 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDNumber.h +12 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDNumber.m +88 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDRange.h +56 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Categories/DDRange.m +104 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPAuthenticationRequest.h +45 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPAuthenticationRequest.m +195 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPConnection.h +119 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPConnection.m +2708 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPLogging.h +136 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPMessage.h +48 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPMessage.m +113 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPResponse.h +149 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPServer.h +205 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/HTTPServer.m +772 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.h +65 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartFormDataParser.m +529 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.h +33 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeader.m +86 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.h +23 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Mime/MultipartMessageHeaderField.m +211 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.h +75 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPAsyncFileResponse.m +405 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDataResponse.h +13 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDataResponse.m +79 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.h +52 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPDynamicFileResponse.m +292 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.h +9 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPErrorResponse.m +38 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPFileResponse.h +25 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPFileResponse.m +237 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.h +12 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/Responses/HTTPRedirectResponse.m +73 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/WebSocket.h +105 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Core/WebSocket.m +791 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.h +7 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVConnection.m +160 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.h +11 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DAVResponse.m +372 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.h +7 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/DELETEResponse.m +49 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.h +8 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/CocoaHTTPServer/Extensions/WebDAV/PUTResponse.m +69 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHpple.h +54 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHpple.m +102 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHppleElement.h +103 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/TFHppleElement.m +200 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/XPathQuery.h +10 -0
- data/lib/appjam/generators/templates/blank/EiffelApplication/libs/toolkit/hpple/XPathQuery.m +197 -0
- data/lib/appjam/version.rb +1 -1
- metadata +164 -3
Binary file
|
Binary file
|
data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.h
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import <UIKit/UIKit.h>
|
36
|
+
#import <QuartzCore/QuartzCore.h>
|
37
|
+
#import "PaperFoldConstants.h"
|
38
|
+
|
39
|
+
@interface ShadowView : UIView
|
40
|
+
@property (nonatomic, strong) NSMutableArray *colorsArray;
|
41
|
+
@property (nonatomic, strong) CAGradientLayer *gradient;
|
42
|
+
|
43
|
+
- (id)initWithFrame:(CGRect)frame foldDirection:(FoldDirection)foldDirection;
|
44
|
+
- (void)setColorArrays:(NSArray*)colors;
|
45
|
+
|
46
|
+
@end
|
data/lib/appjam/generators/templates/blank/EiffelApplication/libs/components/PaperFold/ShadowView.m
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import "ShadowView.h"
|
36
|
+
|
37
|
+
|
38
|
+
@implementation ShadowView
|
39
|
+
|
40
|
+
- (id)initWithFrame:(CGRect)frame foldDirection:(FoldDirection)foldDirection
|
41
|
+
{
|
42
|
+
self = [super initWithFrame:frame];
|
43
|
+
if (self) {
|
44
|
+
|
45
|
+
_gradient = [CAGradientLayer layer];
|
46
|
+
[_gradient setFrame:CGRectMake(0,0,frame.size.width,frame.size.height)];
|
47
|
+
if (foldDirection==FoldDirectionVertical)
|
48
|
+
{
|
49
|
+
[_gradient setStartPoint:CGPointMake(0, 1)];
|
50
|
+
[_gradient setEndPoint:CGPointMake(0, 0)];
|
51
|
+
}
|
52
|
+
else
|
53
|
+
{
|
54
|
+
[_gradient setStartPoint:CGPointMake(0, 0)];
|
55
|
+
[_gradient setEndPoint:CGPointMake(1, 0)];
|
56
|
+
}
|
57
|
+
[self.layer insertSublayer:_gradient atIndex:0];
|
58
|
+
[self setBackgroundColor:[UIColor clearColor]];
|
59
|
+
}
|
60
|
+
return self;
|
61
|
+
}
|
62
|
+
|
63
|
+
- (id)initWithFrame:(CGRect)frame
|
64
|
+
{
|
65
|
+
return [self initWithFrame:frame foldDirection:FoldDirectionHorizontalRightToLeft];
|
66
|
+
}
|
67
|
+
|
68
|
+
- (void)setColorArrays:(NSArray*)colors
|
69
|
+
{
|
70
|
+
_colorsArray = [NSMutableArray array];
|
71
|
+
for (UIColor *color in colors)
|
72
|
+
{
|
73
|
+
[self.colorsArray addObject:(id)[color CGColor]];
|
74
|
+
}
|
75
|
+
|
76
|
+
if ([self.colorsArray count]>0)
|
77
|
+
{
|
78
|
+
[self.gradient setColors:self.colorsArray];
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
@end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import <UIKit/UIKit.h>
|
36
|
+
|
37
|
+
@interface TouchThroughUIView : UIView
|
38
|
+
|
39
|
+
@end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import "TouchThroughUIView.h"
|
36
|
+
|
37
|
+
@implementation TouchThroughUIView
|
38
|
+
|
39
|
+
/*
|
40
|
+
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
41
|
+
{
|
42
|
+
|
43
|
+
UIView *view = [super hitTest:point withEvent:event];
|
44
|
+
if (!view)
|
45
|
+
{
|
46
|
+
if ([[self subviews] count]>0)
|
47
|
+
{
|
48
|
+
for (UIView *view in [self subviews])
|
49
|
+
{
|
50
|
+
if ([view isKindOfClass:[MultiFoldView class]])
|
51
|
+
{
|
52
|
+
return self;
|
53
|
+
//return [(MultiFoldView*)view contentView];
|
54
|
+
}
|
55
|
+
}
|
56
|
+
return nil;
|
57
|
+
}
|
58
|
+
else return self;
|
59
|
+
}
|
60
|
+
else return view;
|
61
|
+
}*/
|
62
|
+
|
63
|
+
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
|
64
|
+
{
|
65
|
+
// set any point within the bound, and on the right side of the bound, as touch area
|
66
|
+
// it is required to set the right side of the bound as touch area because the right fold, is a subview of this view
|
67
|
+
// the left fold is not required because it is on the same hierachy as this view, as a subview of this view's superview
|
68
|
+
if (point.x<0) return NO;
|
69
|
+
else return YES;
|
70
|
+
}
|
71
|
+
|
72
|
+
@end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import <UIKit/UIKit.h>
|
36
|
+
|
37
|
+
//typedef void (^CompletionBlock)(UIImage *image);
|
38
|
+
|
39
|
+
@interface UIView (Screenshot)
|
40
|
+
- (UIImage*)screenshot;
|
41
|
+
- (UIImage*)screenshotWithOptimization:(BOOL)optimized;
|
42
|
+
@end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2012 Muh Hon Cheng
|
3
|
+
* Created by honcheng on 6/2/12.
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject
|
11
|
+
* to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
|
17
|
+
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
18
|
+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
20
|
+
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
21
|
+
* SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
22
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
24
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
25
|
+
* IN CONNECTION WITH THE SOFTWARE OR
|
26
|
+
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*
|
28
|
+
* @author Muh Hon Cheng <honcheng@gmail.com>
|
29
|
+
* @copyright 2012 Muh Hon Cheng
|
30
|
+
* @version
|
31
|
+
*
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
#import "UIView+Screenshot.h"
|
36
|
+
#import <QuartzCore/QuartzCore.h>
|
37
|
+
|
38
|
+
@implementation UIView (Screenshot)
|
39
|
+
|
40
|
+
- (UIImage*)screenshotWithOptimization:(BOOL)optimized
|
41
|
+
{
|
42
|
+
if (optimized)
|
43
|
+
{
|
44
|
+
// take screenshot of the view
|
45
|
+
if ([self isKindOfClass:NSClassFromString(@"MKMapView")])
|
46
|
+
{
|
47
|
+
if ([[[UIDevice currentDevice] systemVersion] floatValue]>=6.0)
|
48
|
+
{
|
49
|
+
// in iOS6, there is no problem using a non-retina screenshot in a retina display screen
|
50
|
+
UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 1.0);
|
51
|
+
}
|
52
|
+
else
|
53
|
+
{
|
54
|
+
// if the view is a mapview in iOS5.0 and below, screenshot has to take the screen scale into consideration
|
55
|
+
// else, the screen shot in retina display devices will be of a less detail map (note, it is not the size of the screenshot, but it is the level of detail of the screenshot
|
56
|
+
UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.0);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
else
|
60
|
+
{
|
61
|
+
// for performance consideration, everything else other than mapview will use a lower quality screenshot
|
62
|
+
UIGraphicsBeginImageContext(self.frame.size);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
else
|
66
|
+
{
|
67
|
+
UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.0);
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
if (UIGraphicsGetCurrentContext()==nil)
|
73
|
+
{
|
74
|
+
NSLog(@"UIGraphicsGetCurrentContext() is nil. You may have a UIView with CGRectZero");
|
75
|
+
return nil;
|
76
|
+
}
|
77
|
+
else
|
78
|
+
{
|
79
|
+
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
|
80
|
+
|
81
|
+
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
|
82
|
+
UIGraphicsEndImageContext();
|
83
|
+
|
84
|
+
// NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
85
|
+
// NSString *documentsDirectory = [paths objectAtIndex:0];
|
86
|
+
// NSString *testScreenshot = [documentsDirectory stringByAppendingPathComponent:@"test.png"];
|
87
|
+
// NSData *imageData = UIImagePNGRepresentation(screenshot);
|
88
|
+
// [imageData writeToFile:testScreenshot atomically:YES];
|
89
|
+
|
90
|
+
return screenshot;
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
- (UIImage*)screenshot
|
96
|
+
{
|
97
|
+
return [self screenshotWithOptimization:YES];
|
98
|
+
}
|
99
|
+
|
100
|
+
@end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
//
|
2
|
+
// NSBubbleData.h
|
3
|
+
//
|
4
|
+
// Created by Alex Barinov
|
5
|
+
// Project home page: http://alexbarinov.github.com/UIBubbleTableView/
|
6
|
+
//
|
7
|
+
// This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
8
|
+
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
|
9
|
+
//
|
10
|
+
|
11
|
+
#import <Foundation/Foundation.h>
|
12
|
+
|
13
|
+
typedef enum _NSBubbleType
|
14
|
+
{
|
15
|
+
BubbleTypeMine = 0,
|
16
|
+
BubbleTypeSomeoneElse = 1
|
17
|
+
} NSBubbleType;
|
18
|
+
|
19
|
+
@interface NSBubbleData : NSObject
|
20
|
+
|
21
|
+
@property (readonly, nonatomic, strong) NSDate *date;
|
22
|
+
@property (readonly, nonatomic) NSBubbleType type;
|
23
|
+
@property (readonly, nonatomic, strong) UIView *view;
|
24
|
+
@property (readonly, nonatomic) UIEdgeInsets insets;
|
25
|
+
@property (nonatomic, strong) UIImage *avatar;
|
26
|
+
|
27
|
+
- (id)initWithText:(NSString *)text date:(NSDate *)date type:(NSBubbleType)type;
|
28
|
+
+ (id)dataWithText:(NSString *)text date:(NSDate *)date type:(NSBubbleType)type;
|
29
|
+
- (id)initWithImage:(UIImage *)image date:(NSDate *)date type:(NSBubbleType)type;
|
30
|
+
+ (id)dataWithImage:(UIImage *)image date:(NSDate *)date type:(NSBubbleType)type;
|
31
|
+
- (id)initWithView:(UIView *)view date:(NSDate *)date type:(NSBubbleType)type insets:(UIEdgeInsets)insets;
|
32
|
+
+ (id)dataWithView:(UIView *)view date:(NSDate *)date type:(NSBubbleType)type insets:(UIEdgeInsets)insets;
|
33
|
+
|
34
|
+
@end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
//
|
2
|
+
// NSBubbleData.m
|
3
|
+
//
|
4
|
+
// Created by Alex Barinov
|
5
|
+
// Project home page: http://alexbarinov.github.com/UIBubbleTableView/
|
6
|
+
//
|
7
|
+
// This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
8
|
+
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
|
9
|
+
//
|
10
|
+
|
11
|
+
#import "NSBubbleData.h"
|
12
|
+
#import <QuartzCore/QuartzCore.h>
|
13
|
+
|
14
|
+
@implementation NSBubbleData
|
15
|
+
|
16
|
+
#pragma mark - Properties
|
17
|
+
|
18
|
+
@synthesize date = _date;
|
19
|
+
@synthesize type = _type;
|
20
|
+
@synthesize view = _view;
|
21
|
+
@synthesize insets = _insets;
|
22
|
+
@synthesize avatar = _avatar;
|
23
|
+
|
24
|
+
#pragma mark - Lifecycle
|
25
|
+
|
26
|
+
#if !__has_feature(objc_arc)
|
27
|
+
- (void)dealloc
|
28
|
+
{
|
29
|
+
[_date release];
|
30
|
+
_date = nil;
|
31
|
+
[_view release];
|
32
|
+
_view = nil;
|
33
|
+
|
34
|
+
self.avatar = nil;
|
35
|
+
|
36
|
+
[super dealloc];
|
37
|
+
}
|
38
|
+
#endif
|
39
|
+
|
40
|
+
#pragma mark - Text bubble
|
41
|
+
|
42
|
+
const UIEdgeInsets textInsetsMine = {5, 10, 11, 17};
|
43
|
+
const UIEdgeInsets textInsetsSomeone = {5, 15, 11, 10};
|
44
|
+
|
45
|
+
+ (id)dataWithText:(NSString *)text date:(NSDate *)date type:(NSBubbleType)type
|
46
|
+
{
|
47
|
+
#if !__has_feature(objc_arc)
|
48
|
+
return [[[NSBubbleData alloc] initWithText:text date:date type:type] autorelease];
|
49
|
+
#else
|
50
|
+
return [[NSBubbleData alloc] initWithText:text date:date type:type];
|
51
|
+
#endif
|
52
|
+
}
|
53
|
+
|
54
|
+
- (id)initWithText:(NSString *)text date:(NSDate *)date type:(NSBubbleType)type
|
55
|
+
{
|
56
|
+
UIFont *font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
|
57
|
+
CGSize size = [(text ? text : @"") sizeWithFont:font constrainedToSize:CGSizeMake(220, 9999) lineBreakMode:NSLineBreakByWordWrapping];
|
58
|
+
|
59
|
+
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
|
60
|
+
label.numberOfLines = 0;
|
61
|
+
label.lineBreakMode = NSLineBreakByWordWrapping;
|
62
|
+
label.text = (text ? text : @"");
|
63
|
+
label.font = font;
|
64
|
+
label.backgroundColor = [UIColor clearColor];
|
65
|
+
|
66
|
+
#if !__has_feature(objc_arc)
|
67
|
+
[label autorelease];
|
68
|
+
#endif
|
69
|
+
|
70
|
+
UIEdgeInsets insets = (type == BubbleTypeMine ? textInsetsMine : textInsetsSomeone);
|
71
|
+
return [self initWithView:label date:date type:type insets:insets];
|
72
|
+
}
|
73
|
+
|
74
|
+
#pragma mark - Image bubble
|
75
|
+
|
76
|
+
const UIEdgeInsets imageInsetsMine = {11, 13, 16, 22};
|
77
|
+
const UIEdgeInsets imageInsetsSomeone = {11, 18, 16, 14};
|
78
|
+
|
79
|
+
+ (id)dataWithImage:(UIImage *)image date:(NSDate *)date type:(NSBubbleType)type
|
80
|
+
{
|
81
|
+
#if !__has_feature(objc_arc)
|
82
|
+
return [[[NSBubbleData alloc] initWithImage:image date:date type:type] autorelease];
|
83
|
+
#else
|
84
|
+
return [[NSBubbleData alloc] initWithImage:image date:date type:type];
|
85
|
+
#endif
|
86
|
+
}
|
87
|
+
|
88
|
+
- (id)initWithImage:(UIImage *)image date:(NSDate *)date type:(NSBubbleType)type
|
89
|
+
{
|
90
|
+
CGSize size = image.size;
|
91
|
+
if (size.width > 220)
|
92
|
+
{
|
93
|
+
size.height /= (size.width / 220);
|
94
|
+
size.width = 220;
|
95
|
+
}
|
96
|
+
|
97
|
+
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
|
98
|
+
imageView.image = image;
|
99
|
+
imageView.layer.cornerRadius = 5.0;
|
100
|
+
imageView.layer.masksToBounds = YES;
|
101
|
+
|
102
|
+
|
103
|
+
#if !__has_feature(objc_arc)
|
104
|
+
[imageView autorelease];
|
105
|
+
#endif
|
106
|
+
|
107
|
+
UIEdgeInsets insets = (type == BubbleTypeMine ? imageInsetsMine : imageInsetsSomeone);
|
108
|
+
return [self initWithView:imageView date:date type:type insets:insets];
|
109
|
+
}
|
110
|
+
|
111
|
+
#pragma mark - Custom view bubble
|
112
|
+
|
113
|
+
+ (id)dataWithView:(UIView *)view date:(NSDate *)date type:(NSBubbleType)type insets:(UIEdgeInsets)insets
|
114
|
+
{
|
115
|
+
#if !__has_feature(objc_arc)
|
116
|
+
return [[[NSBubbleData alloc] initWithView:view date:date type:type insets:insets] autorelease];
|
117
|
+
#else
|
118
|
+
return [[NSBubbleData alloc] initWithView:view date:date type:type insets:insets];
|
119
|
+
#endif
|
120
|
+
}
|
121
|
+
|
122
|
+
- (id)initWithView:(UIView *)view date:(NSDate *)date type:(NSBubbleType)type insets:(UIEdgeInsets)insets
|
123
|
+
{
|
124
|
+
self = [super init];
|
125
|
+
if (self)
|
126
|
+
{
|
127
|
+
#if !__has_feature(objc_arc)
|
128
|
+
_view = [view retain];
|
129
|
+
_date = [date retain];
|
130
|
+
#else
|
131
|
+
_view = view;
|
132
|
+
_date = date;
|
133
|
+
#endif
|
134
|
+
_type = type;
|
135
|
+
_insets = insets;
|
136
|
+
}
|
137
|
+
return self;
|
138
|
+
}
|
139
|
+
|
140
|
+
@end
|