Post

Replies

Boosts

Views

Activity

Reply to Adding Main Menu
Your xib is secondMenu.xiband you call SecondaryMenu Bundle.main.loadNibNamed("SecondaryMenu", owner: self, topLevelObjects: nil)Cannot work.If you keep the same xib name, change to Bundle.main.loadNibNamed("SecondMenu", owner: self, topLevelObjects: nil) // That's it
Nov ’19
Reply to About Safari Technology Preview
I may have found some pattern for the problem.If I try to access an URL which:- requires authentication to access server- is accessed through dynamic DNS (no-ip)then it does not load and blocks any further download.Until I restart STP.But if I call an URL on the same LAN (direct IP adress + port) which requires the same authentication, it works.However, this URL with dynamic DNS does work on the same Mac from Safari and from another Mac with STP release 90.So looks like there is an issue to get the DNS answer from dynamic DNS ?!Could there be any related setting in Safari Techno Preview dealing with DNS ?If I get answer from support, I'll report it.Bug report reference : FB7463041EDITEDFurther test points to a Dyn DNS issue.I called the website using the resolved dynamic address. It works.Tried again with the dyn dns address (no-ip): blocks this load and blocks STP until I relaunch.However, tested on Safari with dynamic dns and with resolved address, both work.I close the thread, waiting for bug report feedback.
Nov ’19
Reply to Why does Progress.fractionCompleted exceed 1.0?
Effectively, reading more carefully the log, we see it never goes over 1 execpt last line:Parent: 0x0 (portion: 0) / Fraction completed: 1.2795 / Completed: 6 of 6Which is curious, as all children have completed apparently.In addition, it seems that figures are those of individual child or parent, but all below 1.0.fractionCompleted jumps all over the place, e.g. from 0.5 to 1.4 to 0.7 to 2.8)In which others cases have you seen it exceed 1 ?It turns out that my code sample produces the correct output when running on iOS 11 or iOS 12. It seems that starting with iOS 13 fractionCompleted gets corrupted.You should file a bug report. And ask for doc clarification as well.Thanks to report FB number.
Nov ’19
Reply to CollectionView layout gets mad after scrolling
Please show the code of all the collection view delegate functions.Hard to say without.However, have a look herehttps://stackoverflow.com/questions/32082726/the-behavior-of-the-uicollectionviewflowlayout-is-not-defined-because-the-celland try overriding theshouldInvalidateLayoutForBoundsChange function to return trueTry also adding:flowLayout.estimatedItemSize = CGSize(width: 1, height: 1)
Nov ’19
Reply to Apple developer account terminated after 8 years
It is easy to understand your frustation, but sure it has nothing to do with your country origin.You said:This app has been rejected some times and in each rejection, they ask me different thingsHas it been rejected several times or just 2 ?That should have alerted you to provide very detailed and transparent explanation. Problem is that after several rejections, if the reviewer estimates that you are not really ready to comply, they may end closing the account.Did you develop with an app generator ? May read this:https://forums.developer.apple.com/thread/112285You have 2 weeks to appeal. Try and maybe propose to remove completely this specific app ?
Nov ’19
Reply to How to always position button 2/3 way down the screen
Yes, do it programmatically.Create a constraint relative to top of safe area.Create an IBOutlet for the constraint (control-drag from constraint to ViewController) : topConstraintIn viewWillLayoutSubviews, compute the correct value and set it:// To get screensize: func getScreenSize() -> (height: CGFloat, width: CGFloat, topPadding: CGFloat, bottomPadding: CGFloat) { // Get the screen width and height. let screenWidth = UIScreen.main.bounds.size.width var screenHeight = UIScreen.main.bounds.size.height var topPadding = CGFloat(0) var bottomPadding = CGFloat(0) if #available(iOS 11.0, *) { if let window = UIApplication.shared.keyWindow { topPadding = window.safeAreaInsets.top bottomPadding = window.safeAreaInsets.bottom if (topPadding > 0 && bottomPadding > 0) { screenHeight -= topPadding } } } return (screenHeight, screenWidth, topPadding, bottomPadding) } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() let screenHeight = getScreenSize().height topConstraint.constant = 2 * screenHeight / 3 // 2/3 from top ; for 1/3 from top topConstraint.constant = screenHeight / 3 }
Nov ’19
Reply to How to handle Date in TextField?
I tested this code and have somme comments:func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { if textField.text?.count == 1 { textField.placeholder = "DD/MM/YYYY HH:mm" } if (textField.text?.count == 2) || (textField.text?.count == 5) { //Handle backspace being pressed if !(string == "") { txtValue.text = textField.text! + "/" } } else if (textField.text?.count == 10) { if !(string == "") { txtValue.text = textField.text! + " " } } else if (textField.text?.count == 13) { if !(string == "") { txtValue.text = textField.text! + ":" } } return !(textField.text!.count > 15 && (string.count) > range.length) }Line 3: why 1 and not 0 length ?It is surpriing for user to get the slash added after typing 3rd char.Here is what I modified : when typing backspace, removes the '/' and the previous char.You should also always check that date and time are valid (I did it for DD and MM and added a beep if input is not a valid DD)Need to add some test (30/02 is not valid for instance)That could be done once the whole date has been entered, by alerting user.import AVFoundation func playInputClick() { AudioServicesPlayAlertSound(SystemSoundID(1322)) } func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { if textField.text?.count == 0 { textField.placeholder = "DD/MM/YYYY HH:mm" } // Test if valid data var isValid = true // Is DD valid ? if textField.text!.count <= 1 { let newString = txtValue.text! + string if let newValue = Int(newString) { isValid = ((textField.text!.count <= 1 && newValue >= 1) || (textField.text!.count == 0 && newValue <= 3)) && newValue <= 31 } else { isValid = false // Not a number } if !isValid { playInputClick() return false } } else if textField.text!.count >= 3 && textField.text!.count <= 5 { // Is MM Valid ? let newString = (txtValue.text! + string).dropFirst(3) // removes 'DD/' if let newValue = Int(newString) { isValid = newValue >= 0 && newValue <= 12 } else { isValid = false // Not a number } if !isValid { playInputClick() return false } } //Handle backspace being pressed if string.count == 0 && (textField.text?.last == "/" || textField.text?.last == " " || textField.text?.last == ":") { txtValue.text = String((txtValue.text?.dropLast(2)) ?? "") return false } if (textField.text?.count == 1) || (textField.text?.count == 4) { if string != "" { txtValue.text = textField.text! + string + "/" return false } } else if (textField.text?.count == 9) { if string != "" { txtValue.text = textField.text! + string + " " return false } } else if (textField.text?.count == 12) { if string != "" { txtValue.text = textField.text! + string + ":" return false } } return !(textField.text!.count > 15 && (string.count) > range.length) }
Nov ’19