Post

Replies

Boosts

Views

Activity

Reply to Beginner Swift Playground
So you now know the basics. If you want to develop an app, that will not be in playground. Did you study "Intro to App development with Swift" ? At Chapter 5 they start building a real app. If you did, you have now to find the idea for an app. Choose something very simple for the first app, like a quizz. Good continuation.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
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