Fully customizable and extensible action sheet controller written in Swift

Overview

XLActionController

Build status Platform iOS Swift 5 compatible Carthage compatible CocoaPods compatible License: MIT

By XMARTLABS.

XLActionController is an extensible library to quickly create any custom action sheet controller.

Examples

The action sheet controllers shown above were entirely created using XLActionController and are included in the Examples. To run the Example project: clone XLActionController repository, open XLActionController workspace and run the Example project.

The code snippet below shows how to present the Tweetbot action sheet controller:

let actionController = TweetbotActionController()

actionController.addAction(Action("View Details", style: .default, handler: { action in
  // do something useful
}))
actionController.addAction(Action("View Retweets", style: .default, handler: { action in
  // do something useful
}))
actionController.addAction(Action("View in Favstar", style: .default, handler: { action in
  // do something useful
}))
actionController.addAction(Action("Translate", style: .default, executeImmediatelyOnTouch: true, handler: { action in
  // do something useful
}))

actionController.addSection(Section())
actionController.addAction(Action("Cancel", style: .cancel, handler:nil))

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

As you may have noticed, the library usage looks pretty similar to UIAlertController.

Actions' handlers are executed after the alert controller is dismissed from screen. If you want, you can change this passing true to the action's constructor to the argument executeImmediatelyOnTouch.

Behind the scenes XLActionController uses a UICollectionView to display the action sheet.

Usage

First create a custom action sheet view controller by extending from the ActionController generic class. For details on how to create a custom action sheet controller look at the Extensibility section.

For instance, let's suppose we've already created TwitterActionController.

// Instantiate custom action sheet controller
let actionSheet = TwitterActionController()
// set up a header title
actionSheet.headerData = "Accounts"
// Add some actions, note that the first parameter of `Action` initializer is `ActionData`.
actionSheet.addAction(Action(ActionData(title: "Xmartlabs", subtitle: "@xmartlabs", image: UIImage(named: "tw-xmartlabs")!), style: .default, handler: { action in
   // do something useful
}))
actionSheet.addAction(Action(ActionData(title: "Miguel", subtitle: "@remer88", image: UIImage(named: "tw-remer")!), style: .default, handler: { action in
   // do something useful
}))
// present actionSheet like any other view controller
present(actionSheet, animated: true, completion: nil)

As the code above illustrates, there are no relevant differences compared to the UIAlertController API.

The main difference is that XLActionController works with any header data type and not only the standard UIAlertController title and message properties. Similarly XLActionController's Action works with any data Type and not only the title string.

// XLActionController:
xlActionController.headerData = SpotifyHeaderData(title: "The Fast And The Furious Soundtrack Collection", subtitle: "Various Artists", image: UIImage(named: "sp-header-icon")!)

// vs UIAlertController:
uiActionController.title = "The Fast And The Furious Soundtrack Collection" // no way to pass an image
uiActionController.message = "Various Artists"
// XLActionController:
let xlAction = Action(ActionData(title: "Save Full Album", image: UIImage(named: "sp-add-icon")!), style: .default, handler: { action in })
// notice that we are able to pass an image in addition to the title
xlActionController.addAction(xlAction)

// vs UIAlertController:
let uiAction = UIAlertAction(title: "Xmartlabs", style: .default, handler: { action in }))
uiActionController.addAction(uiAction)

This can be accomplished because XLActionController is a generic type.

Another important difference is that XLActionController provides a way to add action sections as illustrated in the code below:

  actionController.addSection(Section())

and also each section has a data property. This property is generic, so that it can hold any type. This data will be used to create this section's header view.

let section = actionController.addSection(Section())
section.data = "String" // assuming section data Type is String

Each section contains a set of actions. We typically use sections to show a header view above a set of actions.

Extensibility

ActionController uses a UICollectionView to show actions and headers on screen. Actions will be rendered as instances of UICollectionViewCell. You can use your own subclass of UICollectionViewCell by specifying it in the action controller declaration. Additionally, ActionController allows you to specify a global header and a section header. Headers are shown as collection view's supplementary views.

The ActionController class is a generic type that works with any cell, header, section header type and its associated data types.

Create your custom action sheet controller

XLActionController provides extension points to specify a whole new look and feel to our custom sheet controller and to tweak present and dismiss animations. Let's see an example:

// As first step we should extend the ActionController generic type
public class PeriscopeActionController: ActionController<PeriscopeCell, String, PeriscopeHeader, String, UICollectionReusableView, Void> {

    // override init in order to customize behavior and animations
    public override init(nibName nibNameOrNil: String? = nil, bundle nibBundleOrNil: Bundle? = nil) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        // customizing behavior and present/dismiss animations
        settings.behavior.hideOnScrollDown = false
        settings.animation.scale = nil
        settings.animation.present.duration = 0.6
        settings.animation.dismiss.duration = 0.5
        settings.animation.dismiss.options = .curveEaseIn
        settings.animation.dismiss.offset = 30

        // providing a specific collection view cell which will be used to display each action, height parameter expects a block that returns the cell height for a particular action.
        cellSpec = .nibFile(nibName: "PeriscopeCell", bundle: Bundle(for: PeriscopeCell.self), height: { _ in 60})
        // providing a specific view that will render each section header.
        sectionHeaderSpec = .cellClass(height: { _ in 5 })
        // providing a specific view that will render the action sheet header. We calculate its height according the text that should be displayed.
        headerSpec = .cellClass(height: { [weak self] (headerData: String) in
            guard let me = self else { return 0 }
            let label = UILabel(frame: CGRect(x: 0, y: 0, width: me.view.frame.width - 40, height: CGFloat.greatestFiniteMagnitude))
            label.numberOfLines = 0
            label.font = .systemFontOfSize(17.0)
            label.text = headerData
            label.sizeToFit()
            return label.frame.size.height + 20
        })

        // once we specify the views, we have to provide three blocks that will be used to set up these views.
        // block used to setup the header. Header view and the header are passed as block parameters
        onConfigureHeader = { [weak self] header, headerData in
            guard let me = self else { return }
            header.label.frame = CGRect(x: 0, y: 0, width: me.view.frame.size.width - 40, height: CGFloat.greatestFiniteMagnitude)
            header.label.text = headerData
            header.label.sizeToFit()
            header.label.center = CGPoint(x: header.frame.size.width  / 2, y: header.frame.size.height / 2)
        }
        // block used to setup the section header
        onConfigureSectionHeader = { sectionHeader, sectionHeaderData in
            sectionHeader.backgroundColor = UIColor(white: 0.95, alpha: 1.0)
        }
        // block used to setup the collection view cell
        onConfigureCellForAction = { [weak self] cell, action, indexPath in
            cell.setup(action.data, detail: nil, image: nil)
            cell.separatorView?.isHidden = indexPath.item == self!.collectionView.numberOfItems(inSection: indexPath.section) - 1
            cell.alpha = action.enabled ? 1.0 : 0.5
            cell.actionTitleLabel?.textColor = action.style == .destructive ? UIColor(red: 210/255.0, green: 77/255.0, blue: 56/255.0, alpha: 1.0) : UIColor(red: 0.28, green: 0.64, blue: 0.76, alpha: 1.0)
        }
    }
}

ActionController type declaration:

public class ActionController<ActionViewType: UICollectionViewCell, ActionDataType, HeaderViewType: UICollectionReusableView, HeaderDataType, SectionHeaderViewType: UICollectionReusableView, SectionHeaderDataType>

When extending ActionController we must specify the following view types ActionViewType, HeaderViewType, SectionHeaderViewType. These types are the cell type used to render an action, the view used to render the action sheet header and the view used to render the section header.

Each view type has its associated data: ActionDataType, HeaderDataType, SectionHeaderDataType respectively.

If your custom action sheet doesn't have a header view we can use UICollectionReusableView as HeaderViewType and Void as HeaderDataType. If it doesn't have a section header view you can use UICollectionReusableView as SectionHeaderViewType and Void as SectionHeaderDataType.

The code below shows how we specify these types for the action controllers provided in the example project:

class PeriscopeActionController: ActionController<PeriscopeCell, String, PeriscopeHeader, String, UICollectionReusableView, Void> { ... } // doesn't need to show a section header
class SpotifyActionController: ActionController<SpotifyCell, ActionData, SpotifyHeaderView, SpotifyHeaderData, UICollectionReusableView, Void> { ... } // doesn't need to show a section header
class TwitterActionController: ActionController<TwitterCell, ActionData, TwitterActionControllerHeader, String, UICollectionReusableView, Void> { ... } // doesn't need to show a section header
class YoutubeActionController: ActionController<YoutubeCell, ActionData, UICollectionReusableView, Void, UICollectionReusableView, Void>

Tweaking default style and animation parameters

By following the previous section steps you should already be able to play with your custom action controller. It happens quite often that we need some other customization such as zooming out the presenting view, changing the status bar color or customizing the default present and dismiss animation.

ActionController class defines the settings property of type ActionSheetControllerSettings to tweak all these.

UICollectionView's behavior

// Indicates if the action controller must be dismissed when the user taps the background view. `true` by default.
settings.behavior.hideOnTap: Bool
// Indicates if the action controller must be dismissed when the user scrolls down the collection view. `true` by default.
settings.behavior.hideOnScrollDown: Bool
// Indicates if the collectionView's scroll is enabled. `false` by default.
settings.behavior.scrollEnabled: Bool
// Controls whether the collection view scroll bounces past the edge of content and back again. `false` by default.
settings.behavior.bounces: Bool
// Indicates if the collection view layout will use UIDynamics to animate its items. `false` by default.
settings.behavior.useDynamics: Bool
// Determines whether the navigation bar is hidden when action controller is being presented. `true` by default
settings.hideCollectionViewBehindCancelView: Bool

UICollectionView Style

// Margins between the collection view and the container view's margins. `0` by default
settings.collectionView.lateralMargin: CGFloat
// Cells height when UIDynamics is used to animate items. `50` by default.
settings.collectionView.cellHeightWhenDynamicsIsUsed: CGFloat

Animation settings

Struct that contains all properties related to presentation & dismissal animations

// Used to scale the presenting view controller when the action controller is being presented. If `nil` is set, then the presenting view controller won't be scaled. `(0.9, 0.9)` by default.
settings.animation.scale: CGSize? = CGSize(width: 0.9, height: 0.9)

Present animation settings

// damping value for the animation block. `1.0` by default.
settings.animation.present.damping: CGFloat
// delay for the animation block. `0.0` by default.
settings.animation.present.delay: TimeInterval
// Indicates the animation duration. `0.7` by default.
settings.animation.present.duration: TimeInterval
// Used as `springVelocity` for the animation block. `0.0` by default.
settings.animation.present.springVelocity: CGFloat
// Present animation options. `UIViewAnimationOptions.curveEaseOut` by default.
settings.animation.present.options: UIViewAnimationOptions

Dismiss animation settings

// damping value for the animation block. `1.0` by default.
settings.animation.dismiss.damping: CGFloat
// Used as delay for the animation block. `0.0` by default.
settings.animation.dismiss.delay: TimeInterval
// animation duration. `0.7` by default.
settings.animation.dismiss.duration: TimeInterval
// springVelocity for the animation block. `0.0` by default
settings.animation.dismiss.springVelocity: CGFloat
// dismiss animation options. `UIViewAnimationOptions.curveEaseIn` by default
settings.animation.dismiss.options: UIViewAnimationOptions

StatusBar Style

// Indicates if the status bar should be visible or hidden when the action controller is visible. Its default value is `true`
settings.statusBar.showStatusBar: Bool
// Determines the style of the device’s status bar when the action controller is visible. `UIStatusBarStyle.LightContent` by default.
settings.statusBar.style: UIStatusBarStyle
// Determines whether the action controller takes over control of status bar appearance from the presenting view controller. `true` by default.
settings.statusBar.modalPresentationCapturesStatusBarAppearance: Bool

Cancel view style

Sometimes we need to show a cancel view below the collection view. This is the case of the SpotifyActionController. These properties have nothing to do with the actions added to an action Controller nor with the actions with .Cancel as style value.

 // Indicates if the cancel view is shown. `false` by default.
settings.cancelView.showCancel: Bool
 // Cancel view's title. "Cancel" by default.
settings.cancelView.title: String?
 // Cancel view's height. `60` by default.
settings.cancelView.height: CGFloat
 // Cancel view's background color. `UIColor.black.withAlphaComponent(0.8)` by default.
settings.cancelView.backgroundColor: UIColor
// Indicates if the collection view is partially hidden by the cancelView when it is pulled down.
settings.cancelView.hideCollectionViewBehindCancelView: Bool

Advanced animations

If tweaking previous settings is not enough to make the animations work like you want, XLActionController allows you to change the present/dismiss animation by overriding some functions.

Presentation

open func presentView(_ presentedView: UIView, presentingView: UIView, animationDuration: Double, completion: ((_ completed: Bool) -> Void)?)

The function above is responsible for making the present animation. It encapsulates how the presentation is performed and invokes onWillPresentView, performCustomPresentationAnimation and onDidPresentView to allow you to change a specific point of the animation.

Typically we don't need to override presentView function because overriding either onWillPresentView, performCustomPresentationAnimation or onDidPresentView is enough.

open func onWillPresentView()

onWillPresentView is called before the animation block starts. Any change here won't be animated. It's intended to set the initial animated properties values.

open func performCustomPresentationAnimation(_ presentedView: UIView, presentingView: UIView)

performCustomPresentationAnimation is called from within the main animation block.

open func onDidPresentView()

After the present animation is completed, presentView calls onDidPresentView from within completion callback.

onWillPresentView, performCustomPresentationAnimation, onDidPresentView won't be invoked if you override presentView implementation.

Dismissal

Dismissal animation can be customized in the same way as presentation animation.

open func dismissView(_ presentedView: UIView, presentingView: UIView, animationDuration: Double, completion: ((_ completed: Bool) -> Void)?)

The function above is responsible for making the dismissal animation. It encapsulates how the dismissal animation is performed and invokes onWillDismissView, performCustomDismissingAnimation and onDidDismissView to allow you to change an specific point of the animation.

Typically we don't need to override dismissView method because overriding either onWillDismissView, performCustomDismissingAnimationoronDidDismissView` is enough.

open func onWillDismissView()

Overrides onWillDismissView to perform any set up before the animation begins.

open func performCustomDismissingAnimation(_ presentedView: UIView, presentingView: UIView)

performCustomDismissingAnimation function is invoked from within the main animation block.

open func onDidDismissView()

After the dismissal animation completes, dismissView calls onDidDismissView from within completion callback.

onWillDismissView, performCustomDismissingAnimation, onDidDismissView won't be invoked if you override dismissView implementation.

To show how simple and powerful XLActionController is and give several examples of how to extend ActionController we have mimicked the Skype, Tweetbot, Twitter, Youtube, Periscope and Spotify action controllers.

Requirements

  • iOS 9.3+
  • Xcode 10.2+
  • Swift 5.0+

Getting involved

  • If you want to contribute please feel free to submit pull requests.
  • If you have a feature request please open an issue.
  • If you found a bug or need help please check older issues before submitting an issue.

If you use XLActionController in your app we would love to hear about it! Drop us a line on twitter.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

Specify XLActionController into your project's Podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target '<Your App Target>' do
  # This will install just the library's core, won't include any examples
  pod 'XLActionController'

  # Uncomment depending on the examples that you want to install
  #pod 'XLActionController/Periscope'
  #pod 'XLActionController/Skype'
  #pod 'XLActionController/Spotify'
  #pod 'XLActionController/Tweetbot'
  #pod 'XLActionController/Twitter'
  #pod 'XLActionController/Youtube'
end

Then run the following command:

$ pod install

Carthage

Carthage is a simple, decentralized dependency manager for Cocoa.

Specify XLActionController into your project's Carthage:

github "xmartlabs/XLActionController" ~> 5.1.0

Manually as Embedded Framework

Clone XLActionController as a git submodule by running the following command from your project root git folder.

$ git submodule add https://github.com/xmartlabs/XLActionController.git

Open XLActionController folder that was created by the previous git submodule command and drag the XLActionController.xcodeproj into the Project Navigator of your application's Xcode project.

Select the XLActionController.xcodeproj in the Project Navigator and verify the deployment target matches with your application deployment target.

Select your project in the Xcode Navigation and then select your application target from the sidebar. Next select the "General" tab and click on the + button under the "Embedded Binaries" section.

Select XLActionController.framework and we are done!

Authors

License

XLActionController is released under MIT license and copyrighted by Xmartlabs SRL.

Comments
  • Update for Xcode 11.0 beta 5

    Update for Xcode 11.0 beta 5

    Hello! 👋 An error appears when building in Xcode 11:

    Command CompileXIB failed with a nonzero exit code
    

    This problem was solved by removing customModuleProvider (i.e. Inherit Module From Target) for cells in xib files. 🤗

    opened by Puasonych 11
  • Example app crashes

    Example app crashes

    Example app crashes in this method in DynamicCollectionViewFlowLayout:

    override open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { guard let animator = dynamicAnimator else { return super.layoutAttributesForElements(in: rect) }

        return animator.items(in: rect) as? [UICollectionViewLayoutAttributes]
    }
    

    Here's the console log: fatal error: NSArray element failed to match the Swift Array Element type 2017-10-23 16:27:45.074075-0400 Example[18698:29187926] fatal error: NSArray element failed to match the Swift Array Element type (lldb)

    Using XCode 9 with Swift 4. Choose Tweetbot from the tableview sample app options.

    bug 
    opened by shanehartman 7
  • default implementation of insetForSectionAt, UICollectionViewDelegate…

    default implementation of insetForSectionAt, UICollectionViewDelegate…

    …FlowLayout method

    We should be able to define different inset for section in our ActionController subclasses. Actually it's only possible to set a common inset for all section. So I just added a default implementation of the corresponding delegate method in ActionController, then we can override it in our custom subclasses.

    opened by loryhuz 7
  • ActionCell.xib doesn't have an outlet for actionTitleLabelConstraintToContainer or actionTitleLabelConstraintToImageView

    ActionCell.xib doesn't have an outlet for actionTitleLabelConstraintToContainer or actionTitleLabelConstraintToImageView

    XLActionController 3.0.0, XCode 8, iOS9

    *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<XLActionController.ActionCell 0x7ff32660de50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key actionTitleLabelConstraintToContainer.'

    It appears that actionTitleLabelConstraintToContainer and actionTitleLabelConstraintToImageView don't have outlets in ActionCell.swift.

    bug 
    opened by dmorrow 6
  • Xcode 11

    Xcode 11

    I'm using the last release of XLActionController, but compilation is failing due to an issue with the file "ActionCell.xib". In your last commit, you solve this problem (I've copied the file to my project and works fine with it), but I prefer to use the last releases of XLActionController that I can find in CocoaPods without to worry about changes. Could you upload these last changes to a new release? Thank you!!

    opened by Legasquare90 5
  • Fix error

    Fix error "unexpected duplicate task: CompileXIB " when archiving

    Fix error "unexpected duplicate task: CompileXIB " when archiving with New Build System Xcode 9.

    Solution: Put XIB file into another folder whose name is not "Source" - "Resource" in my PR

    Reference: https://github.com/CocoaPods/CocoaPods/issues/7079

    opened by phucnm 5
  • Add SPM Support

    Add SPM Support

    Before submitting issues ...

    • Make sure you are using XLActionController latest release or master branch version.
    • Make sure your Xcode version is the latest stable one.
    • Check if the issue was already reported or fixed. We add labels to each issue in order to easily find related issues. If you found a match add a brief comment "I have the same problem" or "+1".

    When submitting issues, please provide the following information to help maintainers to fix the problem faster:

    • Environment: XLActionController, Xcode and iOS version you are using.
    • In case of reporting errors, provide Xcode console output of stack trace or code compilation error.
    • Any other additional detail such as example code that you think it would be useful to understand, reproduce and solve the problem.
    opened by Ganesh623 4
  • actionTitleLabel access level

    actionTitleLabel access level

    Hey,

    Thanks for your awesome repo.

    I just have a suggestion. I need to customize the actionTitleLabel so can I pull a request to make actionTitleLabel public?

    As I tried and I got: 'actionTitleLabel' is inaccessible due to 'internal' protection level

    opened by Maryom 4
  • TweetbotActionController not working with Xcode Version 9.4 (9F1027a)

    TweetbotActionController not working with Xcode Version 9.4 (9F1027a)

    Love the code and have been using it.

    Updated to the latest Xcode just now and since the update, none of my tweetbotActionController items will trigger when called. No action.

    Below is my code to change languages:

     func languageOption() {
            
            let localeEN = Locale(identifier: "en")
            let english = (localeEN as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "en")
            let localeDE = Locale(identifier: "de")
            let german = (localeDE as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "de")
            let localeES = Locale(identifier: "es")
            let spanish = (localeES as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "es")
            let localeFR = Locale(identifier: "fr")
            let french = (localeFR as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "fr")
            let localeRU = Locale(identifier: "ru")
            let russian = (localeRU as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "ru")
            let localeCN = Locale(identifier: "zh-Hans")
            let chinese = (localeCN as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: "zh-Hans")
            
            let actionController = TweetbotActionController()
            
            actionController.addAction(Action(english!, style: .default, handler: { action in
                self.englishLanguage ()
            }))
            actionController.addAction(Action(german!, style: .default, handler: { action in
                self.germanLanguage ()
            }))
            actionController.addAction(Action(french!, style: .default, handler: { action in
                self.frenchLanguage ()
            }))
            actionController.addAction(Action(spanish!, style: .default, handler: { action in
                self.spanishLanguage ()
            }))
            actionController.addAction(Action(russian!, style: .default, handler: { action in
                self.russianLanguage ()
            }))
            actionController.addAction(Action(chinese!, style: .default, handler: { action in
                self.chineseLanguage ()
            }))
            actionController.addSection(Section())
            actionController.addAction(Action("Cancel".localized, style: .cancel, handler:nil))
            
            present(actionController, animated: true, completion: {
                self.viewDidLoad()
                self.tableView.reloadData()
            })
            
        }
        
        func englishLanguage (){
            appLanguage = "en"
            userForeignLanguage = false
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
        
        func frenchLanguage () {
            appLanguage = "fr"
            userForeignLanguage = true
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
        
        func germanLanguage () {
            appLanguage = "de"
            userForeignLanguage = true
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
        
        func spanishLanguage () {
            appLanguage = "es"
            userForeignLanguage = true
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
        
        func russianLanguage () {
            appLanguage = "ru"
            userForeignLanguage = false
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
        
        func chineseLanguage () {
            appLanguage = "zh-Hans"
            userForeignLanguage = false
            NotificationCenter.default.post(name: Notification.Name(rawValue: languageChangedKey), object: self)
            self.viewDidLoad()
            self.tableView.reloadData()
        }
    

    I set a breakpoint at each language func, but the action is not even calling the func when selected in the popup menu.

    Have no idea how to solve this on my own and hope that you can upload an updated version.

    Thank you, David

    opened by xs6615 4
  • Gap at bottom of menu on iPhone X

    Gap at bottom of menu on iPhone X

    XLActionController version: 4.0.1 Xcode version: 9.4 Swift 4 Using iPhone X on simulator with iOS 11.4

    I noticed this empty gap between the menu and the bottom of the screen on iPhone X. looks weird

    I know it's due to safe area insets, but I think it looks a bit weird. Does anyone know a way to make it look like this? looks weird

    opened by qtbeee 3
  • Use of unresolved identifier 'YoutubeActionController'?

    Use of unresolved identifier 'YoutubeActionController'?

    Hi there,

    Just got the pod and trying to play around with it. I keep getting "Use of unresolved identifier '...'", no matter which controller I try to instantiate, for example:

    let actionsheet = YoutubeActionController()

    I've imported the lib and all should be fine, however it's not. What to do?

    awaiting response 
    opened by Dbigshooter 3
  • SPM new issues with Xcode 13.0

    SPM new issues with Xcode 13.0

    Importing XLActionController release 5.1.0 with Swift Package Manager on Xcode 13.0

    I get these warnings :

    found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
    /Users/vincent/Library/Developer/Xcode/DerivedData/YoubooxApp-gepbqhkkvarnsgehvdaxymsrqjuw/SourcePackages/checkouts/XLActionController/Source/Info.plist
    

    and Invalid Resource 'Resource/ActionCell.xib': File not found.

    Could you please update package.swift to resolve them ?

    opened by vince4 1
  • In the Spotify style, the Cancel button obscures the following option

    In the Spotify style, the Cancel button obscures the following option

    Hello, I like the XLActionController you made very much, but I found a problem during using it. I opened the Example Project downloaded from GitHub and ran the Spotify example file. I noticed that the Cancel button blocked the options behind it and I had to scroll up the view to see the options below, which was different from the demo GIF. I also had this problem when I was writing code myself.I didn't know how to solve the problem.

    I'm using Xcode version 12.5 and XlActionController version 5.1 simulator_screenshot_F5F09621-2751-439D-82A5-E9414F3BBFA3

    opened by Jackmaliao 1
  • Is there a way to remove cancel button animation?

    Is there a way to remove cancel button animation?

    I like to use and customise the Tweetbot example, but I didn't manager to stop the bounce animation on the cancel button. My goal is just the native look with detail label. I tried to set to false the bounces property, but it's still here.

    opened by elanovasconcelos 0
  • cover safe areas

    cover safe areas

    In iPhone X and above, it shows background on the bottom(in case of YoutubeActionController) because of safe areas. How to cover that up? I am opening this in a custom view in tabbar controller

    opened by singh-karan-7 0
  • Where to place code to 'show more options'

    Where to place code to 'show more options'

    My twitter style popup displays a list of 10 items pulled from a 'paged' api. If one the 10 is not the right one then my app needs to show the next 10 items, this is done by querying the API again for page 2. Where is the best place to put this code?

    opened by netsmith 3
Releases(5.1.0)
Owner
xmartlabs
xmartlabs
zekunyan 608 Dec 30, 2022
A Google like action sheet for iOS written in Swift.

MaterialActionSheetController Lightweight and totally customizable. Create and present it the way you do with UIAlertController. Screenshots Demo | De

Thanh-Nhon NGUYEN 103 Jun 29, 2022
A SwiftUI Partial Sheet fully customizable with dynamic height

A SwiftUI Partial Sheet fully customizable with dynamic height

Andrea Miotto 1.4k Jan 5, 2023
Action sheet allows including your custom views and buttons.

CustomizableActionSheet Action sheet allows including your custom views and buttons. Installation CocoaPods Edit your Podfile: pod 'CustomizableAction

Ryuta Kibe 191 Nov 26, 2021
A Swift library to provide a bouncy action sheet

Hokusai is a Swift library that provides a bouncy action sheet. It will give the users a fancy experience without taking pains coding the cool animati

Yuta Akizuki 430 Nov 20, 2022
AlertTransition is a extensible library for making view controller transitions, especially for alert transitions.

AlertTransition AlertTransition is a extensible library for making view controller transitions, especially for alert transitions. Overview AlertTransi

Loopeer 570 Nov 29, 2022
SplitSheet - A lightweight, fully interactive split-screen sheet.

SplitSheet A lightweight, fully interactive split-screen sheet. Powered by UIScrollView for super-smooth gestures. Show/hide either programmatically o

Andrew Zheng 154 Dec 15, 2022
BottomSheetDemo - Bottom sheet modal view controller with swift

当我们想弹出一个预览视图,bottom sheet modal view controller 非常实用。在 iOS 中,长按拖拽手势可以让 controlle

null 8 Oct 29, 2022
Customizable Dynamic Bottom Sheet Library for iOS

DynamicBottomSheet Powerd by Witi Corp., Seoul, South Korea. Fully Customizable Dynamic Bottom Sheet Library for iOS. This library doesn't support sto

Witi Official 10 May 7, 2022
A fully customizable popup style menu for iOS 😎

Guide Check out the documentation and guides for details on how to use. (Available languages:) English 简体中文 What's a better way to know what PopMenu o

Cali Castle 1.5k Dec 30, 2022
It is a highly configurable iOS library which allows easy styling with built in styles as well as extra header and footer views so that you can make extremely unique alerts and action sheets.

 CFAlertViewController CFAlertViewController is a library that helps you display and customise Alerts, Action Sheets, and Notifications on iPad and i

Crowdfire Inc. 1.1k Dec 18, 2022
A Floating Action Button just like Google inbox for iOS

VCFloatingActionButton A Floating Action Button inspired from Google inbox for iOS. Using this in your project Import the VCFloatingActionButton to yo

Giridhar 298 May 16, 2022
ActionBee is a programmable pasteboard action trigger.

ActionBee ActionBee is a programmable pasteboard action trigger. Preview Video It can be used to clean your URL in text. To see code or import this mo

Derek Jones 2 Aug 24, 2022
Dice roller, character sheet/ creator, and monster/item info app on the iphone12

DnD-LordDogMaw This file will be the start of a side project in the hopes of creating an iphone12 app for Dungeons and Dragons! This app will have 3 m

Paige Guajardo 2 Sep 17, 2021
Present a sheet ViewController easily and control ViewController height with pangesture

PanControllerHeight is designed to present a sheet ViewController easily and control ViewController height with pangesture.

null 2 May 3, 2022
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.

Wouter 63 Jan 5, 2023
DGBottomSheet - The lightest swift bottom sheet library

DGBottomSheet Requirements Installation Usage DGBottomSheet The lightest swift b

donggyu 9 Aug 6, 2022
SwiftUI Draggable Bottom Sheet

SwiftUI Draggable Bottom Sheet

paigeshin 2 Mar 3, 2022
Bottom Sheet component is widely used in Joom application

Bottom Sheet Bottom Sheet component is widely used in Joom application Installation Swift Package Manager Swift Package Manager is a tool for managing

Joom 101 Dec 29, 2022