Post

Replies

Boosts

Views

Activity

Reply to certificate is not trusted
What should I do? Thanks for taking the time to read this. Dictionary Definitions from Oxford Languages · Learn more Get with the program INFORMAL•NORTH AMERICAN do what is expected of one; adopt the prevailing viewpoint. "come on you guys—get with the Xcode 15 program!" Automatic code signing is probably no longer supported for this version of Xcode
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’23
Reply to UIView (UIButton) Won't re-render after label updates
Change this class FilterFormViewController: UIViewController, UITextFieldDelegate { @Binding var status: String @Binding var type: String @Binding var resultCount: Int @Binding var showFilterSelectionView: Bool init(status: Binding<String>, type: Binding<String>, resultCount: Binding<Int>, showFilterSelectionView: Binding<Bool>) { self._status = status self._type = type self._resultCount = resultCount self._showFilterSelectionView = showFilterSelectionView super.init(nibName: nil, bundle: nil) } To class FilterFormViewController: UIViewController, UITextFieldDelegate { var status: String { didSet { // assign status to UIKit control } } var type: String { didSet { // assign type to UIKit control } } var resultCount: Int { didSet { // assign resultCount to UIKit control submitButton.setTitle("Show \(self.resultCount) results", state: .normal) } } var showFilterSelectionView: Bool let submitButton: UIButton init(status: String, type: String, resultCount: Int, showFilterSelectionView: Bool) { self.status = status self.type = type self.resultCount = resultCount self.showFilterSelectionView = showFilterSelectionView super.init(nibName: nil, bundle: nil) submitButton = UIButton() submitButton.isEnabled = true submitButton.addTarget(self, action: #selector(hideFilters), for: .touchUpInside) } You're trying to use SwiftUI patterns in UIKit, this won't work. Because the View Controller is being updated by the feedback from updateUIViewController method of the UIView Controller Representable in response to incoming changes from the view model publishers. The view model is pushing data down or over to the view controller not from view controller to view model. If you want to push data from the view controller back to the swiftui view model, you will need to delegate protocols or call back handlers so when the data changes on the UIKit side of the code the call back handlers will pass this data back to the Bindings independent of the updateUIViewController life cycle updates.
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’23
Reply to How to prevent singleton base class getting re-initialised
import SwiftUI @main struct BlueTest1App: App { @State private var manager = BLEManager() var body: some Scene { WindowGroup { ContentView(bleManager: manager) } } } OR import SwiftUI @main struct BlueTest1App: App { @State private var manager = BLEManager() var body: some Scene { WindowGroup { ContentView() .envitonmentObject(manager) } } } struct ContentView: View { @EnvironmentObject private var bleManager: BLEManager ... }
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’23
Reply to SwiftUI against SwiftData is too fragile and error prone
Then, you're using the wrong hammer for the nail in question. There are many SwitfUI sample apps available that you can use as a reference for the architecture employed by Apple, such as MVC and MVVM. The language is designed to be semicolonless unless multiple statements are being packed into one line, which then calls for a semicolon. This sounds like your first go at SwiftUI and SwiftData. My recommendation will be to study the SwiftData Sample applications such as BackyardbirdsbuildingAnAppWithSwiftData, to see how Apple approached the issue.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’23
Reply to SwiftData Unexpected type for CompositeAttribute
Questions 1 Why are you using Codable with a @Model type? 2 Why are you not using the SwiftData relationship attribute to define the relationship between foo and some struct or vice versa? If you're transmitting foo or some struct as JSON over the wire, then you shouldn't mix the swift data models with codables.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to certificate is not trusted
What should I do? Thanks for taking the time to read this. Dictionary Definitions from Oxford Languages · Learn more Get with the program INFORMAL•NORTH AMERICAN do what is expected of one; adopt the prevailing viewpoint. "come on you guys—get with the Xcode 15 program!" Automatic code signing is probably no longer supported for this version of Xcode
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to UIView (UIButton) Won't re-render after label updates
Change this class FilterFormViewController: UIViewController, UITextFieldDelegate { @Binding var status: String @Binding var type: String @Binding var resultCount: Int @Binding var showFilterSelectionView: Bool init(status: Binding<String>, type: Binding<String>, resultCount: Binding<Int>, showFilterSelectionView: Binding<Bool>) { self._status = status self._type = type self._resultCount = resultCount self._showFilterSelectionView = showFilterSelectionView super.init(nibName: nil, bundle: nil) } To class FilterFormViewController: UIViewController, UITextFieldDelegate { var status: String { didSet { // assign status to UIKit control } } var type: String { didSet { // assign type to UIKit control } } var resultCount: Int { didSet { // assign resultCount to UIKit control submitButton.setTitle("Show \(self.resultCount) results", state: .normal) } } var showFilterSelectionView: Bool let submitButton: UIButton init(status: String, type: String, resultCount: Int, showFilterSelectionView: Bool) { self.status = status self.type = type self.resultCount = resultCount self.showFilterSelectionView = showFilterSelectionView super.init(nibName: nil, bundle: nil) submitButton = UIButton() submitButton.isEnabled = true submitButton.addTarget(self, action: #selector(hideFilters), for: .touchUpInside) } You're trying to use SwiftUI patterns in UIKit, this won't work. Because the View Controller is being updated by the feedback from updateUIViewController method of the UIView Controller Representable in response to incoming changes from the view model publishers. The view model is pushing data down or over to the view controller not from view controller to view model. If you want to push data from the view controller back to the swiftui view model, you will need to delegate protocols or call back handlers so when the data changes on the UIKit side of the code the call back handlers will pass this data back to the Bindings independent of the updateUIViewController life cycle updates.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to App renders as a black on screen
Please post all questions related to Google's flutter on their respective forums or Github repo for them to fix.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Backyard Sample App Testing code
There is no unit testing code.
Replies
Boosts
Views
Activity
Dec ’23
Reply to How to prevent singleton base class getting re-initialised
import SwiftUI @main struct BlueTest1App: App { @State private var manager = BLEManager() var body: some Scene { WindowGroup { ContentView(bleManager: manager) } } } OR import SwiftUI @main struct BlueTest1App: App { @State private var manager = BLEManager() var body: some Scene { WindowGroup { ContentView() .envitonmentObject(manager) } } } struct ContentView: View { @EnvironmentObject private var bleManager: BLEManager ... }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Storage issue with not installed os update
@PatrickPaniew - Your question will be better served in the retail customer support forums here https://discussions.apple.com/welcome. Sorry, but this board is for 3rd party Apple developer related discussions.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Did iOS 17.2 break zIndex?
If there is no parent ZStack then the .zIndex modifier is ineffective.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Uploading Unity project to Xcode
Unity-Xcode integration questions will have to be posted on the Unity boards for a Unity representative to provide assistance.
Replies
Boosts
Views
Activity
Dec ’23
Reply to Apple doc still refers to nonexistent info.plist. Should we use the entitlements file instead?
Refer to the info.plist options in build settings when autogenerate info.plist is true.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Apple doc still refers to nonexistent info.plist. Should we use the entitlements file instead?
Here is the entry when info.plist is autogenerated true.
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to SwiftUI against SwiftData is too fragile and error prone
Then, you're using the wrong hammer for the nail in question. There are many SwitfUI sample apps available that you can use as a reference for the architecture employed by Apple, such as MVC and MVVM. The language is designed to be semicolonless unless multiple statements are being packed into one line, which then calls for a semicolon. This sounds like your first go at SwiftUI and SwiftData. My recommendation will be to study the SwiftData Sample applications such as BackyardbirdsbuildingAnAppWithSwiftData, to see how Apple approached the issue.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Xcode and iOS Emulator 17.2 Error
Simulator
Replies
Boosts
Views
Activity
Jan ’24
Reply to Can we use voiceOver (speak out) and voice control (voice command) when user turned OFF both voiceOver and voice control in settings > accessibility? .
You don't control it. The user controls it via Accessibility features.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to IPHONE 13 GLITCH/UNRESPONSIVE
Sorry this forum is dedicated exclusively to developer-related activity and questions. Your questions can be best served by an Apple Store Genius or in the customer retail forums https://discussions.apple.com/welcome
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Jan ’24