Latest 0.1.3
Homepage https://github.com/rohan-jansen/PopKit
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Platform

CocoaPods Compatible

Example

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

Requirements

Installation

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

pod "PopKit"

Alt Text

Use

To use PopKit is extremenly simple. Use PopKitBuilder to initialise your popup view. Create your own custom UIView or UIViewcontroller and add that to either the popupView or popupViewController property depending on which type of view you are using. Have a look at the samples below for some example uses. A proper example project is in the works still ;)

Example side menu with a UIViewController as popup view


var sideMenu: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.edges(left: 0, right: nil, top: 0, bottom: 0), .width(275)]
        $0.inAnimation = .bounceFromLeft(damping: 0.82, velocity: 2, animationOption: .curveEaseInOut)
        $0.outAnimation = .bounceFromRight(damping: 0.72, velocity: 2, animationOption: .curveEaseInOut)
        $0.backgroundEffect = .blurDark
        $0.popupViewController = SideMenuViewController.fromStoryboard()
    }
}

sideMenu.show()

To dismiss the popup, simply call Popkit.dismiss() from anywhere

Example top notification pop down view, using a Xib as the popup view


var topNotification: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.edges(left: 0, right: 0, top: 0, bottom:nil), .height(90)]
        $0.inAnimation = .bounceFromTop(damping: 0.9, velocity: 2, animationOption: .curveEaseInOut)
        $0.outAnimation = .bounceFromBottom(damping: 0.86, velocity: 2, animationOption: .curveEaseInOut)
        $0.backgroundEffect = .blurDark
        $0.transitionSpeed = 0.3
        $0.popupView = NotificationView.loadView()
    }
}

topNotification.show()

Example menu moving up from bottom


var bottomMenu: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.edges(left: 0, right: 0, top: nil, bottom:0), .height(400)]
        $0.inAnimation = .bounceFromBottom(damping: 0.86, velocity: 2, animationOption: .curveEaseInOut)
        $0.outAnimation = .bounceFromTop(damping: 0.72, velocity: 2, animationOption: .curveEaseInOut)
        $0.backgroundEffect = .transparentOverlay(0.5)
        $0.transitionSpeed = 0.3
        $0.popupView = TestView(radius: 0)
    }
}

bottomMenu.show()

Example popup bouncing in from the top


var bounceFromTop: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.center(x: 0, y: 0), .width(300), .height(350)]
        $0.inAnimation = .bounceFromTop(damping: 0.72, velocity: 2, animationOption: .curveEaseInOut)
        $0.outAnimation = .bounceFromBottom(damping: 0.86, velocity: 2, animationOption: .curveEaseInOut)
        $0.backgroundEffect = .blurDark
        $0.popupView = CenterModalView.loadView()
    }
}

bounceFromTop.show()

Example popup sliding in from the bottom


var slideFromBottom: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.center(x: 0, y: 0), .width(300), .height(300)]
        $0.inAnimation = .slideFromBottom(animationOption: .curveEaseOut)
        $0.outAnimation = .slideFromTop(animationOption: .curveEaseInOut)
        $0.backgroundEffect = .blurDark
        $0.transitionSpeed = 0.3
        $0.popupView = TestView()
    }
}

slideFromBottom.show()

Example popup zooming in


var zoomIn: PopKit {
    return PopKitBuilder() {
        $0.constraints = [.center(x: 0, y: 0), .width(300), .height(300)]
        $0.inAnimation = .zoomOut(1.2, animationOption: .curveEaseInOut)
        $0.outAnimation = .bounceFromBottom(damping: 0.86, velocity: 2, animationOption: .curveEaseInOut)
        $0.backgroundEffect = .blurDark
        $0.transitionSpeed = 0.46
        $0.popupView = TestView()
    }
}

zoomIn.show()

Contributing

There’s still a lot of work to do here! We would love to see you involved!

Get in touch

If you have any questions, you can find the core team on twitter:

Author

rohan-jansen, [email protected]

License

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

Latest podspec

{
    "name": "PopKit",
    "version": "0.1.3",
    "summary": "A flexible framework as a one size fits all solution for popups, modals, notifications and menus",
    "description": "The purpose of this pod is to provide users with a one size fits all solution popups, modals, notifications and menus. The are hundreds of different little libraries that are very specific, which means that in the end your solution gets clogged up with tons of pods, which is completely unnecessary. Popkit is a flexible solution for you to create any form of popup in any size, with control of animations and constraints.",
    "homepage": "https://github.com/rohan-jansen/PopKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Rohan Jansen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rohan-jansen/PopKit.git",
        "tag": "0.1.3"
    },
    "social_media_url": "https://twitter.com/rohan_jansen",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "PopKit/Classes/**/*",
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This