Posts

Post marked as solved
1 Replies
462 Views
I don't know whether it is right to post this question here. I am trying to integrating Razorpay in my iOS app. Is there iOS custom SDK for Razorpay? Please suggest me if there is any Custom SDK for iOS Razorpay integration or any other option for the same. Thank you
Posted
by mksmurali.
Last updated
.
Post marked as solved
3 Replies
1.1k Views
Hi I have a textField to provide Date for Birth(Requirement). Initially the textField should have the text "DD MM YYYY" . And if I key in the date of birth, need to remove characters (DD MM YYYY) one by one. Scenario: DD MM YYYY is the text displayed in TextField initially. After typing first digit(for example 3), it should be like " 3D MM YYYY " After typing second digit(for example 1, it should be like " 31 MM YYYY " After typing third digit(for example 0, it should be like " 31 0M YYYY " After typing fourth digit(for example 8, it should be like " 31 08 YYYY " and so on.... Is this possible?
Posted
by mksmurali.
Last updated
.
Post not yet marked as solved
0 Replies
334 Views
Hi, In my objectiveC project ,i tried to use swift. so I added a swift file in my objectiveC project. accepted to add bridging file. Once i use "#import "ProductModuleName-Swift.h" in objectiveC file, and build the project, i am getting error "#pragma clang attribute pop' with no matching '#pragma clang attribute push'". Why this error? How to fix?
Posted
by mksmurali.
Last updated
.
Post marked as solved
3 Replies
1.7k Views
Hi,My Code SnippetmyTextView.heightAnchor.constraint(greaterThanOrEqualToConstant: 20).isActive = truelet myHTMLString =" some html text" myTextView.attributedText = myHTMLString.htmlToAttributedStringextension String { var htmlToAttributedString: NSAttributedString? { guard let data = data(using: .utf8) else { return NSAttributedString() } do { return try NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding:String.Encoding.utf8.rawValue], documentAttributes: nil) } catch { return NSAttributedString() } } var htmlToString: String { return htmlToAttributedString?.string ?? "" } }HTMLString converted to attributed string.But,extra lines of white spaces exists in myTextView at the bottom.What is the reason?How to recitify it?Thanks In Advance
Posted
by mksmurali.
Last updated
.
Post not yet marked as solved
3 Replies
526 Views
Hi, I used below code for UITextField Keyboard Type.sampleTextField.keyboardType = .decimalPadIn the keyborad displayed,how to add % key ?Thanks
Posted
by mksmurali.
Last updated
.
Post marked as solved
1 Replies
956 Views
Hi,My Code to get Local Time From UTC:func getLocalTimeFromUTC(dateString: String) -> (String,String){ let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss" dateFormatter.timeZone = TimeZone(abbreviation: "UTC") let dt = dateFormatter.date(from: dateString) dateFormatter.timeZone = TimeZone.current dateFormatter.dateFormat = "dd/MM/yyyy HH:mm:ss" let finalDate = dateFormatter.string(from: dt!) let finalDateArr = finalDate.components(separatedBy: " ") return (finalDateArr[0] , finalDateArr[1]) }If the time format is 24 hours in my iPhone, no problem in the above code.But when i change the time format from 24 hours to 12 hours in my iPhone, dt is nil.How to handle this?
Posted
by mksmurali.
Last updated
.
Post not yet marked as solved
1 Replies
1.9k Views
Hi,How to align an image and string of an attributed String to vertical center?I attached an image by using NSTextAttachment()And i appended a string.The alignment of the image and the string looks like below: 😐 GoodNoonHow to align the string to be vertically center to the image?
Posted
by mksmurali.
Last updated
.
Post not yet marked as solved
16 Replies
7.0k Views
Hi, How to handle Date in TextField with all validations?suppose if my date format is DD/MM/YYYY HH:mm,and when i type the date ,for example 10it should add /and when i type month ,for example 10/12it should add /and when i type year ,for example 10/12/2019it should add a spaceand when i type the hour,for example 10/12/2019 10it should add a colonand then i can type the minutes like 10/12/2019 10:10My code Snippet:In textfield delegate method , shouldChangeCharactersIn ,func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {if textField.text?.count == 1 { textField.placeholder = "DD/MM/YYYY HH:mm"}if (textField.text?.count == 2) || (textField.text?.count == 5) { //Handle backspace being pressed if !(string == "") { txtValue.text = textField.text! + "/" } }else if (textField.text?.count == 10) { if !(string == "") { txtValue.text = textField.text! + " " } }else if (textField.text?.count == 13) { if !(string == "") { txtValue.text = textField.text! + ":" } } return !(textField.text!.count > 15 && (string.count) > range.length)}The problem is , when backspace tapped from inbetween the date in the textfield,it should validate the date.How to handle this?below gif image shows what is required.
Posted
by mksmurali.
Last updated
.
Post marked as solved
3 Replies
1.5k Views
Hi, I used URLSession to call Api.Code sample : let defaultSessionConfiguration = URLSessionConfiguration.default defaultSessionConfiguration.timeoutIntervalForRequest = 600 defaultSessionConfiguration.timeoutIntervalForResource = 600 defaultSessionConfiguration.urlCache = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil) defaultSessionConfiguration.requestCachePolicy = .reloadIgnoringLocalAndRemoteCacheData let defaultSession = URLSession(configuration: defaultSessionConfiguration) let task = defaultSession.dataTask(with: urlRequest) { data, response, error in ... } task.resume() }When service was called and it was not completed,I pressed home button.So app went to background state.And Api call was failed....How to make Api call to get success in this scenerio and what is reason for api call failure?Thanks in advance for the supporter.
Posted
by mksmurali.
Last updated
.