Sorry, but I don't understand this unless you are talking about selecting multiple images from the album, in which case, you could loop through them and save, but I am not sure how this applies to this example.
How would I do this with emails? Transformable conforming to string with dots, string with `@` and dots. For the entity of User, with attribute email of type transformable.
@@StewartLynch It happens in my simulator, when I bring up the keyboard the whole form including image shrinks so it fits completely on the screen above the keyboard! Very nice!
I just have the Image as Binary Data and save it like that to Core Data (game.iconImage = selectedImage.jpegData(compressionQuality: 1.0)). CD will also store large images to local storage and small ones in its entirety to CD. Retrieving the image using a helper computed property: /// Returns an UIImage for the Game from Core Data (binary data) or the default Image var CoreDataImage: UIImage { if let imageData = self.iconImage { return UIImage(data: imageData) ?? AppImages.gameDefaultImage } else { return AppImages.gameDefaultImage } } I'm not sure what the benefits are of your approach, or the downfalls of mine ?
One of the main objectives of the video was to show how to use transformable as it has many other applications. If your way is working for you, then that is great.
He is storing as binary data instead of a transformable UIImage. You can choose to do that, but learning how to create transformable objects can help in other implementations as well.
@@StewartLynch Such as email with validation in place of UIImage? Also I'm sure Transformable is searchable in which may be useful for certain datatypes; not sure about searching in UIImage, perhaps with NSPredicate and CoreML?
That’s amazing lessons… thank you so much Stewart. Best transformable lesson
Glad you think so!
Would be great to eventually see how this is done using SwiftData rather than Core Data.
I will be doing something similar with SwiftData in November
@@StewartLynch thanks Stewart. Very much looking forward to it.
How do you save multiple images at one time.
Sorry, but I don't understand this unless you are talking about selecting multiple images from the album, in which case, you could loop through them and save, but I am not sure how this applies to this example.
nice
Thanks
How would I do this with emails? Transformable conforming to string with dots, string with `@` and dots. For the entity of User, with attribute email of type transformable.
I would store emails as strings.
How do you achieve that the UI scales (smaller) when the keyboard appears?
I don’t do anything special. It must be handled by the framework. Can you give me a time stamp in the video where you see this happening?
@@StewartLynch It happens in my simulator, when I bring up the keyboard the whole form including image shrinks so it fits completely on the screen above the keyboard! Very nice!
This is the power of the SwiftUI Layout system and not using fixed sizes.
@@StewartLynch I’m not seeing this behaviour in my app, but i don’t use a form, so that might be it. I never use fixed sizes…
I just have the Image as Binary Data and save it like that to Core Data (game.iconImage = selectedImage.jpegData(compressionQuality: 1.0)). CD will also store large images to local storage and small ones in its entirety to CD. Retrieving the image using a helper computed property:
/// Returns an UIImage for the Game from Core Data (binary data) or the default Image
var CoreDataImage: UIImage {
if let imageData = self.iconImage {
return UIImage(data: imageData) ?? AppImages.gameDefaultImage
} else {
return AppImages.gameDefaultImage
}
}
I'm not sure what the benefits are of your approach, or the downfalls of mine ?
One of the main objectives of the video was to show how to use transformable as it has many other applications. If your way is working for you, then that is great.
Found this ? ua-cam.com/video/rEec1FOjeC8/v-deo.html
He is storing as binary data instead of a transformable UIImage. You can choose to do that, but learning how to create transformable objects can help in other implementations as well.
@@StewartLynch Such as email with validation in place of UIImage? Also I'm sure Transformable is searchable in which may be useful for certain datatypes; not sure about searching in UIImage, perhaps with NSPredicate and CoreML?