C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Note: For simple requirements we can just use images added directly in Xcode with the Assets.xcassets file.
Example ViewController, UIImageView: Swift
//
// ViewController.swift
// ExampleTime8
//
// ...
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBOutlet weak var simpleImageView: UIImageView!
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
Next: Create a new Image asset. Then drag an image from the Finder to a square in the assets.
Image: You can provide a custom name for the image. I named the image I chose "Pastels" this is the key we access it from later.
Pastels: You will want to link the image to the name you chose in the Assets.xcassets file (in my example I used "Pastels").