Latest 1.4.1
Homepage https://github.com/MaxOstPM/OLManager
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Overlay Manager is a lightweight, easy-to-use, written on Swift – helper, which will provide you the convenient API to manage your custom overlays lifecycle with avoiding code repeating.

Example

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

Installation

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

pod 'OLManager'

Usage

import OLManager

// MARK: - OverlayManagerFlowSetup
enum YourCustomOverlays: OverlayLevelHolder { 
    case successOverlay
    case failurOverlay

    var level: YourCustomOverlays {
        switch self {
            case .successOverlay:
            return .global
            case .failurOverlay:
            return .local
        }
    }
}

final class OverlayFactoryImp: OverlayFactory {

    func makeOverlayWith(type: YourCustomOverlays) -> UIView {
        switch type {
            ...
        }
    }
}

final class OverlayManagerProvider {

    static let provider = OverlayManagerProvider()

    var overlayManager: OverlayManagerOf<OverlayFactoryImp>

    init() {
        let factory = OverlayFactoryImp()
        overlayManager = OverlayManagerOf<OverlayFactoryImp>(factory: factory)
    }
}

// MARK: - TestViewController
final class ViewController: BaseViewController {
    let overlayManager = OverlayManagerProvider.provider.overlayManager
    var overlayManageable: OverlayManageable?

    // MARK: UserInteraction
    @IBAction func testButtonAction(_ sender: Any) {
        let location = PinningLocation(horizontalEdge: .left, verticalEdge: .top)
        let config = OverlayDisplayConfiguration(animationType: .slide, pinningLocation: location)
        overlayManageable = overlayManager.displayOverlay(OverlayViewType.'your overlay type', configuration: config)
    }
}

Author

MaxOstPM, [email protected]

License

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

Latest podspec

{
    "name": "OLManager",
    "version": "1.4.1",
    "summary": "Lightweight pod that will help you to manage your custom Overlays in easiest way.",
    "description": "Overlay Manager is a lightweight, easy-to-use, written on Swift - helper, which will provide you the convenient API to manage your custom overlays lifecycle with avoiding code repeating.",
    "homepage": "https://github.com/MaxOstPM/OLManager",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "MaxOstPM": "[email protected]"
    },
    "source": {
        "git": "https://github.com/MaxOstPM/OLManager.git",
        "tag": "1.4.1"
    },
    "swift_versions": "4.2",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "OLManager/ServiceLayer/**/*.swift"
}

Pin It on Pinterest

Share This