SwiftyDrop icon indicating copy to clipboard operation
SwiftyDrop copied to clipboard

Custom view issue

Open rameshpjpti opened this issue 5 years ago • 1 comments

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?

rameshpjpti avatar Nov 17 '19 17:11 rameshpjpti

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

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

BukhariMuslim avatar Apr 23 '20 06:04 BukhariMuslim