When I run app in iPad in release mode app crashes on launch Only in Xcode 15
it works fine in older Xcodes (14,13 etc)
dyld[36278]: Symbol not found: _$s10Foundation13__DataStorageC12replaceBytes2in4with6lengthySnySiG_SVSgSitF
Referenced from: <DC51D787-077E-3775-80C8-609FB1460F73> /private/var/containers/Bundle/Application/1A433D08-5BBA-4CEA-A8B1-78ED0777FB2C/MYAPP.app/MyAPP
Expected in: <57FF5555-479E-3634-931A-26D334C85350> /System/Library/Frameworks/Foundation.framework/Foundation
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
extension UIView {
func takeSnapshot(rect : CGRect? = CGRect.zero) -> UIImage? {
let renderer = UIGraphicsImageRenderer(size: frame.size)
var image = renderer.image { _ in drawHierarchy(in: bounds, afterScreenUpdates: true) }
if let imageRect = rect, imageRect != CGRect.zero {
let screenshotFrame = CGRect(x: imageRect.origin.x * UIScreen.main.scale, y: imageRect.origin.y * UIScreen.main.scale, width: imageRect.size.width * UIScreen.main.scale, height: imageRect.size.height * UIScreen.main.scale)
let imageRef = image.cgImage!.cropping(to: screenshotFrame)
image = UIImage.init(cgImage: imageRef!, scale: image.scale, orientation: image.imageOrientation)
}
UIGraphicsEndImageContext()
return image
}
}
which was working fine until I updated to macOS 14.4.1 from 14.2.1 and to Xcode 15.3 from 15.0.
issue
From my Mac Catalyst app, if I try to take screenshot of imageView, the screenshot is brighter.
If I try this method it seems working:
func takeSnapshotWithoutScale() -> UIImage? {
UIGraphicsBeginImageContextWithOptions(self.frame.size, false, 0)
if let currentContext = UIGraphicsGetCurrentContext() {
self.layer.render(in: currentContext)
}
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}