Closure tuple does not support destructuring in Xcode 9 Swift 4

Let’s start with the definition of flatMap for a dictionary which is the following: func flatMap(_ transform: (Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] You see that the transform closure takes only one parameter of type Element where Element is just a typealias for a tuple: public typealias Element = (key: Key, value: Value) So … Read more

Failed to register for BoringSSL log debug updates

UPDATE There’s actually a very convenient way to silence certain logs for a specific simulator: xcrun simctl spawn booted log config –subsystem com.apple.network –category boringssl –mode level:off It is also recommended to silence other common non-important logs as well: xcrun simctl spawn booted log config –subsystem com.apple.CoreBluetooth –mode level:off xcrun simctl spawn booted log config … Read more

Barcode on swift 4

I figured it out but Apple didn’t make it so obvious. The callback function from the delegate AVCaptureMetadataOutputObjectsDelegate has been renamed and the parameter names are different! So, replace func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputMetadataObjects metadataObjects: [Any]!, from connection: AVCaptureConnection!) to func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) My view controller is now … Read more

Simultaneous accesses to 0x1c0a7f0f8, but modification requires exclusive access error on Xcode 9 beta 4

I think this ‘bug’ may be a Swift 4 “feature”, specifically something they call “Exclusive access to Memory”. Check out this WWDC video. Around the 50-minute mark, the long-haired speaker explains it. https://developer.apple.com/videos/play/wwdc2017/402/?time=233 You could try turning the thread sanitizer off in your scheme settings if you’re happy to ignore it. However, the debugger is … Read more

Use the increased navigation-bar title in iOS 11

The only change done to UINavigationBar API for iOS 11 is prefersLargeTitles. Documentation here: https://developer.apple.com/documentation/uikit/uinavigationbar/ You can do it to your own apps with one small change: check “Prefers Large Titles” for your navigation bar in IB, or if you prefer to do it in code using: navigationController?.navigationBar.prefersLargeTitles = true If you need to change … Read more

navigation bar rightbaritem image-button bug iOS 11

Reason The problem appears because from ios 11 UIBarButtonItem uses autolayout instead of dealing with frames. Solution You should add width constraint for this image-button if you use Xcode 9. button.widthAnchor.constraint(equalToConstant: 32.0).isActive = true button.heightAnchor.constraint(equalToConstant: 32.0).isActive = true PS button is not UIBarButtonItem, it is UIButton inside UIBarButtonItem. You should set constraint not for UIBarButtonItem, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)