morizotter / SwiftyDrop

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

add text alignment #63

Closed black-lotus closed 6 years ago

black-lotus commented 6 years ago

Change text aligment based on user specification

enum MyDropState: DropStatable {
                                        case Stockbit
                                        var backgroundColor: UIColor? {
                                            switch self {
                                            case .Stockbit: return UIColor.white
                                            }
                                        }
                                        var font: UIFont? {
                                            switch self {
                                            case .Stockbit: return UIFont.proxymanovaRegular(ofSize: 14)
                                            }
                                        }
                                        var textColor: UIColor? {
                                            switch self {
                                            case .Stockbit: return UIColor(red: 58/255, green: 58/255, blue: 58/255, alpha: 1)
                                            }
                                        }
                                        var blurEffect: UIBlurEffect? {
                                            switch self {
                                            case .Stockbit: return nil
                                            }
                                        }
                                        var textAlignment: NSTextAlignment? {
                                            switch self {
                                            case .Stockbit: return NSTextAlignment.left
                                            }
                                        }
                                    }
morizotter commented 6 years ago

Sorry for late reply. Merged! Thanks!