Skip to content

SwiftyContainer is very Ez animation!! πŸ˜€ πŸ‘» πŸ§‘β€πŸ’»

License

Notifications You must be signed in to change notification settings

jungseungyeo/SwiftyContainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SwiftyContainer

Swift CocoaPods License

Install

  pod 'SwiftyContainer'

How to use


import SwiftyContainer

// crate Interactor
lazy var swiftyContainerInteractor: SwiftyContainerInteractorable = {

    struct Component: SwiftyComponentable {
        var leftMarginOffset: CGFloat { 10 }
        var rightMarginOffset: CGFloat { -10 }
        var bottomMarginOFfset: CGFloat { 10 }
    }

    let component = Component()

    let composition = SwiftyCompositionContainer.resolve(parentsView: view,
                                                         animationView: containerView,
                                                         component: component)

    let container = SwiftyContainerBuilder(dependency: composition).create()

    return container
}()

Show Container

func show() {

    swiftyContainerInteractor.showDidAppear = {
      // didShowAppear
    }

    swiftyContainerInteractor.show()
}

Hide Container

func hide() {

    swiftContainerInteractor.hideDidAppear = {
      // didHideAppear
    }

    swiftyContainerInteractor.hide()
}

screenshot

Catch Error

import SwiftyContainer

override func viewDidLoad() {
    super.viewDidLoad

    swiftyContainer.error = { error in

        // erorr catch
        // error type is SwiftyContainerError
        self.errorHandler(error: Error)

    }
}

func errorHandler(error: Error) {
    guard let swiftyContainerError = error as? SwiftyContainerInteractorError else { return }
    switch swiftyContainerError {
    case .alreadyShow:
        // ...
    case .alreadyHide:
        // ...
    case .duringAnimation:
        // ...
    case .unknown:
        // ...
    }
}

Author

LinSaeng

License

SwiftlyIndicator is licensed under the MIT license. Check the LICENSE file for details./LICENSE) file for details.

About

SwiftyContainer is very Ez animation!! πŸ˜€ πŸ‘» πŸ§‘β€πŸ’»

Resources

License

Stars

Watchers

Forks

Packages

No packages published