Latest 0.1.1
License MIT
Platforms ios 8.0

CI Status




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



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

pod "FKWidgetSheet"


FKWidgetSheet can present any object that conforms to ‘FKWidgetSheetContentProtocol’.
UIViewController and UINavigationController extensions are provided out of the box.
Take a look at them in ‘FKWidgetSheet.swift‘ file to get an idea.

To present a view controller or a navigation controller from any view controller

<presenter instance>.present(inWidgetSheet: <view controller instance>, animated: true)

To dismiss the action sheet from content view controller

self.dismissWidgetSheet(animated: true)

To provide a scroll view to observe from a view controller

override func scrollViewToObserve(containedIn widgetSheet: FKWidgetSheet) -> UIScrollView? {
    return <scrollview instance>

Control collapsed and expanded heights using

open func collapsedHeight(containedIn widgetSheet: FKWidgetSheet) -> CGFloat {
    return <height>

open func expandedHeight(containedIn widgetSheet: FKWidgetSheet) -> CGFloat {
    return <height>

Use these to customize behaviour

public var blurBackground: Bool = true
public var blurStyle: UIBlurEffectStyle = .dark
public var dismissOnTouchOutside: Bool = true
public var backgroundImage: UIImage? 
public var backgroundView: UIView? 


Use delegate to get callbacks. Delegate conforms to ‘FKWidgetSheetDelegate’.

These callbacks are sent when sheet is shown or hidden.

@objc optional func widgetSheetWillShow(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidShow(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetWillHide(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidHide(_ sheet: FKWidgetSheet)

These callbacks are given when widget sheet view appears or disappears.
Use them if you’d wanna update some thing in content on appearance transitions.

@objc optional func widgetSheetWillAppear(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidAppear(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetWillDisappear(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidDisappear(_ sheet: FKWidgetSheet)


Return a content view using this from content controller

var view: UIView! {get}

Prepare for content view lifecycle events using these (Checkout UIViewController extension in FKWidgetSheet.swift)

@objc optional func widgetSheetWillAddContent(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidAddContent(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetWillRemoveContent(_ sheet: FKWidgetSheet)
@objc optional func widgetSheetDidRemoveContent(_ sheet: FKWidgetSheet)

Configure behaviour using these (Checkout SecondViewController.swift and UIViewController extension in FKWidgetSheet.swift)

@objc optional func collapsedHeight(containedIn widgetSheet: FKWidgetSheet) -> CGFloat
@objc optional func expandedHeight(containedIn widgetSheet: FKWidgetSheet) -> CGFloat

@objc optional func scrollViewToObserve(containedIn widgetSheet: FKWidgetSheet) -> UIScrollView?

To know content and state use these readonly vars

public var content: FKWidgetSheetContentProtocol
public var state

Example of presenting any content

let widgetSheet = FKWidgetSheet(content: <FKWidgetSheetContentProtocol instance>)
<presenter instance>.present(widgetSheet, animated: true, completion: completion)


rajatgupta26, [email protected]


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

Latest podspec

    "name": "FKWidgetSheet",
    "version": "0.1.1",
    "summary": "A simple control that enables presenting any view controller or any other object that can provide a view like an ActionSheet",
    "description": "FKWidgetSheet enables presenting any content in an ActionSheet.nThe content provider has to follow 'FKWidgetSheetContentProtocol'.nExtensions for UIViewController and UINavigationController have been added in the pod itself so that comes right out of the box.nIt is also possible to have the content expand or collapse based on collapsed height and expanded height.nIf there is a scrollview and you'd like to expand or collapse the content seemlessly on scroll, that is also possible.nYou could customize the background and whether the sheet should be dismissed on tapping outside content or not.nCallbacks are given for all the events as well. Both 'FKWidgetSheetContentProtocol' and 'FKWidgetSheetDelegate' getncallbacks for different events.nnCheckout the example in the code.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "rajatgupta26": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "source_files": [
    "exclude_files": "Classes/Exclude",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This