Post

Replies

Boosts

Views

Activity

Reply to Video Player: Error if video could not load?
Thanks for the helpful answer! Code was this: func getVideoPlayerOnline(url: String) -> AVPlayer? {     guard let url = URL(string: url) else {         print("url not found")             return nil         }     //test if video is playable     if AVAsset(url: url).isPlayable {         let player = AVPlayer(url: url)         return player     } else {         return nil     } } Now if I insert .isPlayable it works! By the way, dear Claude: Do you know how to enable email notifications in this forum? Cause I didn't get them on this and on other threats.
Jan ’21
Reply to Simulator background color changed?
Thanks for your reply! Yes it occur in all projects. All storyboard background colors are yellow! Every time if I add a view controller the colors are back. Clear build folder does not help unfortunately. Hope Apple can deal with my bug report. Because I dunno when this issue appears once and it is not reproducible with my testings...
Jan ’21
Reply to Change value of array in for-loop
Hm, now I have a further question: See this example: struct testClass {     var One = ["test": "zzz", "test2": false] as [String : Any]     var Two = ["test": "***", "test2": true] as [String : Any]          var allOfThem: [[String:Any]]          init() {         allOfThem = [One, Two]     } } var theTest = testClass() for i in theTest.allOfThem.indices {     print(theTest.allOfThem[i])     if theTest.allOfThem[i]["test"] as? String == "zzz" {         print("Test found")         theTest.allOfThem[i]["test2"] = true         print("Test data: \(theTest.allOfThem[i])")     } } print("Test finally: \(theTest.One)") Console's output is: ["test2": false, "test": "zzz"] Test found Test data: ["test2": true, "test": "zzz" ["test2": true, "test": "***"] Test finally: ["test2": false, "test": "zzz"] As you can see, if I set up true in the array it is false at the end. If there are just one or two dictionaries in class this is not a huge problem. But if there are 10 it is nasty to use a switch statement to detect all of them. So I want to save the true in the var One also if I'm running trough the array. Any way to do this?
Jul ’20
Reply to Local video won't play
Thanks for the answers! It was just not possible to drag the video file in the bundle... so I placed it in the Asset Catalog. What exactly do you mean with "bundle"? Is it the first level of my file "ProjectName" where are files such "ProjectName.xcodeproj" or the second level "/ProjectName/ProjectName" where are my Swift files? Or something completely different?
Jun ’20
Reply to Verschwundener Button in Xcode
Also du brauchst dafür den Assistant Editor.Um das irgendwie sinnvoll zu gestalten solltest du erstmal dem entsprechenden Storyboard die Klasse zuweisen, die du dafür benutzt.Dafür wählst du das Storyboard aus und blendest den Identity Inspector ein (diese Registerkarte oben rechts) und wählst bei "Class" die Swift Datei aus, in der du den Code schreiben willst. Die sollte vom gleichen Typ sein wie das Storyboard (Also normalerweise "ViewController"). Beachte, dass dies nicht bei dem Launch Screen funktionieren wird.Anschließend blendest du den Assistant Editor ein (control + option + command + enter), klickst auf den Button und ziehst dann mit gedrücker control-Taste eine Verbindung von dem Button in die Datei. In erscheinenden Fenster kannst du dann als Art "Action" auswählen. Damit bekommst du eine Aktion die ausgeführt wird, sobald du den Button drückst.Ich hoffe, das hilft dir so weiter!
Jun ’20
Reply to Shortcut iPad for a button?
Thanks, but how do I use it?if I use:self.textFieldShouldReturn(self.Input)in a timer it always "jumps accross" the return key. So without that I tapped on "return". It is executed as soon as I call it.But if I call it I don't want to execute it - I want it to check if the user is tapping on "return".Or do I must use it otherwise?
Jun ’20