Home

Awesome

ActionsList

Swift Version Carthage compatible License Platform

ActionsList is an iOS framework for presenting actions lists similar to Apple's Quick Actions menu. It presents and dismisses list with actions with animation from the source view.

It is the best replace for the Android's floating action button in iOS if your app is following the iOS Design Guidelines.

ScreenShot

Requirements

Features

Known Issues

Constraints to UITabBarItem do not work properly, so after orientation change sourceView and senderView will have different frames and content positions.

In iOS 11 UIBarButtonItem created with image or title initializer has wrong content frame, so sourceView will be a bit offset. Instead, use init(customView:) to create UIBarButtonItem with UIButton and create list with this button. In iOS 10 or earlier issue is not present.

Installation

StatusAlert is available via CocoaPods and Carthage.

CocoaPods

To install StatusAlert using CocoaPods, add the following line to your Podfile:

pod 'ActionsList', '~> 0.9.1'

Carthage

To install StatusAlert using Carthage, add the following line to your Cartfile:

github "LowKostKustomz/ActionsList" ~> 0.9.1

Demo

Demo application is included in the ActionsList workspace. To run it clone the repo.

Demo Screenshot

Usage

// Importing framework
import ActionsList

// Save list model to a property or it will be deallocated and you will have no ability to control it outside of the scope list was created in
private var list: ActionsListModel? = nil

// Creating list in your method
private func method() {

	// For UIButton instance (must be in the view hierarchy)
	let list = uiButton.createActionsList() // Use createActionsList(withDelegate:) if needed
	
	// For UITabBarItem instance (must be in the view hierarchy)
	let list = uiTabBarItem.createActionsList() // Use createActionsList(withDelegate:) if needed
	
	// For UIBarButtonItem instance (must be in the view hierarchy)
	let list = uiBarButtonItem.createActionsList() // Use createActionsList(withColor:font:delegate:) if needed
	
	// For your custom view (must be in the view hierarchy)
	let list = ActionsListModel(senderView: viewThatEmittedListShowing, 
	sourceView: copyOfSenderViewToShowAboveBackgroundView, 
	delegate: actionsListDelegate)
	
	// Add actions to list in order to 
	list.add(action: ActionsListDefaultButtonModel(localizedTitle: "Create Alarm",
	                                               image: UIImage(named: "Alarm clock"),
	                                               action: { action in
		                                                // You can use action's list property to control it
		                                               
		                                                // - To dismiss
		                                                action.list?.dismiss()
		                                                
		                                                // - To update action appearance
		                                                action.appearance.//anything
		                                                //     Do not forget to reload actions to apply changes
		                                                action.list?.reloadActions()
	}))
	
	// Present list
	list.present()
	
	// Do not forget to save list to the property
	self.list = list
}

Customization

IMPORTANT

To save system look and feel:

  • do not change any of the appearance properties or another settings;
  • do not add more than 4 actions to the list;
  • do not disable feedback;
List

To customize list background colors use ActionsListModel's appearance property or ActionsListAppearance.List.common to set default appearance.

Actions

To customize actions you can use ActionsListDefaultButtonModel's appearance property or ActionsListAppearance.Button.common to set default appearance.

Action can be disabled, you can control it via the ActionsListDefaultButtonModel's isEnabled property.

Actions generate feedback on highlight, to manage this see Feedback section.

Background View

To set custom background view use ActionsListBackgroundViewBuilder's type property.

Custom background view should implement ActionsListBackgroundView protocol

ActionsListBackgroundViewBuilder.instance.type = .custom(backgroundView: customBackgroundView)

To change default dimmed view dimming color use ActionsListAppearance.BackgroundView.common.dimmingColor

Feedback

Taptic engine used on iPhone 6s and iPhone 6s Plus only.

Haptic feedback used on iPhone 7, iPhone 7 Plus and later.

Other devices do not produce feedback.

To disable feedback generation use FeedbackGenerator.instance.isEnabled property. This property manages list opening and action highlight feedback.

Apps Using ActionsList

<img src="Assets/BitxfyIcon.png" width="50"> Bitxfy

BitxfyScreenShot


Feel free to submit pull request if you are using this framework in your apps.

Author

Author ActionsList

<img src="https://gitlab.com/ZEBSTER/FrameworksAssets/-/raw/master/Socials/Twitter.png" width="80"> <img src="https://gitlab.com/ZEBSTER/FrameworksAssets/-/raw/master/Socials/Email.png" width="80">

All projects

ActionsList

ActionsList


StatusAlert

StatusAlert

License

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