HHAttachmentSheetView is inspired by this repo: Telegram Messenger for iOS.
Want you to know that you can inherited from HHAttachmentSheetItemView
to customized your own item. Blow is a sample item named HHAssetsCarouselItemView
which enables you to pick a assets in your Photo Library like Messages app, please visit this REPO to see more detail about how to use this item.
For more details: blog.coderhr.com
- Swipe to dismiss.
- Support to using the
UI_APPEARANCE_SELECTOR
to customize the appearance. - Allow customized item just inherited from
HHAttachmentSheetItemView
- Support both the iPhone and iPad, and also support both the portrait mode and landscape mode.
- Xcode7 or higher
- iOS 6.0 or higher
- ARC
- Objective-C
pod "HHAttachmentSheetView"
Carthage is a decentralized dependency manager for Cocoa application. To install the carthage tool, you can use Homebrew.
$ brew update
$ brew install carthage
To integrate HHAttachmentSheetView into your Xcode project using Carthage, specify it in your Cartfile
:
github "red3/HHAttachmentSheetView" ~> 1.4.0
Then, run the following command to build the HHAttachmentSheetView framework:
$ carthage update
At last, you need to set up your Xcode project manually to add the HHAttachmentSheetView framework.
On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk.
On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following content:
/usr/local/bin/carthage copy-frameworks
and add the paths to the frameworks you want to use under “Input Files”:
$(SRCROOT)/Carthage/Build/iOS/HHAttachmentSheet.framework
For more information about how to use Carthage, please see its project page.
Add HHAttachmentSheetView
folder into your project.
Open and run the HHAttachmentSheetViewDemo.xcodeproj
in Xcode to see HHAttachmentSheetView in action
NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:5];
[items addObject:[[HHAttachmentSheetButtonItemView alloc] initWithTitle:@"ChoosePhoto" pressed:^ {
NSLog(@"choose photo");
}]];
[items addObject:[[HHAttachmentSheetButtonItemView alloc] initWithTitle:@"ChooseViedo" pressed:^ {
NSLog(@"choose viedo");
}]];
[items addObject:[[HHAttachmentSheetButtonItemView alloc] initWithTitle:@"SearchPhoto" pressed:^ {
NSLog(@"search photo");
}]];
HHAttachmentSheetButtonItemView *deleteItem = [[HHAttachmentSheetButtonItemView alloc] initWithTitle:@"DeletePhoto" pressed:^{
NSLog(@"delete photo");
}];
deleteItem.destructive = YES;
[items addObject:deleteItem];
HHAttachmentSheetButtonItemView *cancelItem = [[HHAttachmentSheetButtonItemView alloc] initWithTitle:@"Cancel" pressed:^{
NSLog(@"cancel");
}];
cancelItem.bold = YES;
[items addObject:cancelItem];
HHAttachmentSheetView *sheetView = [[HHAttachmentSheetView alloc] initWithItems:items];
[sheetView showWithAnimate:YES completion:^{
NSLog(@"show complete");
}];
- Add more customized item sample like
HHAttachmentSheetButtonItemView
- Add customized item HHAssetsCarouselItemView, follow this repo to see more details.
- Support for
reloadItems
method to update the items with animation.
- Add new
HHAttachmentSheet.h
file to support for Manual install.
- Support for Carthage
- Support for CocoaPods
- first commit
HHAttachmentSheetView
is available under the MIT license. See the LICENSE file for more info.