Retrieve information in Notice ‘batteryStatus’

Guys, Looking for some API to retrieve information of batt. But I have the condition to work under iOS 10. So, I found something very interesting! Looking the console of device, I found this: Jun 20 11:01:50 Billys-iPhone locationd[57] : {“msg”:”battery capacity info”, “batteryStatus”:”{“level”:98.000000, “charged”:false,…

‘…’ as a unary operator

I’m new to Swift. I’m doing some exercises based off of begginer lessons on the Apple Dev website. One lesson gives the following as an example of how to use ‘…’ to create an open-ended range.   for name in names[2…] {     print(name) }…

Stuck on CGDataProviderCreateWithData

What I’d like to do is provide a CVPixelBuffer as the dataInfo argument to CGDataProviderCreateWithData that has an initializer: init?(dataInfo info: UnsafeMutableRawPointer?, data: UnsafeRawPointer, size: Int, releaseData: @escaping CGDataProviderReleaseDataCallback)   My best (and probably wrong) approach to convert to a UnsafeRawPointer is: let pixelBuffer: CVPixelBuffer…

unwind segue goes too far

I have a root View controller that present a second view controller modally. And then the second view controller will present a view controller with searchBarvia show segue.   If user type something in the searchBar a table view(which has no segue relationshop with the…

What is wrong with my code?

i am trying to make a chat app but my code is not working someon please help, the build fails every time here is my code:       import UIKit import ImageIO   extension UIImage {       public class func gifWithData(_ data: Data)…