String

struct String
  • Check if string is valid with given regex

    Declaration

    Swift

    internal func isValidRegex(_ regex: String) -> Bool
  • Check if string is only letters character set

    Declaration

    Swift

    internal var isLetters: Bool { get }
  • Check if string is only digits character set

    Declaration

    Swift

    internal var isDigits: Bool { get }
  • Check if string is only alpha numerics character set

    Declaration

    Swift

    internal var isAlphanumerics: Bool { get }
  • Returns bounding box size for a given font

    Declaration

    Swift

    internal func constrainedSize(width: CGFloat = .greatestFiniteMagnitude,
                                  height: CGFloat = .greatestFiniteMagnitude,
                                  font: UIFont) -> CGSize
  • Sejima: Returns a localized string, with an optional comment for translators.

       "Hello world".localized -> Bonjour le monde
    

    Declaration

    Swift

    public func localized(comment: String = "") -> String
  • Sejima: Check if string is valid email format.

    Note

    Note that this property does not validate the email address against an email server. It merely attempts to determine whether its format is suitable for an email address.

    john@doe.com.isValidEmail -> true ❤️@❤️.com.isValidEmail -> true aa@❤️.co.isValidEmail -> true aa@aa.c.isValidEmail -> false a@a.co.isValidEmail -> false a@❤️.com.isValidEmail -> false aa@❤️.c.isValidEmail -> false

    Declaration

    Swift

    public var isValidEmail: Bool { get }