String

public extension String
  • Converts date string to remaining time

    Declaration

    Swift

    var remainingTime: String? { get }
  • String Date to Date

    Declaration

    Swift

    func date(format: String? = "yyyy-MM-dd'T'HH:mm:ss") -> Date?

    Parameters

    format

    Date Format

    Return Value

    Corverted Date

String Helpers

  • Undocumented

    Declaration

    Swift

    static let empty: String
  • Undocumented

    Declaration

    Swift

    static let newline: String
  • Undocumented

    Declaration

    Swift

    static let whitespace: String
  • Undocumented

    Declaration

    Swift

    var length: Int { get }
  • Trims Whitespaces and Newlines

    Declaration

    Swift

    var trimmed: String { get }
  • Trims trailing and leading whitespaces

    Declaration

    Swift

    var trimmedLeadingAndLeading: String { get }
  • ns

    Converts String to NSString

    Declaration

    Swift

    var ns: NSString { get }
  • Undocumented

    Declaration

    Swift

    var floatValue: Float { get }
  • Undocumented

    Declaration

    Swift

    var integerValue: Int { get }
  • nib

    Undocumented

    Declaration

    Swift

    var nib: UINib { get }
  • A Boolean value indicating whether the collection is not empty.

    Declaration

    Swift

    var isNotEmpty: Bool { get }
  • Converts formatted double

    Declaration

    Swift

    var toDouble: Double { get }
  • Init with optional character

    Declaration

    Swift

    init?(_ c: Character?)

    Parameters

    c

    Optinal Character

Crypto

  • Undocumented

    Declaration

    Swift

    var sha1: String? { get }

HTML

  • Converts HTML to NSMutableAttributedString

    Declaration

    Swift

    var html2AttributedString: NSMutableAttributedString? { get }

URL Helpers

  • Encodes URL

    Declaration

    Swift

    var urlEncoded: String? { get }
  • Decodes URL Spaces

    Declaration

    Swift

    var urlDecoded: String? { get }
  • url

    String to URL

    Declaration

    Swift

    var url: URL? { get }

Label

  • Returns label’s height

    Declaration

    Swift

    func getLabelHeight(width: CGFloat,
                        font: UIFont,
                        numberOfLines: Int = 0,
                        lineBreakMode: NSLineBreakMode = .byWordWrapping) -> CGFloat

    Parameters

    width

    Label’s width

    font

    Used font

    numberOfLines

    Number of lines

    lineBreakMode

    Line break mode

    Return Value

    Height