Post

Replies

Boosts

Views

Activity

Reply to View does not update
Please post the relevant code directly here, don't force us to go and search in the full GitHub project. And explain precisely your set up. what are the different screens where is the save buttons and what does it do ? where are the labels…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
Reply to Swift UIImagePickerController is not sensitive when clicking the Select button
Did you check that the func is called, by adding some print: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]){ print("func was called") picker.dismiss(animated: true, completion: nil) guard let image = info[UIImagePickerController.InfoKey.editedImage] as? UIImage else { print("image is nil") return } guard let imageData = image.pngData() else { print("imageData is nil") return } Do the same in any place where you return prematurely.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to app主要语言设置错误如何更换
How to change the app’s main language setting error I chose Traditional Chinese to create the app, and the name is Simplified Chinese. Now add simplified Chinese localization prompt information as follows? Can the app modify the main language Could you explain the problem ? Do you want to make simplified chinese the development language ? If so, have a look here https://stackoverflow.com/questions/25871815/changing-the-development-language-in-xcode/36926728 你能解释一下这个问题吗? 你想让简体中文成为开发语言吗? 如果是这样,请看这里 https://stackoverflow.com/questions/25871815/changing-the-development-language-in-xcode/36926728
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’21
Reply to DataFlow from Swift to SwfitUI
I don’t understand what you want to achieve with the consecutive assignments: score = "2" score = "3" score = "4" At the end it will always be 4. Or do you mean it is a test if score = "2" { } in that case, please show the real code.
Topic: UI Frameworks SubTopic: UIKit Tags:
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:
Jul ’21