Post

Replies

Boosts

Views

Activity

Reply to Need Help Transfer Data From Button
To be sure to understand where you stand now, could you repost the most recent code: IBAction prepare for segue Another option is to get the name directly in the IBAction: @IBAction func CamButtonA(_ sender: UIButton) { // Find the cell which contains this button var superview = sender.superview while let view = superview, !(view is UITableViewCell) { superview = view.superview } guard let cell = superview as? FavCell else { return } selectedNameInCell = cell.name.text performSegue(withIdentifier: "hs", sender: nil) }
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Incorrect height of iPad floating keyboard
That seems to be an old issue with keyboard size. I filed a bug, in 2018 (radar ID 38117524 - FB5721145) for keyboard size issues. Here's an abstract: Value for keyboard height returned by note.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue is erroneous after turning iPad from Portrait to Landscape This is for a numeric keypad on iPad (numbers at top, special characters below, help line at the top). This occurs both on device and in Xcode simulator Steps to Reproduce: On iPad, select numeric keypad (numbers at top, special characters below, help line at the top), for a textField In keyboardWillShow, get the keyboard size, and ask for printing it : @objc func keyboardWillShow(_ note : Notification) -> Void { if let keyboardSize = (note.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue { print("keyboardSize", keyboardSize) Start in landscape, click on field to show keyboard, then turn portrait then return landscape, the keyboard staying displayed on screen. Expected Results: Height should be 398 when returning to landscape Actual Results: Height is 142 after returning to landscape. keyboardSize (0.0, 768.0, 1024.0, 398.0) // Landscape, seems correct keyboardSize (0.0, 1024.0, 768.0, 313.0) // Portrait, effectively smaller in height keyboardSize (0.0, 768.0, 1024.0, 142.0) // Return to landscape: height is now clearly wrong keyboardSize (0.0, 626.0, 1024.0, 142.0) // Note: keyboardWillShow is called a second time and removes 142.0 from origin.y. Version/Build: IOS 11.2.5 (15D100) Xcode Version 9.2 beta (9C34b) OSX Version 10.13.3 (17D102)
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’21
Reply to How to compare dates from two view controllers (Core Data and Swift)?
it doesn't work That tells nothing, please explain what you get (or don't get) and what you expected. Are model.dateSaved and dateFromFirstViewboth Date ? If so, are the dates exactly the same ? You should add some print to log: if model.dateSaved == dateFromFirstView { print("Dates are the same") cell.textLabel!.text = model.event } else { print(model.dateSaved, "is not the same as", dateFromFirstView) } And tell what you get.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21