Latest 1.4.0
Homepage https://github.com/red3/HHAttachmentSheetView
License MIT
Platforms ios 7.0, requires ARC
Authors

HHAttachmentSheetView

travis CI
Carthage compatible
Version
License
Platform

HHAttachmentSheetView is inspired by this repo: Telegram Messenger for iOS.

image

For more details: blog.coderhr.com

Feature

  • Swipe to dismiss.
  • Support to using the UI_APPEARANCE_SELECTOR to customize the appearance.
  • Support both the iPhone and iPad, and also support both the portrait mode and landscape mode.

Requirements

  • Xcode7 or higher
  • iOS 6.0 or higher
  • ARC
  • Objective-C

Installation

CocoaPods

pod "HHAttachmentSheetView"

Carthage

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.

Manual

Add HHAttachmentSheetView folder into your project.

Demo

Open and run the HHAttachmentSheetViewDemo.xcodeproj in Xcode to see HHAttachmentSheetView in action

Example usage


     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");
    }];

TODO

  • Add more customized item sample like HHAttachmentSheetButtonItemView

Update Logs

2016.06.09 (Tag: 1.4.0)

  • Support for reloadItemsmethod to update the items with animation.

2016.05.06 (Tag: 1.2.0)

  • Add new HHAttachmentSheet.h file to support for Manual install.

2016.03.21 (Tag: 1.1.0)

  • Support for Carthage

2015.12.29 (Tag: 1.0.0)

  • Support for CocoaPods

2015.12.23

  • first commit

Support

  • If you have any questions, please Issues me, thank you. :)
  • Blog: hirain
  • Buy me a cup of coffee? 👇

HHAttachmentSheetView

License

HHAttachmentSheetView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HHAttachmentSheetView",
    "version": "1.4.0",
    "authors": {
        "Herui": "[email protected]"
    },
    "homepage": "https://github.com/red3/HHAttachmentSheetView",
    "summary": "A lightweight, easy to use, attachment actionSheetView",
    "source": {
        "git": "https://github.com/red3/HHAttachmentSheetView.git",
        "tag": "1.4.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "HHAttachmentSheetView/*",
    "requires_arc": true,
    "ios": {
        "frameworks": [
            "UIKit",
            "Foundation"
        ]
    }
}

Pin It on Pinterest

Share This