24.05.29 Today I Learned
//
// ViewController.swift
// teamProjectready
//
// Created by t2023-m0112 on 5/28/24.
//
import UIKit
class ViewController: UIViewController {
let info = Information()
@IBOutlet weak var parkprofile: UIButton!
// 박승환 프로필
@IBOutlet weak var parkbackground: UIView!
// 박승환 배경
@IBOutlet weak var kimprofile: UIButton!
// 김광현 프로필
@IBOutlet weak var kimbackground: UIView!
// 김광현 배경
@IBOutlet weak var kimdhprofile: UIButton!
// 김동현 프로필
@IBOutlet weak var kimdhbackground: UIView!
// 김동현 배경
@IBOutlet weak var leejhprofile: UIButton!
// 이주희 프로필
@IBOutlet weak var leejhbackground: UIView!
// 이주희 배경
@IBOutlet weak var geonprofile: UIButton!
// 최건 프로필
@IBOutlet weak var geonbackground: UIView!
// 최건 배경
@IBOutlet weak var minprofile: UIButton!
// 유민우 프로필
@IBOutlet weak var minbackground: UIView!
// 유민우 배경
func setUP(_ imageView: UIButton, _ view:UIView) {
imageView.clipsToBounds = true
imageView.layer.cornerRadius = 10
imageView.layer.maskedCorners = CACornerMask(arrayLiteral: .layerMinXMinYCorner, .layerMaxXMinYCorner)
view.layer.cornerRadius = 10
view.layer.shadowColor = UIColor.black.cgColor
view.layer.masksToBounds = false
view.layer.shadowOffset = CGSize(width: 3, height: 3)
view.layer.shadowRadius = 3
view.layer.shadowOpacity = 0.5
}
override func viewDidLoad() {
super.viewDidLoad()
info.setting()
setUP(parkprofile, parkbackground)
setUP(kimprofile, kimbackground)
setUP(kimdhprofile, kimdhbackground)
setUP(leejhprofile, leejhbackground)
setUP(geonprofile, geonbackground)
setUP(minprofile, minbackground)
minprofile.setTitle("유민우", for:.normal)
minprofile.addTarget(self, action: #selector(trigger(sender:)), for: .touchUpInside)
// Do any additional setup after loading the view.
// parkprofile.clipsToBounds = true
// parkprofile.layer.cornerRadius = 10
// parkprofile.layer.maskedCorners = CACornerMask(arrayLiteral: .layerMinXMinYCorner, .layerMaxXMinYCorner)
// //박승환 프로필 테두리 깎기
//
// parkbackground.layer.cornerRadius = 10
// //박승환 배경테두리 깎기
// parkbackground.layer.shadowColor = UIColor.black.cgColor // 그림자 색
// parkbackground.layer.masksToBounds = false // 내부의 속한 요소들이 UIView 밖을 벗어날 때, 잘라낼 것인지 true면 잘라낸다 false면 보여준다 (그림자는 UI밖이므로 false)
// parkbackground.layer.shadowOffset = CGSize(width: 3, height: 3) //그림자 위치 조정
// parkbackground.layer.shadowRadius = 3 // 그림자 반경
// parkbackground.layer.shadowOpacity = 0.5 //그림자 투명도 값
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let button = sender as? UIButton, let title = button.titleLabel?.text {
if let data = segue.destination as? DetailViewcontroller {
let info = info.findUser(title)
data.info = info
}
}
}
@objc func trigger(sender:UIButton) {
performSegue(withIdentifier: "showDetail", sender: sender)
}
}
'Today I Learned > 2024' 카테고리의 다른 글
24.05.31 Today I Learned (0) | 2024.05.31 |
---|---|
24.05.30 Today I Learned (0) | 2024.05.30 |
24.05.28 Today I Learned (0) | 2024.05.28 |
24. 05. 27 Today I Learned (0) | 2024.05.27 |
24.05.22 Today I learned (0) | 2024.05.22 |