0
0
iOS Swiftmobile~5 mins

Image view (system and asset) in iOS Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a UIImageView used for in iOS development?
UIImageView is a view that displays an image in your app's user interface. It can show images from your app assets or system symbols.
Click to reveal answer
beginner
How do you load an image from your app's asset catalog into a UIImageView?
Use UIImage(named: "imageName") to create an image from your assets, then assign it to the UIImageView's image property.
Click to reveal answer
beginner
What is a system image in iOS and how do you use it?
System images are icons provided by Apple through SF Symbols. Use UIImage(systemName: "symbolName") to load them into UIImageView.
Click to reveal answer
intermediate
Why should you use system images (SF Symbols) instead of custom icons when possible?
System images are optimized for different sizes and weights, support dark mode automatically, and keep your app consistent with iOS design.
Click to reveal answer
intermediate
How can you make sure your UIImageView adapts well to different screen sizes?
Use Auto Layout constraints to position and size UIImageView. Also, set contentMode (like .scaleAspectFit) to keep image proportions.
Click to reveal answer
Which initializer loads an image from your app's asset catalog?
AUIImage(named: "imageName")
BUIImage(systemName: "imageName")
CUIImage(contentsOfFile: "imageName")
DUIImage(assetName: "imageName")
How do you load a system symbol image into a UIImageView?
AUIImage(named: "symbolName")
BUIImage(assetName: "symbolName")
CUIImage(systemSymbol: "symbolName")
DUIImage(systemName: "symbolName")
What contentMode should you use to keep the image's aspect ratio inside UIImageView?
A.scaleAspectFill
B.scaleAspectFit
C.scaleToFill
D.redraw
Why are SF Symbols recommended for icons in iOS apps?
AThey are only available on iOS 12 and earlier
BThey are free to customize with any color
CThey automatically adapt to different sizes and dark mode
DThey require no code to use
Which property of UIImageView controls how the image fits inside the view?
AcontentMode
BclipsToBounds
Cimage
DtintColor
Explain how to display both a system image and an asset image in UIImageView.
Think about the two different UIImage initializers.
You got /3 concepts.
    Describe why using Auto Layout and contentMode is important for UIImageView in different screen sizes.
    Consider how images look on small and large devices.
    You got /3 concepts.