prolificinteractive / Caishen

A Payment Card UI & Validator for iOS
MIT License
766 stars 119 forks source link

xcode 9 beta 4 Build failed pod #114

Closed feemi closed 6 years ago

feemi commented 7 years ago

StringExtension.swift

    func NSRangeFrom(_ range : Range<String.Index>) -> NSRange {
        let utf16view = self.utf16
        let from = String.UTF16View.Index(range.lowerBound, within: utf16view)
        let to = String.UTF16View.Index(range.upperBound, within: utf16view)
        return NSMakeRange(utf16view.startIndex.distance(to: from), from.distance(to: to))
    }

NSMakeRange(utf16view.startIndex.distance(to: from), from.distance(to: to)) Value of optional type 'String.UTF16View.Index?' (aka 'Optional') not unwrapped; did you mean to use '!' or '?'?

steven-diaz commented 7 years ago

Yes, please address before Swift 3.2 goes live. Thanks!

DannyVancura commented 7 years ago

Hi, I created a Swift 3.2 branch for this (using current Xcode 9 Beta 5). I noticed an issue with both Swift 3.2 as well as Swift 4.0:

When you open the view controller containing a card text field and closing it again (without entering text in the text field), the app crashes after the view was dismissed. Not so, if you enter something in the text field prior to closing the view. In this case no crashes occur. Unfortunately I wasn't able to get any error about why this is failing yet and am still investigating.

piercifani commented 7 years ago

Any news?

ywalterh commented 7 years ago

I'm seeing this with XCode 9 as well.

zahedul commented 7 years ago
screen shot 2017-10-20 at 6 05 34 am

Using Xcode 9. couldn't run

DannyVancura commented 6 years ago

The Swift 4 branch has been merged and the current version supports Swift 4.