Post

Replies

Boosts

Views

Activity

Reply to Xcode 12 iOS 14 error purchase
I'm with you guys. I have one month subscription in-app purchase, initial purchase works OK, auto-renewals works OK, but when all automatic renewals are proceeded, so it becomes actually "expired" subscription, then when I try to renew this subscription manually it sometimes gives me this error (and sometimes doesn't!) in SKPaymentTransactionObserver . func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) (lldb) po transactions[0].error ▿ Optional<Error> &#9;- some : Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x28216fed0 {Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x28216e460 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, NSLocalizedFailureReason=The response has an invalid status code}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}}}
Sep ’20
Reply to Observe ALL UITextView text changes in realtime
OK, after a lot of research I've tried RxSwift because I thought that observing text in reactive paradigm framework should succeed in 100% cases. And it worked without any issues! inputTextView.rx.text.subscribe(onNext: { string in &#9;&#9;print("rx: \(string)") }) So it seems that these guys have found the solution. https://github.com/ReactiveX/RxSwift/blob/master/RxCocoa/iOS/UITextView%2BRx.swift And here is the solution that gives you information about all text changes despite of auto correction, text selection, and etc.. class ViewController: UIViewController { &#9;&#9;@IBOutlet weak var inputTextView: UITextView! &#9;&#9;override func viewDidLoad() { &#9;&#9;&#9;&#9;super.viewDidLoad() &#9;&#9;&#9;&#9;inputTextView.textStorage.delegate = self &#9;&#9;} } extension ViewController: NSTextStorageDelegate { &#9;&#9;func textStorage(_ textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorage.EditActions, range editedRange: NSRange, changeInLength delta: Int) { &#9;&#9;&#9;&#9;print("string: \(textStorage.string)") &#9;&#9;} }
Jun ’20
Reply to Observe ALL UITextView text changes in realtime
Yeah, I tried delegate approach, it works the same as Notifications. I've described problem with shouldChangeTextIn. iOS auto correction won't inform you about it's work in shouldChangeTextIn. For example when you double tap space button, probably you will see dot instead of first space and this information about dot insertion doesn't go to shouldChangeTextIn.
Jun ’20