SkillAgentSearch skills...

SheetViewController

SheetViewController - is a customizable native-like sheet alert controller

Install / Use

/learn @bananaRanger/SheetViewController
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <img width="72%" height="72%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/00-preview.png?raw=true"> </p>

CI Status Version License Platform

SheetViewController

SheetViewController is a fully customizable and native-like alert sheet controller UI component written in Swift.

Features

  • [x] Three types of alerts: with inner action, with outer action, without action.
  • [x] Two alignment types of alerts: bottom, center.
  • [x] Fully customisation components. You can customise content (header, actions), color, fonts, forms, spaces and etc.
  • [x] Works on iPad.
  • [x] Easy to use.
  • [x] Works on both orientations: portrait, landscape.

UI customization Q&A

How to change the color?

<p align="center"> <img width="58%" height="58%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/01-how%20to%20change%20the%20color.png?raw=true"> </p>

How to change the corner radius?

<p align="center"> <img width="58%" height="58%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/02-how%20to%20change%20the%20corner%20radius.png?raw=true"> </p>

How to change the spacing?

<p align="center"> <img width="58%" height="58%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/03-how%20to%20change%20the%20spacing.png?raw=true"> </p>

How to change sheet offsets?

<p align="center"> <img width="58%" height="58%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/04-how%20to%20change%20sheet%20offsets.png?raw=true"> </p>

Other settings

<p align="center"> <img width="58%" height="58%" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/05-other%20settings.png?raw=true"> </p>

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

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

inhibit_all_warnings!

target 'YOUR_TARGET_NAME' do
  use_frameworks!
	pod 'SheetViewController'
end

Usage

import SheetViewController

// 'titleMessage' - title for alert.
// 'message' - message for alert.
// 'cancelTitle' - title for bottom button.
//
// 'customRowView' - the object of class 'UIView' or his inheritors.
// 'row' - the object of class 'SheetItemActionView'.
//
// 'alignmentType' values:
// - .bottom - displays an alert located at the bottom of the screen;
// - .center - displays an alert located at the center of the screen.
//
// 'actionType' values:
// - .separately - displays an alert with a bottom action button located separately;
// - .inner - displays an alert with an action button located insite the alert;
// - .none - displays an alert without a button.

let sheet = SheetViewController(
      with: titleMessage,
      message: message,
      alignmentType: .bottom,
      actionType: .separately) { configuration in
        // UI customization (see UI customization Q&A section)
        return configuration
    }

present(sheet, animated: true, completion: nil)

sheet.addView(customRowView)
sheet.addRow(actionView: row)

sheet.setCancelButton(title: cancelTitle) {
      print("Cancel button did click")
}

Demo

<p align="center"> <img width="216" height="417" src="https://github.com/bananaRanger/SheetViewController/blob/master/Resources/short-demo.gif?raw=true"> </p>

Author

📧 Anton Yereshchenko

License

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

Inspired by

Designing for iPhone in Figma - https://setproduct.com/ios

Used in project

Icons:

Icons8 - https://icons8.com

View on GitHub
GitHub Stars33
CategoryDevelopment
Updated1mo ago
Forks10

Languages

Swift

Security Score

95/100

Audited on Feb 28, 2026

No findings