mkactionsheet

Welcome to the documentation for MKActionSheet!

About MKActionSheet

MKActionSheet is a versatile UI component providing a customizable, action-sheet-like interface for iOS apps. It allows you to present a list of actions to the user in a clean and easy-to-use manner.

Installation

To install MKActionSheet, follow the steps below:

  • Ensure you have Cocoapods installed on your machine
  • Add the following line to your Podfile:
pod 'MKActionSheet'

Then run the following command in your project directory:

pod install

Usage

To use MKActionSheet in your app, follow the instructions below.

Show an MKActionSheet

To present an MKActionSheet, start by importing the MKActionSheet class:

import MKActionSheet

Create an instance of MKActionSheet:

let actionSheet = MKActionSheet()

Specify the actions you want to show in the sheet using the addAction() method:

actionSheet.addAction(MKAction(title: "Action 1", action: {
    // Perform action 1 here
}))

Finally, present the action sheet:

actionSheet.present(from: self, sourceView: yourSourceView)

Customization

You can customize various aspects of the MKActionSheet appearance:

Change Background Color

To change the background color of the action sheet, use the backgroundColor property:

actionSheet.backgroundColor = .white

Change Text Color

To change the text color of the action sheet, use the textColor property:

actionSheet.textColor = .black

Change Action Button Color

To change the color of action buttons, use the actionButtonColor property:

actionSheet.actionButtonColor = .blue

Change Action Button Text Color

To change the text color of action buttons, use the actionButtonTextColor property:

actionSheet.actionButtonTextColor = .white

Additional Resources

For more information and examples, you can refer to the following resources: