-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathViewController.swift
More file actions
40 lines (30 loc) · 1.01 KB
/
Copy pathViewController.swift
File metadata and controls
40 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// ViewController.swift
// WebPKitExample-tvOS
//
// Created by Tim Oliver on 15/10/20.
//
import UIKit
import WebPKit
class ViewController: UIViewController {
@IBOutlet weak var backgroundView: UIView!
@IBOutlet weak var imageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
// Decode and set a WebP image to
// the image view in this view controller
imageView.image = UIImage.webpNamed("WebPKitLogo")
// As this is a large image, enable trilinear filtering
// to allow better re-sampling at smaller screen sizes
imageView.layer.minificationFilter = .trilinear
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
// Set the rounding of the background view to
backgroundView.layer.cornerRadius = view.bounds.height * 0.2
// Set the rounding to be squircular
if #available(tvOS 13.0, *) {
backgroundView.layer.cornerCurve = .continuous
}
}
}