Post

Replies

Boosts

Views

Activity

Reply to Push data to other VC with protocol, error: force unwrapped a nil value
VC1: class NameVC: UIViewController, RegisterNameProtocol {     var name: String?     let vc3 = VerifyPhoneNumberVC()  override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .black         vc3.nameDelegate = self } @objc func goNext() { The function which presents vc2          name = nametextField.text!         print("Name: \(vc3.Username)") ... } } VC2: class PhoneNumberVC: UIViewController, UITextFieldDelegate, RegisterNumberProtocol {     var phoneNumber: String?     let vc3 = VerifyPhoneNumberVC() override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .black         vc3.phoneDelegate = self ... } func push() {         phoneNumber = phoneNumberTextField.text!         print("Number: \(phoneNumber)") ... } } V3: class VerifyPhoneNumberVC: UIViewController { var nameDelegate: RegisterNameProtocol?     var phoneDelegate: RegisterNumberProtocol?     var UserphoneNumber = ""     var Username = "" override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .white         UserphoneNumber = (phoneDelegate?.phoneNumber) ?? ""         Username = (nameDelegate?.name) ?? ""         print("Number: \(UserphoneNumber), Name: \(Username)") } I think that's all:)
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
Of course, I thought it would be unnecessary, here I the code:  @objc func goNext() {          name = nametextField.text!         print("Name: \(name)")                  if nametextField.text?.isEmpty == false {             let nextVC = PhoneNumberVC()             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 Firebase Error: Thread 1: "Failed to get FirebaseDatabase instance: Specify DatabaseURL within FIRApp or from your databaseForApp:URL: call."
At the beginning I had it like this but then I tried to change some things. The point that makes me so angry is that I already had this error but I don't know how I solved it in the past
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
VC1: class NameVC: UIViewController, RegisterNameProtocol {     var name: String?     let vc3 = VerifyPhoneNumberVC()  override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .black         vc3.nameDelegate = self } @objc func goNext() { The function which presents vc2          name = nametextField.text!         print("Name: \(vc3.Username)") ... } } VC2: class PhoneNumberVC: UIViewController, UITextFieldDelegate, RegisterNumberProtocol {     var phoneNumber: String?     let vc3 = VerifyPhoneNumberVC() override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .black         vc3.phoneDelegate = self ... } func push() {         phoneNumber = phoneNumberTextField.text!         print("Number: \(phoneNumber)") ... } } V3: class VerifyPhoneNumberVC: UIViewController { var nameDelegate: RegisterNameProtocol?     var phoneDelegate: RegisterNumberProtocol?     var UserphoneNumber = ""     var Username = "" override func viewDidLoad() {         super.viewDidLoad()         view.backgroundColor = .white         UserphoneNumber = (phoneDelegate?.phoneNumber) ?? ""         Username = (nameDelegate?.name) ?? ""         print("Number: \(UserphoneNumber), Name: \(Username)") } I think that's all:)
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
Of course, I thought it would be unnecessary, here I the code:  @objc func goNext() {          name = nametextField.text!         print("Name: \(name)")                  if nametextField.text?.isEmpty == false {             let nextVC = PhoneNumberVC()             nextVC.modalPresentationStyle = .fullScreen             present(nextVC, animated: true, completion: nil)         } else {             print("No valid name")         }     }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Push data to other VC with protocol, error: force unwrapped a nil value
Well that's all I have, what more do you need to see? I already tried... phoneNumber = (phoneDelegate?.phoneNumber) ?? "" That doesn't work because it always takes the alternative data. I also do not use segues because I don't use storyboards. The first view presents the second View and the second presents the third view.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UICollectionView Layout Error: nil layout parameter
Well @Claude31 and to all the others, thank you for your effort and help, I'm going to delete the Code and try it new in a different way because there is definitely something really weird. I deactivated the whole CollectionView Code and it even showed me exactly the same error....
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UICollectionView Layout Error: nil layout parameter
@Claude31 Exception NSException * "UICollectionView must be initialized with a non-nil layout parameter" 0x0000000282926a90 Is this what you need?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UICollectionView Layout Error: nil layout parameter
@OOPer The collectionView is placed in a tableView Cell, that's the reason why the code will lack if you run it as normal CollectionView
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UICollectionView Layout Error: nil layout parameter
@robnotyou I did that because the collectionView is in a tableView Cell, so I don't use the typical view.Anchor phrases...
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UICollectionView Layout Error: nil layout parameter
@Claude31 Well, the error appears in the App Delegate Yes I settled the frame but it also not worked :(
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21