Post

Replies

Boosts

Views

Activity

Reply to Not getting callback after tapping "Insert text" button in text on camera for UITextField
I edited the first comment to make it readable. import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() setupTextField() } func setupTextField() { let emailTextField = TextField(frame: CGRect(x: 150, y: 150, width: 150, height: 40)) emailTextField.textContentType = .emailAddress emailTextField.keyboardType = .emailAddress emailTextField.autocorrectionType = .no emailTextField.layer.borderWidth = 1 emailTextField.delegate = self self.view.addSubview(emailTextField) let textField = TextField(frame: CGRect(x: 150, y: 250, width: 150, height: 40)) textField.layer.borderWidth = 1 textField.delegate = self textField.rightViewMode = .always self.view.addSubview(textField) let button = UIButton(primaryAction: UIAction.captureTextFromCamera(responder: textField, identifier: nil)) button.frame = CGRect(x: 150, y: 300, width: 150, height: 60) self.view.addSubview(button) } } extension ViewController: UITextFieldDelegate { func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { print("Should change in chars delegate") print(textField.text) return true } func textFieldDidEndEditing(_ textField: UITextField) { print("Did end editing delegate") print(textField.text) } } class TextField: UITextField { override func insertText(_ text: String) { super.insertText(text) print("Insert tet function") print(text) } override func unmarkText() { super.unmarkText() print("Unmark text function") print(self.text) } override func setMarkedText(_ markedText: String?, selectedRange: NSRange) { super.setMarkedText(markedText, selectedRange: selectedRange) print("Marked text function") print(markedText) } } What do you get on console ? Do         print("Should change in chars delegate") or         print("Insert tet function") get printed ? Did you read this thread, maybe there's some interesting info there: https://developer.apple.com/forums/thread/682090
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Xcode 12.5 iSO14.2 some weird messages
UIDatePicker 0x12151d680 is being laid out below its minimum width of 280. What type of a picker is it ? The picker in automatic is now made of 2 components, date and time, displayed separately. The warning (just a warning) warns that if width is less than 280, there is a risk of bad display with large fonts. Complete warning is: UIDatePicker 0x7f94a4666d40 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
Jul ’21
Reply to Show JSON output to screen?
How is NewsFeed defined ? It is probably a struct or a class. A clean way to do it is to add inside the struct or class a description var: struct NewsFeed { // your var declaration // add this one var description : String { // build the string, with the linefeeds "\n" if needed and return it } } Then, in your code: newsview.text = newsFeed.description
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Fatal Exception UIPopoverPresentationController that sourceView is nil after setting sourceView
Thanks for the more readable code. Does the crash occur in all cases ? I do not see where setPopoverPresentationInfo() is called. But setUpPopoverPresentation() seems to be called instead. In some cases you set a sourceRect with zero size. Why ? As you present small chunks of code, it is very hard to see if something is missing or wrong. For instance, in this code   let popoverPresentationController = dropdownTable.setUpPopoverPresentation(    sourceView: sourceView, sourceRect: sourceView.bounds.inset(.init(all: -5))) what are sourceView and sourceRect ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’21
Reply to App store rejected my app due to conflicts between seller name and company name
When you declared your account, you gave a company name (with its DUNS number). You should find it in AppstoreConnect > Contacts > Contact - Legal Entities. But you cannot change the name now, you should need to completely re-register a new account. What you have to change is the info you provided for the app. As your app is apparently a Lottery, you have probably provided the name of a lottery service owner or government entity. That's what is found inconsistent.
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’21
Reply to Show JSON output to screen?
So, I understand you want to show articles. Could you show how Article is defined ? The code would be like: var description : String { var s = "" if articles != nil for article in articles! { if !s.isEmpty { s += "\n" } s += article.content // I don't know how Article is defined } } How do you want to use status ?
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Show JSON output to screen?
Now the articles show up on the simulator, but they are all in raw form. I think I know how to take it from here. Do I put the raw data in a form such as a tableView to be readable? Yes, a tableView is a good way of presenting. It gives a lot of interesting options, as reordering (newest or oldest first) very simply. Then you should populate a dataSource (an array of string) for the tableView. var dataSource : [String] { var source = [String]() if articles != nil { for article in articles! { source.append(article.content) // I don't know how Article is defined } } return source } Note: you can now post image on the forum with the add file button at bottom of editing window: Just take care to reduce the size of image in Preview app, otherwise image is really too large for the forum.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Not getting callback after tapping "Insert text" button in text on camera for UITextField
Have you set the delegates as needed for the UITextFields ? Eventually, show the code.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Unround iOS simulator corners in Big Sur?
AFAIK, there is no way to customize simulator. Does this cause you problem with simulator screen capture (cmd-S) ? Only thing is to send a bug report for an improvement request.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Not getting callback after tapping "Insert text" button in text on camera for UITextField
I edited the first comment to make it readable. import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() setupTextField() } func setupTextField() { let emailTextField = TextField(frame: CGRect(x: 150, y: 150, width: 150, height: 40)) emailTextField.textContentType = .emailAddress emailTextField.keyboardType = .emailAddress emailTextField.autocorrectionType = .no emailTextField.layer.borderWidth = 1 emailTextField.delegate = self self.view.addSubview(emailTextField) let textField = TextField(frame: CGRect(x: 150, y: 250, width: 150, height: 40)) textField.layer.borderWidth = 1 textField.delegate = self textField.rightViewMode = .always self.view.addSubview(textField) let button = UIButton(primaryAction: UIAction.captureTextFromCamera(responder: textField, identifier: nil)) button.frame = CGRect(x: 150, y: 300, width: 150, height: 60) self.view.addSubview(button) } } extension ViewController: UITextFieldDelegate { func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { print("Should change in chars delegate") print(textField.text) return true } func textFieldDidEndEditing(_ textField: UITextField) { print("Did end editing delegate") print(textField.text) } } class TextField: UITextField { override func insertText(_ text: String) { super.insertText(text) print("Insert tet function") print(text) } override func unmarkText() { super.unmarkText() print("Unmark text function") print(self.text) } override func setMarkedText(_ markedText: String?, selectedRange: NSRange) { super.setMarkedText(markedText, selectedRange: selectedRange) print("Marked text function") print(markedText) } } What do you get on console ? Do         print("Should change in chars delegate") or         print("Insert tet function") get printed ? Did you read this thread, maybe there's some interesting info there: https://developer.apple.com/forums/thread/682090
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Xcode 12.5 iSO14.2 some weird messages
UIDatePicker 0x12151d680 is being laid out below its minimum width of 280. What type of a picker is it ? The picker in automatic is now made of 2 components, date and time, displayed separately. The warning (just a warning) warns that if width is less than 280, there is a risk of bad display with large fonts. Complete warning is: UIDatePicker 0x7f94a4666d40 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
Replies
Boosts
Views
Activity
Jul ’21
Reply to UndoManager — how to deal with it?
Does it crash whatever the first action is, or is the first action always a new point ? Why don't you setActionName for new point ? Try to add it and tell what happens.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Where can I get Xcode 10.3 command line tools
You could search here (very long list though and filter is not very efficient): https://developer.apple.com/download/all/?q=Xcode or better: https://developer.apple.com/download/all/?q=Xcode%20command%20line This one seems to be what you are looking for Command Line Tools (macOS 10.14) for Xcode 10.3.dmg
Replies
Boosts
Views
Activity
Jul ’21
Reply to Fatal Exception UIPopoverPresentationController that sourceView is nil after setting sourceView
Could you show the code where you call setUpPopoverPresentation ? Does it crash on iPhone, on iPad ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Cannot rebuild kext cache (M1 Mac)
Are you trying to build kext ? On which MacOS version ? They are now deprecated: https://developer.apple.com/support/kernel-extensions/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to DUNS Issue
If the developer does not want or cannot tell you, I fear there is no way to access account information. AT least not from Apple. What's the problem with creating a new account ? That seems to better reflect the actual situation, isn't it ?
Replies
Boosts
Views
Activity
Jul ’21
Reply to Show JSON output to screen?
How is NewsFeed defined ? It is probably a struct or a class. A clean way to do it is to add inside the struct or class a description var: struct NewsFeed { // your var declaration // add this one var description : String { // build the string, with the linefeeds "\n" if needed and return it } } Then, in your code: newsview.text = newsFeed.description
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Fatal Exception UIPopoverPresentationController that sourceView is nil after setting sourceView
Thanks for the more readable code. Does the crash occur in all cases ? I do not see where setPopoverPresentationInfo() is called. But setUpPopoverPresentation() seems to be called instead. In some cases you set a sourceRect with zero size. Why ? As you present small chunks of code, it is very hard to see if something is missing or wrong. For instance, in this code   let popoverPresentationController = dropdownTable.setUpPopoverPresentation(    sourceView: sourceView, sourceRect: sourceView.bounds.inset(.init(all: -5))) what are sourceView and sourceRect ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to App store rejected my app due to conflicts between seller name and company name
When you declared your account, you gave a company name (with its DUNS number). You should find it in AppstoreConnect > Contacts > Contact - Legal Entities. But you cannot change the name now, you should need to completely re-register a new account. What you have to change is the info you provided for the app. As your app is apparently a Lottery, you have probably provided the name of a lottery service owner or government entity. That's what is found inconsistent.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Show JSON output to screen?
So, I understand you want to show articles. Could you show how Article is defined ? The code would be like: var description : String { var s = "" if articles != nil for article in articles! { if !s.isEmpty { s += "\n" } s += article.content // I don't know how Article is defined } } How do you want to use status ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Show JSON output to screen?
Now the articles show up on the simulator, but they are all in raw form. I think I know how to take it from here. Do I put the raw data in a form such as a tableView to be readable? Yes, a tableView is a good way of presenting. It gives a lot of interesting options, as reordering (newest or oldest first) very simply. Then you should populate a dataSource (an array of string) for the tableView. var dataSource : [String] { var source = [String]() if articles != nil { for article in articles! { source.append(article.content) // I don't know how Article is defined } } return source } Note: you can now post image on the forum with the add file button at bottom of editing window: Just take care to reduce the size of image in Preview app, otherwise image is really too large for the forum.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to iOS Simulator crashing on open
Did you try to create a brand new project (doing nothing) and see if it crashes. If no, problem is in your code. If yes, may be you need to reinstall Xcode. But I understand you did this reinstall already.
Replies
Boosts
Views
Activity
Jul ’21