CNUpSlideViewRemindView.swift 1.46 KB
//
//  CNUpSlideViewRemindView.swift
//  metaCode
//
//  Created by daojian on 2023/5/31.
//

import Foundation

/// 上拉显示提醒View
class CNUpSlideViewRemindView:UIView{
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func initUI(){

        let W = UIScreen.main.bounds.width - 100
        let bottomCircle = UIBezierPath.init(arcCenter: CGPoint(x: W/2, y: W/2), radius: W/2, startAngle: 0, endAngle: .pi, clockwise: false)
        
        let bottomShapeLayer = CAShapeLayer()
        bottomShapeLayer.path = bottomCircle.cgPath
        bottomShapeLayer.fillColor = UIColor("#F0F5FD")?.cgColor
        self.layer.addSublayer(bottomShapeLayer)
        
        let imageView:UIImageView = UIImageView.init(image: UIImage(named: "homePage_up_icon"))
        imageView.frame = CGRect(x: (self.width - 15)/2, y: 19, width: 15, height: 15)
        self.addSubview(imageView)
        
        let btn = UIButton(type: .custom)
        btn.frame = CGRect(x: (self.width - 50)/2, y: imageView.bottom, width: 50, height: 25)
        btn.setTitle("上滑", for: .normal)
        btn.setTitleColor(UIColor("#004FE0"), for: .normal)
        btn.titleLabel?.font = UIFont(name: "KohinoorTelugu-Regular", size: 17)
        btn.isUserInteractionEnabled = false
        
        self.addSubview(btn)
        
    }
    
    
}