2019-05-09 15:29:54 -07:00
|
|
|
//
|
|
|
|
|
// AppIconImageView.swift
|
|
|
|
|
// AltStore
|
|
|
|
|
//
|
|
|
|
|
// Created by Riley Testut on 5/9/19.
|
|
|
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
2023-01-04 09:52:12 -05:00
|
|
|
final class AppIconImageView: UIImageView
|
2019-05-09 15:29:54 -07:00
|
|
|
{
|
|
|
|
|
override func awakeFromNib()
|
|
|
|
|
{
|
|
|
|
|
super.awakeFromNib()
|
|
|
|
|
|
|
|
|
|
self.contentMode = .scaleAspectFill
|
|
|
|
|
self.clipsToBounds = true
|
|
|
|
|
|
2019-07-19 16:42:40 -07:00
|
|
|
self.backgroundColor = .white
|
|
|
|
|
|
2019-10-23 13:32:17 -07:00
|
|
|
if #available(iOS 13, *)
|
|
|
|
|
{
|
|
|
|
|
self.layer.cornerCurve = .continuous
|
|
|
|
|
}
|
|
|
|
|
else
|
2019-05-09 15:29:54 -07:00
|
|
|
{
|
2019-10-23 13:32:17 -07:00
|
|
|
if self.layer.responds(to: Selector(("continuousCorners")))
|
|
|
|
|
{
|
|
|
|
|
self.layer.setValue(true, forKey: "continuousCorners")
|
|
|
|
|
}
|
2019-05-09 15:29:54 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func layoutSubviews()
|
|
|
|
|
{
|
|
|
|
|
super.layoutSubviews()
|
|
|
|
|
|
|
|
|
|
// Based off of 60pt icon having 12pt radius.
|
|
|
|
|
let radius = self.bounds.height / 5
|
|
|
|
|
self.layer.cornerRadius = radius
|
|
|
|
|
}
|
|
|
|
|
}
|