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
@@ -0,0 +1,24 @@
|
|
1
|
+
//
|
2
|
+
// UIBubbleTableViewDataSource.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
|
+
@class NSBubbleData;
|
14
|
+
@class UIBubbleTableView;
|
15
|
+
@protocol UIBubbleTableViewDataSource <NSObject>
|
16
|
+
|
17
|
+
@optional
|
18
|
+
|
19
|
+
@required
|
20
|
+
|
21
|
+
- (NSInteger)rowsForBubbleTable:(UIBubbleTableView *)tableView;
|
22
|
+
- (NSBubbleData *)bubbleTableView:(UIBubbleTableView *)tableView dataForRow:(NSInteger)row;
|
23
|
+
|
24
|
+
@end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
//
|
2
|
+
// UIBubbleTypingTableCell.h
|
3
|
+
// UIBubbleTableViewExample
|
4
|
+
//
|
5
|
+
// Created by Александр Баринов on 10/7/12.
|
6
|
+
// Copyright (c) 2012 Stex Group. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
#import "UIBubbleTableView.h"
|
11
|
+
|
12
|
+
|
13
|
+
@interface UIBubbleTypingTableViewCell : UITableViewCell
|
14
|
+
|
15
|
+
+ (CGFloat)height;
|
16
|
+
|
17
|
+
@property (nonatomic) NSBubbleTypingType type;
|
18
|
+
@property (nonatomic) BOOL showAvatar;
|
19
|
+
|
20
|
+
@end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
//
|
2
|
+
// UIBubbleTypingTableCell.m
|
3
|
+
// UIBubbleTableViewExample
|
4
|
+
//
|
5
|
+
// Created by Александр Баринов on 10/7/12.
|
6
|
+
// Copyright (c) 2012 Stex Group. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "UIBubbleTypingTableViewCell.h"
|
10
|
+
|
11
|
+
@interface UIBubbleTypingTableViewCell ()
|
12
|
+
|
13
|
+
@property (nonatomic, retain) UIImageView *typingImageView;
|
14
|
+
|
15
|
+
@end
|
16
|
+
|
17
|
+
@implementation UIBubbleTypingTableViewCell
|
18
|
+
|
19
|
+
@synthesize type = _type;
|
20
|
+
@synthesize typingImageView = _typingImageView;
|
21
|
+
@synthesize showAvatar = _showAvatar;
|
22
|
+
|
23
|
+
+ (CGFloat)height
|
24
|
+
{
|
25
|
+
return 40.0;
|
26
|
+
}
|
27
|
+
|
28
|
+
- (void)setType:(NSBubbleTypingType)value
|
29
|
+
{
|
30
|
+
if (!self.typingImageView)
|
31
|
+
{
|
32
|
+
self.typingImageView = [[UIImageView alloc] init];
|
33
|
+
[self addSubview:self.typingImageView];
|
34
|
+
}
|
35
|
+
|
36
|
+
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
37
|
+
|
38
|
+
UIImage *bubbleImage = nil;
|
39
|
+
CGFloat x = 0;
|
40
|
+
|
41
|
+
if (value == NSBubbleTypingTypeMe)
|
42
|
+
{
|
43
|
+
bubbleImage = [UIImage imageNamed:@"typingMine.png"];
|
44
|
+
x = self.frame.size.width - bubbleImage.size.width;
|
45
|
+
}
|
46
|
+
else
|
47
|
+
{
|
48
|
+
bubbleImage = [UIImage imageNamed:@"typingSomeone.png"];
|
49
|
+
x = 0;
|
50
|
+
}
|
51
|
+
|
52
|
+
self.typingImageView.image = bubbleImage;
|
53
|
+
self.typingImageView.frame = CGRectMake(x, 4, 73, 31);
|
54
|
+
}
|
55
|
+
|
56
|
+
@end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,124 @@
|
|
1
|
+
//
|
2
|
+
// UIButton+Effects.h
|
3
|
+
// fwMeCard
|
4
|
+
//
|
5
|
+
// Created by Water Lou on 6/1/11.
|
6
|
+
// Copyright 2011 First Water Tech Ltd. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface UIButton(UIGlossyButton)
|
12
|
+
|
13
|
+
- (void) useWhiteLabel : (BOOL) dimOnClickedOrDisabled;
|
14
|
+
- (void) useBlackLabel : (BOOL) dimOnClickedOrDisabled;
|
15
|
+
|
16
|
+
@end
|
17
|
+
|
18
|
+
@interface UIColor(UIGlossyButton)
|
19
|
+
|
20
|
+
+ (UIColor*) doneButtonColor;
|
21
|
+
+ (UIColor*) navigationBarButtonColor;
|
22
|
+
|
23
|
+
@end
|
24
|
+
|
25
|
+
typedef enum _UIGlossyButtonGradientType {
|
26
|
+
kUIGlossyButtonGradientTypeLinearSmoothStandard = 0, // general vertical linear gradient, normal to little dark
|
27
|
+
kUIGlossyButtonGradientTypeLinearGlossyStandard, // iOS like glossy effect
|
28
|
+
kUIGlossyButtonGradientTypeLinearSmoothExtreme, // Very bright to very dim
|
29
|
+
kUIGlossyButtonGradientTypeLinearSmoothBrightToNormal, // very bright to normal
|
30
|
+
kUIGlossyButtonGradientTypeSolid, // plain solid
|
31
|
+
} UIGlossyButtonGradientType;
|
32
|
+
|
33
|
+
typedef enum _UIGlossyButtonStrokeType{
|
34
|
+
kUIGlossyButtonStrokeTypeNone = 0,
|
35
|
+
kUIGlossyButtonStrokeTypeSolid, // simple solid color
|
36
|
+
kUIGlossyButtonStrokeTypeInnerBevelDown, // draw bevel down effect (naivagation bar button)
|
37
|
+
kUIGlossyButtonStrokeTypeGradientFrame, // frame a 1 pixel b/w gradient (default delete button)
|
38
|
+
kUIGlossyButtonStrokeTypeBevelUp, // stroke bevel using button color
|
39
|
+
} UIGlossyButtonStrokeType;
|
40
|
+
|
41
|
+
typedef enum _UIGlossyButtonExtraShadingType {
|
42
|
+
kUIGlossyButtonExtraShadingTypeNone = 0, // no extra shading
|
43
|
+
kUIGlossyButtonExtraShadingTypeRounded, // rounded shading, shading radius = button corner radius
|
44
|
+
kUIGlossyButtonExtraShadingTypeAngleLeft,
|
45
|
+
kUIGlossyButtonExtraShadingTypeAngleRight,
|
46
|
+
} UIGlossyButtonExtraShadingType;
|
47
|
+
|
48
|
+
/**
|
49
|
+
Create color button without any images,
|
50
|
+
draw with different gradient, frame and glossy effect
|
51
|
+
**/
|
52
|
+
|
53
|
+
@interface UIGlossyButton : UIButton {
|
54
|
+
@private
|
55
|
+
// data to create gradient of the button
|
56
|
+
const CGFloat *background_gradient;
|
57
|
+
const CGFloat *locations;
|
58
|
+
NSInteger numberOfColorsInGradient;
|
59
|
+
|
60
|
+
@protected
|
61
|
+
UIColor *_tintColor;
|
62
|
+
UIColor *_disabledColor;
|
63
|
+
|
64
|
+
UIColor *_borderColor;
|
65
|
+
UIColor *_disabledBorderColor;
|
66
|
+
|
67
|
+
CGFloat _buttonCornerRadius;
|
68
|
+
CGFloat _innerBorderWidth;
|
69
|
+
CGFloat _buttonBorderWidth;
|
70
|
+
|
71
|
+
BOOL _invertGraidentOnSelected;
|
72
|
+
|
73
|
+
CGFloat _backgroundOpacity;
|
74
|
+
|
75
|
+
UIEdgeInsets _buttonInsets;
|
76
|
+
|
77
|
+
UIGlossyButtonStrokeType _strokeType;
|
78
|
+
UIGlossyButtonExtraShadingType _extraShadingType;
|
79
|
+
}
|
80
|
+
|
81
|
+
@property (nonatomic, retain) UIColor *tintColor;
|
82
|
+
@property (nonatomic, retain) UIColor *disabledColor; // color when disabled, can be nil for lightgray color when disabled
|
83
|
+
@property (nonatomic, assign) CGFloat buttonCornerRadius; // outer button border
|
84
|
+
@property (nonatomic, assign) UIEdgeInsets buttonInsets; // inset of the button face, default 0.0
|
85
|
+
@property (nonatomic, retain) UIColor *borderColor; // button border color, default nil = dark gray
|
86
|
+
@property (nonatomic, retain) UIColor *disabledBorderColor; // color when disabled, can be nil for lightgray color when disabled
|
87
|
+
@property (nonatomic, assign) CGFloat buttonBorderWidth; // outer button border width, default 1.0
|
88
|
+
@property (nonatomic, assign) CGFloat innerBorderWidth; // inner stroke that fill same color as the tint color, default = 1.0
|
89
|
+
@property (nonatomic, assign) UIGlossyButtonStrokeType strokeType; // outer button border
|
90
|
+
@property (nonatomic, assign) UIGlossyButtonExtraShadingType extraShadingType; // extra shading effect other than gradient
|
91
|
+
@property (nonatomic, assign) BOOL invertGraidentOnSelected; // invert the gradient when button down for inner bevel effect, default = NO
|
92
|
+
@property (nonatomic, assign) CGFloat backgroundOpacity; // default 1.0, set smaller to draw button in transparent
|
93
|
+
|
94
|
+
/* path for the button, default is a round corner rectangle, we can subclass and customize it */
|
95
|
+
- (UIBezierPath *) pathForButton : (CGFloat) inset;
|
96
|
+
|
97
|
+
- (void) setGradientType : (UIGlossyButtonGradientType) type;
|
98
|
+
|
99
|
+
- (void) setActionSheetButtonWithColor : (UIColor*) color;
|
100
|
+
- (void) setNavigationButtonWithColor : (UIColor*) color; // navigation bar button, or store button
|
101
|
+
|
102
|
+
@end
|
103
|
+
|
104
|
+
|
105
|
+
/* subtype that with left and right navigation button shape */
|
106
|
+
@interface UIGNavigationButton : UIGlossyButton {
|
107
|
+
@private
|
108
|
+
BOOL _leftArrow;
|
109
|
+
}
|
110
|
+
|
111
|
+
@property (nonatomic, getter = isLeftArrow) BOOL leftArrow;
|
112
|
+
|
113
|
+
@end
|
114
|
+
|
115
|
+
@interface UIGBadgeButton : UIGlossyButton {
|
116
|
+
@private
|
117
|
+
NSInteger numberOfEdges;
|
118
|
+
CGFloat innerRadiusRatio;
|
119
|
+
}
|
120
|
+
|
121
|
+
@property (nonatomic, assign) NSInteger numberOfEdges;
|
122
|
+
@property (nonatomic, assign) CGFloat innerRadiusRatio;
|
123
|
+
|
124
|
+
@end
|
@@ -0,0 +1,545 @@
|
|
1
|
+
//
|
2
|
+
// UIButton+Effects.m
|
3
|
+
// fwMeCard
|
4
|
+
//
|
5
|
+
// Created by Water Lou on 6/1/11.
|
6
|
+
// Copyright 2011 First Water Tech Ltd. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
|
10
|
+
#import "UIGlossyButton.h"
|
11
|
+
|
12
|
+
static void RetinaAwareUIGraphicsBeginImageContext(CGSize size) {
|
13
|
+
if ([[UIView class] instancesRespondToSelector:@selector(contentScaleFactor)]) {
|
14
|
+
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
UIGraphicsBeginImageContext(size);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
@implementation UIButton(UIGlossyButton)
|
24
|
+
|
25
|
+
- (void) useWhiteLabel : (BOOL) dimOnClickedOrDisabled {
|
26
|
+
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
27
|
+
UIColor *dimColor = nil;
|
28
|
+
if (dimOnClickedOrDisabled) dimColor = [UIColor lightGrayColor];
|
29
|
+
[self setTitleColor:dimColor forState:UIControlStateDisabled];
|
30
|
+
[self setTitleColor:dimColor forState:UIControlStateHighlighted];
|
31
|
+
}
|
32
|
+
|
33
|
+
- (void) useBlackLabel : (BOOL) dimOnClickedOrDisabled {
|
34
|
+
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
35
|
+
UIColor *dimColor = nil;
|
36
|
+
if (dimOnClickedOrDisabled) dimColor = [UIColor darkGrayColor];
|
37
|
+
[self setTitleColor:dimColor forState:UIControlStateDisabled];
|
38
|
+
[self setTitleColor:dimColor forState:UIControlStateHighlighted];
|
39
|
+
}
|
40
|
+
|
41
|
+
@end
|
42
|
+
|
43
|
+
|
44
|
+
@implementation UIColor(UIGlossyButton)
|
45
|
+
|
46
|
+
+ (UIColor*) doneButtonColor {
|
47
|
+
return [UIColor colorWithRed:34.0f/255.0f green:96.0f/255.0f blue:221.0f/255.0f alpha:1.0f]; // DONE
|
48
|
+
}
|
49
|
+
|
50
|
+
+ (UIColor*) navigationBarButtonColor {
|
51
|
+
return [UIColor colorWithRed:72.0f/255.0f green:106.0f/255.0f blue:154.0f/255.0f alpha:1.0f];
|
52
|
+
}
|
53
|
+
|
54
|
+
@end
|
55
|
+
|
56
|
+
|
57
|
+
#pragma =================================================
|
58
|
+
#pragma =================================================
|
59
|
+
#pragma =================================================
|
60
|
+
|
61
|
+
|
62
|
+
@interface UIGlossyButton()
|
63
|
+
|
64
|
+
// main draw routine, not including stroke the outer path
|
65
|
+
- (void) drawTintColorButton : (CGContextRef)context tintColor : (UIColor *) tintColor isSelected : (BOOL) isSelected;
|
66
|
+
- (void) strokeButton : (CGContextRef)context color : (UIColor *)color isSelected : (BOOL) isSelected;
|
67
|
+
|
68
|
+
@end
|
69
|
+
|
70
|
+
@implementation UIGlossyButton
|
71
|
+
|
72
|
+
@synthesize tintColor = _tintColor, disabledColor = _disabledColor;
|
73
|
+
@synthesize buttonCornerRadius = _buttonCornerRadius;
|
74
|
+
@synthesize borderColor = _borderColor, disabledBorderColor = _disabledBorderColor;
|
75
|
+
@synthesize buttonBorderWidth = _buttonBorderWidth;
|
76
|
+
@synthesize innerBorderWidth = _innerBorderWidth;
|
77
|
+
@synthesize strokeType = _strokeType, extraShadingType = _extraShadingType;
|
78
|
+
@synthesize backgroundOpacity = _backgroundOpacity;
|
79
|
+
@synthesize buttonInsets = _buttonInsets;
|
80
|
+
@synthesize invertGraidentOnSelected = _invertGraidentOnSelected;
|
81
|
+
|
82
|
+
|
83
|
+
#pragma lifecycle
|
84
|
+
|
85
|
+
|
86
|
+
- (void) setupSelf {
|
87
|
+
_buttonCornerRadius = 4.0f;
|
88
|
+
_innerBorderWidth = 1.0;
|
89
|
+
_buttonBorderWidth = 1.0;
|
90
|
+
_backgroundOpacity = 1.0;
|
91
|
+
_buttonInsets = UIEdgeInsetsZero;
|
92
|
+
[self setGradientType: kUIGlossyButtonGradientTypeLinearSmoothStandard];
|
93
|
+
[self addObserver:self forKeyPath:@"highlighted" options:0 context:nil];
|
94
|
+
[self addObserver:self forKeyPath:@"enabled" options:0 context:nil];
|
95
|
+
}
|
96
|
+
|
97
|
+
- (id) initWithCoder:(NSCoder *)aDecoder {
|
98
|
+
if ((self = [super initWithCoder:aDecoder])) {
|
99
|
+
[self setupSelf];
|
100
|
+
}
|
101
|
+
return self;
|
102
|
+
}
|
103
|
+
|
104
|
+
- (id) initWithFrame:(CGRect)frame {
|
105
|
+
if ((self = [super initWithFrame:frame])) {
|
106
|
+
[self setupSelf];
|
107
|
+
}
|
108
|
+
return self;
|
109
|
+
}
|
110
|
+
|
111
|
+
-(void) dealloc {
|
112
|
+
[self removeObserver:self forKeyPath:@"highlighted"];
|
113
|
+
[self removeObserver:self forKeyPath:@"enabled"];
|
114
|
+
|
115
|
+
#if !__has_feature(objc_arc)
|
116
|
+
self.tintColor = nil;
|
117
|
+
self.disabledColor = nil;
|
118
|
+
self.borderColor = nil;
|
119
|
+
self.disabledColor = nil;
|
120
|
+
[super dealloc];
|
121
|
+
#endif
|
122
|
+
}
|
123
|
+
|
124
|
+
#pragma mark -
|
125
|
+
|
126
|
+
/* graident that will be used to fill on top of the button for 3D effect */
|
127
|
+
- (void) setGradientType : (UIGlossyButtonGradientType) type {
|
128
|
+
switch (type) {
|
129
|
+
case kUIGlossyButtonGradientTypeLinearSmoothStandard:
|
130
|
+
{
|
131
|
+
static const CGFloat g0[] = {0.5, 1.0, 0.35, 1.0};
|
132
|
+
background_gradient = g0;
|
133
|
+
locations = nil;
|
134
|
+
numberOfColorsInGradient = 2;
|
135
|
+
}
|
136
|
+
break;
|
137
|
+
case kUIGlossyButtonGradientTypeLinearSmoothExtreme:
|
138
|
+
{
|
139
|
+
static const CGFloat g0[] = {0.8, 1.0, 0.2, 1.0};
|
140
|
+
background_gradient = g0;
|
141
|
+
locations = nil;
|
142
|
+
numberOfColorsInGradient = 2;
|
143
|
+
}
|
144
|
+
break;
|
145
|
+
case kUIGlossyButtonGradientTypeLinearSmoothBrightToNormal:
|
146
|
+
{
|
147
|
+
static const CGFloat g0[] = {0.9, 1.0, 0.5, 1.0, 0.5, 1.0};
|
148
|
+
static const CGFloat l0[] = {0.0, 0.7, 1.0};
|
149
|
+
background_gradient = g0;
|
150
|
+
locations = l0;
|
151
|
+
numberOfColorsInGradient = 3;
|
152
|
+
}
|
153
|
+
break;
|
154
|
+
case kUIGlossyButtonGradientTypeLinearGlossyStandard:
|
155
|
+
{
|
156
|
+
static const CGFloat g0[] = {0.7, 1.0, 0.6, 1.0, 0.5, 1.0, 0.45, 1.0};
|
157
|
+
static const CGFloat l0[] = {0.0, 0.47, 0.53, 1.0};
|
158
|
+
background_gradient = g0;
|
159
|
+
locations = l0;
|
160
|
+
numberOfColorsInGradient = 4;
|
161
|
+
}
|
162
|
+
break;
|
163
|
+
case kUIGlossyButtonGradientTypeSolid:
|
164
|
+
{
|
165
|
+
// simplify the code, we create a gradient with one color
|
166
|
+
static const CGFloat g0[] = {0.5, 1.0, 0.5, 1.0};
|
167
|
+
background_gradient = g0;
|
168
|
+
locations = nil;
|
169
|
+
numberOfColorsInGradient = 2;
|
170
|
+
}
|
171
|
+
break;
|
172
|
+
|
173
|
+
default:
|
174
|
+
break;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
- (UIBezierPath *) pathForButton : (CGFloat) inset {
|
179
|
+
CGFloat radius = _buttonCornerRadius - inset;
|
180
|
+
if (radius<0.0) radius = 0.0;
|
181
|
+
CGRect rr = UIEdgeInsetsInsetRect(self.bounds, _buttonInsets);
|
182
|
+
return [UIBezierPath bezierPathWithRoundedRect:CGRectInset(rr, inset, inset) cornerRadius:radius];
|
183
|
+
}
|
184
|
+
|
185
|
+
- (void)drawRect:(CGRect)rect {
|
186
|
+
UIColor *color = _tintColor;
|
187
|
+
if (![self isEnabled]) {
|
188
|
+
if (_disabledColor) color = _disabledColor;
|
189
|
+
else color = [UIColor lightGrayColor];
|
190
|
+
}
|
191
|
+
if (color==nil) color = [UIColor whiteColor];
|
192
|
+
|
193
|
+
// if the background is transparent, we draw on a image
|
194
|
+
// and copy the image to the context with alpha
|
195
|
+
BOOL drawOnImage = _backgroundOpacity<1.0;
|
196
|
+
|
197
|
+
if (drawOnImage) {
|
198
|
+
RetinaAwareUIGraphicsBeginImageContext(self.bounds.size);
|
199
|
+
}
|
200
|
+
|
201
|
+
CGContextRef ref = UIGraphicsGetCurrentContext();
|
202
|
+
|
203
|
+
BOOL isSelected = [self isHighlighted];
|
204
|
+
CGContextSaveGState(ref);
|
205
|
+
if (_buttonBorderWidth>0.0) {
|
206
|
+
UIColor *color;
|
207
|
+
if ([self isEnabled]) color = _borderColor;
|
208
|
+
else {
|
209
|
+
color = _disabledBorderColor;
|
210
|
+
if (color==nil) color = _borderColor;
|
211
|
+
}
|
212
|
+
if (color == nil) color = [UIColor darkGrayColor];
|
213
|
+
[self strokeButton : ref color : color isSelected: isSelected];
|
214
|
+
}
|
215
|
+
[self drawTintColorButton : ref tintColor : color isSelected: isSelected];
|
216
|
+
CGContextRestoreGState(ref);
|
217
|
+
|
218
|
+
if (drawOnImage) {
|
219
|
+
UIImage *i = UIGraphicsGetImageFromCurrentImageContext();
|
220
|
+
UIGraphicsEndImageContext();
|
221
|
+
[i drawAtPoint:CGPointZero blendMode:kCGBlendModeNormal alpha:_backgroundOpacity];
|
222
|
+
}
|
223
|
+
|
224
|
+
[super drawRect: rect];
|
225
|
+
}
|
226
|
+
|
227
|
+
#pragma mark KVO
|
228
|
+
|
229
|
+
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
230
|
+
{
|
231
|
+
if ([keyPath isEqualToString:@"highlighted"] || [keyPath isEqualToString:@"enabled"]) {
|
232
|
+
[self setNeedsDisplay];
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
|
237
|
+
#pragma -
|
238
|
+
|
239
|
+
- (void) strokeButton : (CGContextRef)context color : (UIColor *)color isSelected : (BOOL) isSelected {
|
240
|
+
switch (_strokeType) {
|
241
|
+
case kUIGlossyButtonStrokeTypeNone:
|
242
|
+
break;
|
243
|
+
case kUIGlossyButtonStrokeTypeSolid:
|
244
|
+
// simple solid border
|
245
|
+
CGContextAddPath(context, [self pathForButton : 0.0f].CGPath);
|
246
|
+
[color setFill];
|
247
|
+
CGContextFillPath(context);
|
248
|
+
break;
|
249
|
+
case kUIGlossyButtonStrokeTypeGradientFrame:
|
250
|
+
// solid border with gradient outer frame
|
251
|
+
{
|
252
|
+
CGRect rect = self.bounds;
|
253
|
+
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
254
|
+
CGFloat strokeComponents[] = {
|
255
|
+
0.25f, 1.0f, 1.0f, 1.0f
|
256
|
+
};
|
257
|
+
|
258
|
+
UIBezierPath *outerPath = [self pathForButton : 0.0f];
|
259
|
+
CGContextAddPath(context, outerPath.CGPath);
|
260
|
+
[color setFill];
|
261
|
+
CGContextFillPath(context);
|
262
|
+
|
263
|
+
// stroke the gradient in 1 pixels using overlay so that still keep the stroke color
|
264
|
+
CGContextSaveGState(context);
|
265
|
+
CGContextAddPath(context, outerPath.CGPath);
|
266
|
+
CGContextAddPath(context, [self pathForButton : 1.0f].CGPath);
|
267
|
+
CGContextEOClip(context);
|
268
|
+
CGContextSetBlendMode(context, kCGBlendModeOverlay);
|
269
|
+
|
270
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, NULL, 2);
|
271
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(0, CGRectGetMinY(rect)), CGPointMake(0,CGRectGetMaxY(rect)), 0);
|
272
|
+
CGGradientRelease(strokeGradient);
|
273
|
+
CGColorSpaceRelease(colorSpace);
|
274
|
+
|
275
|
+
CGContextRestoreGState(context);
|
276
|
+
}
|
277
|
+
break;
|
278
|
+
case kUIGlossyButtonStrokeTypeInnerBevelDown:
|
279
|
+
{
|
280
|
+
CGContextSaveGState(context);
|
281
|
+
CGPathRef path = [self pathForButton: 0.0f].CGPath;
|
282
|
+
CGContextAddPath(context, path);
|
283
|
+
CGContextClip(context);
|
284
|
+
[[UIColor colorWithWhite:0.9f alpha:1.0f] setFill];
|
285
|
+
CGContextAddPath(context, path);
|
286
|
+
CGContextFillPath(context);
|
287
|
+
|
288
|
+
CGFloat highlightWidth = _buttonBorderWidth / 4.0f;
|
289
|
+
if (highlightWidth<0.5f) highlightWidth = 0.5f;
|
290
|
+
else if (highlightWidth>2.0f) highlightWidth = 2.0f;
|
291
|
+
CGPathRef innerPath = [self pathForButton: highlightWidth].CGPath;
|
292
|
+
CGContextTranslateCTM(context, 0.0f, -highlightWidth);
|
293
|
+
[color setFill];
|
294
|
+
CGContextAddPath(context, innerPath);
|
295
|
+
CGContextFillPath(context);
|
296
|
+
|
297
|
+
CGContextRestoreGState(context);
|
298
|
+
}
|
299
|
+
break;
|
300
|
+
case kUIGlossyButtonStrokeTypeBevelUp:
|
301
|
+
{
|
302
|
+
CGRect rect = self.bounds;
|
303
|
+
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
304
|
+
const CGFloat *strokeComponents;
|
305
|
+
const CGFloat *l0;
|
306
|
+
if (_invertGraidentOnSelected && isSelected) {
|
307
|
+
const CGFloat s[] = {0.2, 1, 0.5, 1, 0.6, 1};
|
308
|
+
const CGFloat l[] = {0.0, 0.1, 1.0};
|
309
|
+
strokeComponents = s; l0 = l;
|
310
|
+
}
|
311
|
+
else {
|
312
|
+
const CGFloat s[] = {0.9, 1, 0.5, 1, 0.2, 1};
|
313
|
+
const CGFloat l[] = {0.0, 0.1, 1.0};
|
314
|
+
strokeComponents = s; l0 = l;
|
315
|
+
}
|
316
|
+
|
317
|
+
CGContextAddPath(context, [self pathForButton : 0.0f].CGPath);
|
318
|
+
CGContextClip(context);
|
319
|
+
|
320
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, l0, 3);
|
321
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(0, CGRectGetMinY(rect)), CGPointMake(0,CGRectGetMaxY(rect)), 0);
|
322
|
+
CGGradientRelease(strokeGradient);
|
323
|
+
CGColorSpaceRelease(colorSpace);
|
324
|
+
|
325
|
+
[color set];
|
326
|
+
UIRectFillUsingBlendMode(rect, kCGBlendModeOverlay);
|
327
|
+
|
328
|
+
CGContextFillPath(context);
|
329
|
+
}
|
330
|
+
break;
|
331
|
+
default:
|
332
|
+
break;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
- (void) addShading : (CGContextRef) context type : (UIGlossyButtonExtraShadingType)type rect : (CGRect) rect colorSpace : (CGColorSpaceRef) colorSpace {
|
337
|
+
switch (type) {
|
338
|
+
case kUIGlossyButtonExtraShadingTypeRounded:
|
339
|
+
{
|
340
|
+
|
341
|
+
CGPathRef shade = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(rect.origin.x, rect.origin.y-_buttonCornerRadius, rect.size.width, _buttonCornerRadius+rect.size.height/2.0) cornerRadius:_buttonCornerRadius].CGPath;
|
342
|
+
CGContextAddPath(context, shade);
|
343
|
+
CGContextClip(context);
|
344
|
+
const CGFloat strokeComponents[4] = {0.80, 1, 0.55, 1};
|
345
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, NULL, 2);
|
346
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(0, CGRectGetMinY(rect)), CGPointMake(0,rect.origin.y + rect.size.height * 0.7), 0);
|
347
|
+
CGGradientRelease(strokeGradient);
|
348
|
+
}
|
349
|
+
break;
|
350
|
+
case kUIGlossyButtonExtraShadingTypeAngleLeft:
|
351
|
+
{
|
352
|
+
CGRect roundRect = CGRectMake(rect.origin.x-rect.size.width * 2, rect.origin.y - rect.size.height * 3.33, rect.size.width*4.0f, rect.size.height*4.0f);
|
353
|
+
CGContextAddEllipseInRect(context, roundRect);
|
354
|
+
CGContextClip(context);
|
355
|
+
const CGFloat strokeComponents[4] = {0.80, 1, 0.55, 1};
|
356
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, NULL, 2);
|
357
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(rect.origin.x, rect.origin.y), CGPointMake(rect.origin.x+rect.size.width / 2.0, rect.origin.y + rect.size.height * 0.7), 0);
|
358
|
+
CGGradientRelease(strokeGradient);
|
359
|
+
}
|
360
|
+
break;
|
361
|
+
case kUIGlossyButtonExtraShadingTypeAngleRight:
|
362
|
+
{
|
363
|
+
CGRect roundRect = CGRectMake(rect.origin.x-rect.size.width, rect.origin.y - rect.size.height * 3.33, rect.size.width*4.0f, rect.size.height*4.0f);
|
364
|
+
CGContextAddEllipseInRect(context, roundRect);
|
365
|
+
CGContextClip(context);
|
366
|
+
const CGFloat strokeComponents[4] = {0.80, 1, 0.55, 1};
|
367
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, NULL, 2);
|
368
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(rect.origin.x+rect.size.width, rect.origin.y), CGPointMake(rect.origin.x+rect.size.width / 2.0, rect.origin.y + rect.size.height * 0.7), 0);
|
369
|
+
CGGradientRelease(strokeGradient);
|
370
|
+
}
|
371
|
+
break;
|
372
|
+
default:
|
373
|
+
break;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
|
377
|
+
- (void) drawTintColorButton : (CGContextRef)context tintColor : (UIColor *) tintColor isSelected : (BOOL) isSelected {
|
378
|
+
CGRect rect = self.bounds;
|
379
|
+
|
380
|
+
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
|
381
|
+
|
382
|
+
if (_innerBorderWidth > 0.0) {
|
383
|
+
// STROKE GRADIENT
|
384
|
+
CGContextAddPath(context, [self pathForButton : _buttonBorderWidth].CGPath);
|
385
|
+
CGContextClip(context);
|
386
|
+
|
387
|
+
CGContextSaveGState(context);
|
388
|
+
|
389
|
+
const CGFloat strokeComponents[4] = {0.55, 1, 0.40, 1};
|
390
|
+
CGGradientRef strokeGradient = CGGradientCreateWithColorComponents(colorSpace, strokeComponents, NULL, 2);
|
391
|
+
CGContextDrawLinearGradient(context, strokeGradient, CGPointMake(0, CGRectGetMinY(rect)), CGPointMake(0,CGRectGetMaxY(rect)), 0);
|
392
|
+
CGGradientRelease(strokeGradient);
|
393
|
+
}
|
394
|
+
|
395
|
+
// FILL GRADIENT
|
396
|
+
CGRect fillRect = CGRectInset(rect,_buttonBorderWidth + _innerBorderWidth, _buttonBorderWidth + _innerBorderWidth);
|
397
|
+
CGContextAddPath(context, [self pathForButton : _buttonBorderWidth + _innerBorderWidth].CGPath);
|
398
|
+
CGContextClip(context);
|
399
|
+
|
400
|
+
CGGradientRef fillGradient = CGGradientCreateWithColorComponents(colorSpace, background_gradient, locations, numberOfColorsInGradient);
|
401
|
+
if (_invertGraidentOnSelected && isSelected) {
|
402
|
+
CGContextDrawLinearGradient(context, fillGradient, CGPointMake(0, CGRectGetMaxY(fillRect)), CGPointMake(0,CGRectGetMinY(fillRect)), 0);
|
403
|
+
}
|
404
|
+
else {
|
405
|
+
CGContextDrawLinearGradient(context, fillGradient, CGPointMake(0, CGRectGetMinY(fillRect)), CGPointMake(0,CGRectGetMaxY(fillRect)), 0);
|
406
|
+
}
|
407
|
+
CGGradientRelease(fillGradient);
|
408
|
+
|
409
|
+
if (_extraShadingType != kUIGlossyButtonExtraShadingTypeNone) {
|
410
|
+
// add additional glossy effect
|
411
|
+
CGContextSaveGState(context);
|
412
|
+
CGContextSetBlendMode(context, kCGBlendModeLighten);
|
413
|
+
[self addShading:context type:_extraShadingType rect:fillRect colorSpace:colorSpace];
|
414
|
+
CGContextRestoreGState(context);
|
415
|
+
}
|
416
|
+
|
417
|
+
CGColorSpaceRelease(colorSpace);
|
418
|
+
|
419
|
+
if (_innerBorderWidth > 0.0) {
|
420
|
+
CGContextRestoreGState(context);
|
421
|
+
}
|
422
|
+
|
423
|
+
[tintColor set];
|
424
|
+
UIRectFillUsingBlendMode(rect, kCGBlendModeOverlay);
|
425
|
+
|
426
|
+
if (isSelected) {
|
427
|
+
[[UIColor lightGrayColor] set];
|
428
|
+
UIRectFillUsingBlendMode(rect, kCGBlendModeMultiply);
|
429
|
+
}
|
430
|
+
}
|
431
|
+
|
432
|
+
#pragma pre-defined buttons
|
433
|
+
|
434
|
+
- (void) setActionSheetButtonWithColor : (UIColor*) color {
|
435
|
+
self.tintColor = color;
|
436
|
+
[self setGradientType:kUIGlossyButtonGradientTypeLinearGlossyStandard];
|
437
|
+
[self.titleLabel setFont: [UIFont boldSystemFontOfSize: 17.0f]];
|
438
|
+
[self useWhiteLabel: NO];
|
439
|
+
self.buttonCornerRadius = 8.0f;
|
440
|
+
self.strokeType = kUIGlossyButtonStrokeTypeGradientFrame;
|
441
|
+
self.buttonBorderWidth = 3.0;
|
442
|
+
self.borderColor = [UIColor colorWithWhite:0.2f alpha:0.8f];
|
443
|
+
[self setNeedsDisplay];
|
444
|
+
}
|
445
|
+
|
446
|
+
- (void) setNavigationButtonWithColor : (UIColor*) color {
|
447
|
+
self.tintColor = color;
|
448
|
+
self.disabledBorderColor = [UIColor lightGrayColor];
|
449
|
+
[self setGradientType:kUIGlossyButtonGradientTypeLinearGlossyStandard];
|
450
|
+
[self.titleLabel setFont: [UIFont boldSystemFontOfSize: 12.0f]];
|
451
|
+
[self useWhiteLabel: NO];
|
452
|
+
[self setTitleColor:[UIColor colorWithWhite:0.5 alpha:1.0] forState:UIControlStateDisabled];
|
453
|
+
self.buttonCornerRadius = 4.0f;
|
454
|
+
self.strokeType = kUIGlossyButtonStrokeTypeInnerBevelDown;
|
455
|
+
self.buttonBorderWidth = 1.0;
|
456
|
+
self.innerBorderWidth = 0.0;
|
457
|
+
[self setNeedsDisplay];
|
458
|
+
}
|
459
|
+
|
460
|
+
@end
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
|
466
|
+
@implementation UIGNavigationButton
|
467
|
+
|
468
|
+
@synthesize leftArrow = _leftArrow;
|
469
|
+
|
470
|
+
- (UIBezierPath *) pathForButton : (CGFloat) inset {
|
471
|
+
CGRect bounds = UIEdgeInsetsInsetRect(self.bounds, _buttonInsets);
|
472
|
+
CGRect rr = CGRectInset(bounds, inset, inset);
|
473
|
+
CGFloat radius = _buttonCornerRadius - inset;
|
474
|
+
if (radius<0.0) radius = 0.0;
|
475
|
+
CGFloat arrowWidth = round(bounds.size.height * 0.30);
|
476
|
+
CGFloat radiusOffset = 0.29289321 * radius;
|
477
|
+
CGFloat extraHeadInset = 0.01118742 * inset;
|
478
|
+
if (_leftArrow) {
|
479
|
+
CGRect rr1 = CGRectMake(arrowWidth+rr.origin.x+extraHeadInset, rr.origin.y, rr.size.width-arrowWidth-extraHeadInset, rr.size.height);
|
480
|
+
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rr1 cornerRadius:radius];
|
481
|
+
[path moveToPoint: CGPointMake(rr.origin.x+extraHeadInset, rr.origin.y + rr.size.height / 2.0)];
|
482
|
+
[path addLineToPoint:CGPointMake(rr.origin.x+arrowWidth+radiusOffset+extraHeadInset, rr.origin.y+radiusOffset)];
|
483
|
+
[path addLineToPoint:CGPointMake(rr.origin.x+arrowWidth+radiusOffset+extraHeadInset, rr.origin.y+rr.size.height-radiusOffset)];
|
484
|
+
[path closePath];
|
485
|
+
return path;
|
486
|
+
}
|
487
|
+
else {
|
488
|
+
CGRect rr1 = CGRectMake(rr.origin.x, rr.origin.y, rr.size.width-arrowWidth-extraHeadInset, rr.size.height);
|
489
|
+
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rr1 cornerRadius:radius];
|
490
|
+
[path moveToPoint: CGPointMake(rr.origin.x + rr.size.width - extraHeadInset, rr.origin.y + rr.size.height / 2.0)];
|
491
|
+
[path addLineToPoint:CGPointMake(rr.origin.x+ rr.size.width - arrowWidth - radiusOffset - extraHeadInset, rr.origin.y+rr.size.height-radiusOffset)];
|
492
|
+
[path addLineToPoint:CGPointMake(rr.origin.x+ rr.size.width - arrowWidth - radiusOffset - extraHeadInset, rr.origin.y+radiusOffset)];
|
493
|
+
[path closePath];
|
494
|
+
return path;
|
495
|
+
}
|
496
|
+
}
|
497
|
+
|
498
|
+
- (CGRect)titleRectForContentRect:(CGRect)contentRect {
|
499
|
+
CGFloat arrowWidth = round(self.bounds.size.height * 0.30);
|
500
|
+
if (_leftArrow) {
|
501
|
+
contentRect.origin.x += arrowWidth; contentRect.size.width -= arrowWidth;
|
502
|
+
}
|
503
|
+
else {
|
504
|
+
contentRect.size.width -= arrowWidth;
|
505
|
+
}
|
506
|
+
return [super titleRectForContentRect: contentRect];
|
507
|
+
}
|
508
|
+
|
509
|
+
@end
|
510
|
+
|
511
|
+
@implementation UIGBadgeButton
|
512
|
+
|
513
|
+
@synthesize numberOfEdges;
|
514
|
+
@synthesize innerRadiusRatio;
|
515
|
+
|
516
|
+
- (void) setupSelf {
|
517
|
+
[super setupSelf];
|
518
|
+
numberOfEdges = 24;
|
519
|
+
innerRadiusRatio = 0.75;
|
520
|
+
}
|
521
|
+
|
522
|
+
- (UIBezierPath *) pathForButton : (CGFloat) inset {
|
523
|
+
CGRect bounds = UIEdgeInsetsInsetRect(self.bounds, _buttonInsets);
|
524
|
+
CGPoint center = CGPointMake(bounds.size.width/2.0, bounds.size.height/2.0);
|
525
|
+
CGFloat outerRadius = MIN(bounds.size.width, bounds.size.height) / 2.0 - inset;
|
526
|
+
CGFloat innerRadius = outerRadius * innerRadiusRatio;
|
527
|
+
CGFloat angle = M_PI * 2.0 / (numberOfEdges * 2);
|
528
|
+
UIBezierPath *path = [UIBezierPath bezierPath];
|
529
|
+
for (NSInteger cc=0; cc<numberOfEdges; cc++) {
|
530
|
+
CGPoint p0 = CGPointMake(center.x + outerRadius * cos(angle * (cc*2)), center.y + outerRadius * sin(angle * (cc*2)));
|
531
|
+
CGPoint p1 = CGPointMake(center.x + innerRadius * cos(angle * (cc*2+1)), center.y + innerRadius * sin(angle * (cc*2+1)));
|
532
|
+
|
533
|
+
if (cc==0) {
|
534
|
+
[path moveToPoint: p0];
|
535
|
+
}
|
536
|
+
else {
|
537
|
+
[path addLineToPoint: p0];
|
538
|
+
}
|
539
|
+
[path addLineToPoint: p1];
|
540
|
+
}
|
541
|
+
[path closePath];
|
542
|
+
return path;
|
543
|
+
}
|
544
|
+
|
545
|
+
@end
|