Skip to content

Swift 4.2 compiler error in String+CreditCardRow #12

@mrhaxic

Description

@mrhaxic

To avoid the compiler error of subscript Range we have to use the following

        let start = index(startIndex, offsetBy: r.lowerBound)
        let end = index(start, offsetBy: r.upperBound - r.lowerBound)
        let range: Range<Index> = start..<end
        return String(self[range])
    }

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions