Post

Replies

Boosts

Views

Activity

CoreML model for news scoring
Is it possible to train a model using CreateML to infer a relevance numeric score of a news article based on similar trained data, something like a sentiment score ? I created a Text Classifier that assigns a category label which works perfect but I would like a solution that calculates a numeric value, not a label.
2
0
733
Mar ’25
UIGraphicsImageRenderer memory leak on iOS 18.0
Good morning, when using the following extension I'm getting a memory leak when using Instruments, I've tried capturing self with a weak reference but I still get the leak. public extension UIImage { func resize(_ targetSize: CGSize) -> UIImage { let size = self.size // Calculate the scaling ratios let widthRatio = targetSize.width / size.width let heightRatio = targetSize.height / size.height // Determine the scale factor and size to fill the target size let scaleFactor = max(widthRatio, heightRatio) let scaledImageSize = CGSize( width: size.width * scaleFactor, height: size.height * scaleFactor ) // Calculate the clipping rect let clippingRect = CGRect( x: (scaledImageSize.width - targetSize.width) / 2.0, y: (scaledImageSize.height - targetSize.height) / 2.0, width: targetSize.width, height: targetSize.height ) let format = UIGraphicsImageRendererFormat() format.scale = 1 // Render the clipped image let renderer = UIGraphicsImageRenderer(size: targetSize, format: format) return autoreleasepool { return renderer.image { _ in self.draw(in: CGRect( x: -clippingRect.origin.x, y: -clippingRect.origin.y, width: scaledImageSize.width, height: scaledImageSize.height )) } } } }
Topic: UI Frameworks SubTopic: UIKit
2
0
564
Oct ’24
reloadInputViews doesn't change from numbers to text
When using reloadInputViews() on a UITextView, if the keyboard is showing emojis it successfully resets to the default text view, but when the keyboard is showing numbers of special characters, it doesn't do anything. Do I have to implement a custom input view in order to achieve this ? I don't want it to resign and become first responder to make it work.
1
0
619
Nov ’23
CoreML model for news scoring
Is it possible to train a model using CreateML to infer a relevance numeric score of a news article based on similar trained data, something like a sentiment score ? I created a Text Classifier that assigns a category label which works perfect but I would like a solution that calculates a numeric value, not a label.
Replies
2
Boosts
0
Views
733
Activity
Mar ’25
UIGraphicsImageRenderer memory leak on iOS 18.0
Good morning, when using the following extension I'm getting a memory leak when using Instruments, I've tried capturing self with a weak reference but I still get the leak. public extension UIImage { func resize(_ targetSize: CGSize) -> UIImage { let size = self.size // Calculate the scaling ratios let widthRatio = targetSize.width / size.width let heightRatio = targetSize.height / size.height // Determine the scale factor and size to fill the target size let scaleFactor = max(widthRatio, heightRatio) let scaledImageSize = CGSize( width: size.width * scaleFactor, height: size.height * scaleFactor ) // Calculate the clipping rect let clippingRect = CGRect( x: (scaledImageSize.width - targetSize.width) / 2.0, y: (scaledImageSize.height - targetSize.height) / 2.0, width: targetSize.width, height: targetSize.height ) let format = UIGraphicsImageRendererFormat() format.scale = 1 // Render the clipped image let renderer = UIGraphicsImageRenderer(size: targetSize, format: format) return autoreleasepool { return renderer.image { _ in self.draw(in: CGRect( x: -clippingRect.origin.x, y: -clippingRect.origin.y, width: scaledImageSize.width, height: scaledImageSize.height )) } } } }
Topic: UI Frameworks SubTopic: UIKit
Replies
2
Boosts
0
Views
564
Activity
Oct ’24
reloadInputViews doesn't change from numbers to text
When using reloadInputViews() on a UITextView, if the keyboard is showing emojis it successfully resets to the default text view, but when the keyboard is showing numbers of special characters, it doesn't do anything. Do I have to implement a custom input view in order to achieve this ? I don't want it to resign and become first responder to make it work.
Replies
1
Boosts
0
Views
619
Activity
Nov ’23