When 3D Touch Peek is invoked, the background blur that happens, I notice it varies.
For example, it's a LIGHT blur in iMessage, but DARK blur in FaceTime App.
(Although below image might not be the best example to show the contrast, you can notice it better through out iOS 10)
Is this done automatically from the context brightness? Background View brightness? Peek context brightness? Or do we have any control over this?
extension ChatTableViewController: UIViewControllerPreviewingDelegate {
func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
guard let indexPath = tableView.indexPathForRow(at: location) else { return nil }
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier: ChatDetailViewController.identifier)
guard let chatDetailViewController = viewController as? ChatDetailViewController else { return nil }
chatDetailViewController.chatItem = chatItem(at: indexPath)
let cellRect = tableView.rectForRow(at: indexPath)
previewingContext.sourceRect = previewingContext.sourceView.convert(cellRect, from: tableView)
chatDetailViewController.isReplyButtonHidden = true
return chatDetailViewController
}
func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) {
if let chatDetailViewController = viewControllerToCommit as? ChatDetailViewController {
chatDetailViewController.isReplyButtonHidden = false
}
show(viewControllerToCommit, sender: self)
}
}