-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// TabBarShadow.swift | ||
// Drink-EG | ||
// | ||
// Created by 이현주 on 9/29/24. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
extension CALayer { | ||
// Sketch 스타일의 그림자를 생성하는 유틸리티 함수 | ||
func applyShadow( | ||
color: UIColor = .black, | ||
alpha: Float = 0.5, | ||
x: CGFloat = 0, | ||
y: CGFloat = 2, | ||
blur: CGFloat = 4 | ||
) { | ||
shadowColor = color.cgColor | ||
shadowOpacity = alpha | ||
shadowOffset = CGSize(width: x, height: y) | ||
shadowRadius = blur / 2.0 | ||
} | ||
} | ||
|
||
extension UITabBar { | ||
// 기본 그림자 스타일을 초기화해야 커스텀 스타일을 적용할 수 있다. | ||
static func clearShadow() { | ||
UITabBar.appearance().shadowImage = UIImage() | ||
UITabBar.appearance().backgroundImage = UIImage() | ||
UITabBar.appearance().backgroundColor = UIColor.white | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters