swift4.2

Using '!' here is deprecated and will be removed in a future release - swift 4.2

半世苍凉 提交于 2019-11-28 13:05:11
Compiler throwing following warning when setting image in a cell using SDWebimage in Swift 4.2. Swift Compiler warning : Using '!' here is deprecated and will be removed in a future release let url = NSURL(string: (str_url) as String) cell.img!.sd_setImage(with: url as URL!, completed: block_image) //--- WARNING ON THIS LINE AT URL! Any Suggestions ? Use this code : cell. img!.sd_setImage(with: url! as URL, completed: block_image) Suggestion: use URL instead of NSURL let url = URL(string: "" ) //use url String cell.img!.sd_setImage(with: url, completed: block_image) Try this: if let url = URL

Duet - Merge 2 Videos Side by Side

三世轮回 提交于 2019-11-28 11:49:25
NOTE:- Merge Videos Side By Side WITHOUT Losing Video Quality I think that is a Very Very Important Question, After a lot of searches & Googling, didn't find any helpful material related to this Question. I'm working on a Project where I need to MERGE Videos Side-By-Side in a single file. I had done Merged Videos using AVFoundation But the problem is FIRST Video is showing as an Overlay to a SECOND video(not Merging properly as same as SMULE App/Karaoke App or Tiktok App ). func mergeVideosFilesWithUrl(savedVideoUrl: URL, newVideoUrl: URL, audioUrl:URL) { let savePathUrl : NSURL = NSURL

Swift 4.2 imagePickerController issue

倖福魔咒の 提交于 2019-11-28 10:07:58
Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble. UIImagePickerControllerEditedImage // Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let pickedImage = info[UIImagePickerControllerEditedImage] as? UIImage { self.userProfileImage.contentMode = .scaleAspectFit self.userProfileImage.image = pickedImage } picker.dismiss(animated: true, completion: nil) } The method signature has changed

Error with notification names while converting code to Swift 4.2

最后都变了- 提交于 2019-11-28 07:54:53
问题 The code below was working fine before Swift 4.2: NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil) When I click the 'Fix' option, it becomes: NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange(notification:)), name: NSNotification.Name.UIResponder.keyboardWillShowNotification, object: nil) But it is still marked an error. Here is the explanation: Type

Type 'NSNotification.Name' has no member 'keyboardDidShowNotification'

耗尽温柔 提交于 2019-11-27 08:54:53
I'm getting this error with Swift 4.2 Type 'NSNotification.Name' has no member 'keyboardDidShowNotification' Here is my code: NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardDidShow(notification:)), name: NSNotification.Name.keyboardDidShowNotification, object: nil) Following one was working fine with Swift 4 but not with Swift 4.2 NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardDidShow(notification:)), name: NSNotification.Name.UIKeyboardDidShow, object: nil) Apple document Ref: NSNotification.Name.keyboardDidShowNotification I

Duet - Merge 2 Videos Side by Side

蓝咒 提交于 2019-11-27 06:30:32
问题 NOTE:- Merge Videos Side By Side WITHOUT Losing Video Quality I think that is a Very Very Important Question, After a lot of searches & Googling, didn't find any helpful material related to this Question. I'm working on a Project where I need to MERGE Videos Side-By-Side in a single file. I had done Merged Videos using AVFoundation But the problem is FIRST Video is showing as an Overlay to a SECOND video(not Merging properly as same as SMULE App/Karaoke App or Tiktok App ). func

Swift 4.2 imagePickerController issue

隐身守侯 提交于 2019-11-27 03:28:09
问题 Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble. UIImagePickerControllerEditedImage Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let pickedImage = info[UIImagePickerControllerEditedImage] as? UIImage { self.userProfileImage.contentMode = .scaleAspectFit self.userProfileImage

Xcode 10, LLDB: Couldn't IRGen expression

霸气de小男生 提交于 2019-11-27 03:22:21
问题 Using Xcode 10, when I stop my app using a breakpoint and try to print the content of an object in the Console, I obtain: "Couldn't IRGen expression, no additional error" However, I can see the value of the object in the Variables View panel. How can I make it evaluate my expression instead? 回答1: Thanks. I solved with rebuild carthage framework like imtx.me/archives/2719.html carthage update --platform iOS --no-use-binaries 回答2: In lldb as a workaround you can use: fr v productVersion fr v

Xcode 10 not being able to archive project

只谈情不闲聊 提交于 2019-11-26 17:02:29
问题 I'm trying to upload a new version of an app that is already in the AppStore. Previous version was uploaded using Xcode 9.4. But now Xcode 10 will be required in order to get approval. Sadly, Xcode is not being able to archive the project , so I'm getting stuck on the first step, not even being able to generate the binary for submission. There is no error: According to Xcode, our archiving process has more than 2000 tasks, and is just gets stuck in arbitrary task (always the same). Xcode does