• Stars
    star
    1,162
  • Rank 40,165 (Top 0.8 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An alternative to the UIActionSheet inspired by the Spotify app.

AHKActionSheet

License: MIT CocoaPods

An alternative to the UIActionSheet with a block-based API and a customizable look. Inspired by the Spotify app. It looks a lot better live than on the GIF (because compression).

Demo GIF

Features

  • Modern, iOS 7 look
  • Block-based API
  • Highly customizable
  • Gesture-driven navigation with two ways to hide the control: either quick flick down or swipe and release (at the position when the blur is starting to fade)
  • Use a simple label or a completely custom view above the buttons
  • Use with or without icons (text can be optionally centered)
  • Status bar style matches the one from the presenting controller

Demo

Build and run the AHKActionSheetExample project in Xcode. AHKViewController.m file contains the important code used in the example.

Requirements

  • iOS 6.0 and above
  • ARC
  • Optimized for iPhone

Installation

CocoaPods

AHKActionSheet is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "AHKActionSheet"

Manual

Copy all files from Classes/ directory to your project. Then, add QuartzCore.framework to your project.

Usage

A simple example:

#import "AHKActionSheet.h"
...
AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithTitle:nil];
[actionSheet addButtonWithTitle:@"Test" type:AHKActionSheetButtonTypeDefault handler:^(AHKActionSheet *as) {
    NSLog(@"Test tapped");
}];
[actionSheet show];

The view is customizable either directly or through a UIAppearance API. See the header file (Classes/AHKActionSheet.h) and the example project to learn more.

Changelog

0.5.4

  • Fix cancelOnTapEmptyAreaEnabled behavior

0.5.3

  • Added cancelOnTapEmptyAreaEnabled property
  • Updated the project to compile cleanly on Xcode 7

0.5.2

  • Fixed visible cancel button even though its height was set to 0.

0.5.1

  • Fixed issues with separators on iOS 8

0.5

  • Fixed bugs on iOS 8

0.4.2

  • Fixed incorrect orientation of the blurred snapshot on iOS 8

0.4.1

  • Improved dismissal error handling

0.4.0

  • Added a new button type: AHKActionSheetButtonTypeDisabled
  • Added cancelOnPanGestureEnabled property, which allows you to disable:

    Gesture-driven navigation with two ways to hide the control: either quick flick down or swipe and release (at the position when the blur is starting to fade)

  • Internal scroll view's bounces is now disabled when cancelOnPanGestureEnabled is turned off and when the scroll view's contentSize's height is smaller than the screen's height.

0.3.0

  • Added iOS 6 support

0.2.0

  • Added animationDuration property
  • Added some basic unit tests
  • Improved comments in the header file

0.1.3

0.1.2

  • UIWindow is now snapshotted instead of UIViewController's view

0.1.1

  • Refactorings
  • Bug fixes

0.1.0

  • Initial release

Author

Arkadiusz Holko:

More Repositories

1

Optimizing-Swift-Build-Times

Collection of advice on optimizing compile times of Swift projects.
Swift
3,579
star
2

MotionBlur

MotionBlur allows you to add motion blur effect to iOS animations.
Objective-C
1,505
star
3

IBAnalyzer

Find common xib and storyboard-related problems without running your app or writing unit tests.
Swift
955
star
4

SloppySwiper

UINavigationController delegate that allows swipe back gesture to be started from anywhere on the screen (not just from the edge).
Objective-C
806
star
5

DeallocationChecker

Catch leaking view controllers without opening Instruments.
Swift
793
star
6

AHKBendableView

UIView subclass that bends its edges when its position changes.
Swift
592
star
7

EmojiTextView

Tap to swap out words with emojis. Inspired by Messages.app on iOS 10.
Swift
338
star
8

ReflectableEnum

Reflection for enumerations in Objective-C.
Objective-C
330
star
9

ConfigurableTableViewController

Typed, yet Flexible Table View Controller
Swift
269
star
10

AHKNavigationController

A UINavigationController subclass that re-enables the interactive pop gesture when the navigation bar is hidden or a custom back button is used.
Objective-C
232
star
11

HamburgerButton

Animated hamburger button.
Swift
197
star
12

BouncyView

Action Sheet animation based on Skype's iOS app.
Swift
128
star
13

AHKSlider

A UISlider subclass that improves the precision of selecting values.
Objective-C
59
star
14

SwiftOutTimingFunction

SwiftOutTimingFunction brings Google's new *Swift Out* animation curve to iOS.
Objective-C
44
star
15

AHKBuilder

Initialization for immutable objects based on the builder pattern.
Objective-C
39
star
16

SingleFetchedResultController

Like NSFetchedResultsController but for a single managed object.
Swift
26
star
17

StoryboardDependencyInjectionTemplates

Code generation of initializers for storyboard-based view controllers
HTML
19
star
18

BezierCurveFit

A simple app for fitting Bezier curve based on data points from another curve.
Objective-C
9
star
19

sicp

My solutions to exercises from "Structure And Interpretation Of Computer Programs"
Scheme
5
star
20

cool-compiler-examples

MIPS assembler files generated by my COOL compiler
Assembly
4
star
21

epidemic-simulation

Source code of a research project based on the use of cellular automata.
JavaScript
2
star
22

ContentOffsetJump

Source code of my answer: http://stackoverflow.com/a/19344402/1990236
Objective-C
1
star