morizotter / SwiftyDrop

Lightweight dropdown message bar in Swift. It's simple and beautiful.
MIT License
683 stars 74 forks source link

Custom view issue #70

Open rameshpjpti opened 4 years ago

rameshpjpti commented 4 years ago

import SwiftyDrop

enum Custom: DropStatable {

    case BlackGreen
    var backgroundColor: UIColor? {
        switch self {
        case .BlackGreen: return .black
        }
    }
    var font: UIFont? {
        switch self {
        case .BlackGreen: return UIFont(name: "HelveticaNeue-Light", size: 24.0)
        }
    }
    var textColor: UIColor? {
        switch self {
        case .BlackGreen: return .green
        }
    }
    var blurEffect: UIBlurEffect? {
        switch self {
        case .BlackGreen: return nil
        }
    }
}

error:: Type 'Custom' does not conform to protocol 'DropStatable'

please suggest me. how to solve this issue?

BukhariMuslim commented 4 years ago

DropStatable has textAlignment property. So put it there to resolve the issue.

  var textAlignment: NSTextAlignment? {
    switch self {
    default: return .left
    }
  }