Post

Replies

Boosts

Views

Activity

Reply to App macOS Core Data and Swift
How to remove that “+” that appears in the upper right corner of the application; Where does it appear ? In the menubar ? In the window of the app ? elsewhere ? How to build the menu, so that you can place calls to the features I need in it; Which menu ? in the menubar ? If so, what is the problem ? in a popup menu ? elsewhere ? Can someone tell me where to find a good example of an app with Core Data, Menu and CRUD operations, using Swift? This is a bit old and objC. But that may give you ideas on the overall architecture. https ://useyourloaf. com/blog/creating-an-os-x-core-data-helper-app/
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
There is something incorrect in class creation: class NameVC: UIViewController, RegisterNameProtocol { var name: String? let vc3 = VerifyPhoneNumberVC() vc3 is not instantiated. So how do you present it ? You said: The first view presents the second View and the second presents the third view. I do not see this anywhere in code. BTW: your life would me much simpler with storyboard… The details of this func are very important: please show it @objc func goNext() { // The function which presents vc2 name = nametextField.text! print("Name: \(vc3.Username)") // ... }
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Update a view from a button in another view.
Do as follows: declare a name (give what you want) extension Notification.Name {      public static let kRefresh = Notification.Name("refresh") } In the view that has to receive notification, add observer in viewDidLoad:         NotificationCenter.default.addObserver(self, selector: #selector(refresh), name: .kRefresh, object: nil)  And create the func to handle the notification     @objc func refresh() {      // Update elements you have to update in this receiving view } Hope that's clear. If that's OK, don't forget to close the thread on the correct answer. Otherwise, please tell what you miss. The view sends notification with:         NotificationCenter.default.post(name: .kRefresh, object: self) 
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
You dont't load anything in PhoneNumberVC. Where is the content of PhoneNumberVC defined ? In a nib file ? You should instantiate nextVC from it. In addition, you could simplify a little your code: @objc func goNext() { name = nametextField.text! print("Name: \(name)") // if nametextField.text?.isEmpty == false { if !name.ismpty { let nextVC = PhoneNumberVC() // That's a problem nextVC.modalPresentationStyle = .fullScreen // present(nextVC, animated: true, completion: nil) } else { print("No valid name") } }
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift Student Challenge
Because of if If it runs on iPadOS I understand that you have the choice between any of the 3:be written in and run on Swift Playgrounds 3.4.1 on iPadOS 14.4.2, Swift Playgrounds 3.4.1 on macOS 11.2.3, or Xcode 12.4 on macOS 11.2.3.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Swift Student Challenge
You need to provide a proof that you are a student. So, a document from your school attesting you study there should be OK. (I think that's the best) Or if you received a document of your class schedule, copy it. That will allow to check with the dean or principal if that's authentic. Don't forget to provide the contact address for your dean or principal (e mail should be best).
Topic: Programming Languages SubTopic: Swift Tags:
May ’21