-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
db2c736
commit 0aa0713
Showing
2 changed files
with
69 additions
and
0 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,30 @@ | ||
// | ||
// MSGradientLayer.swift | ||
// MSUIKit | ||
// | ||
// Created by 이창준 on 2024.01.11. | ||
// | ||
|
||
import UIKit | ||
|
||
public class MSGradientLayer: CAGradientLayer { | ||
|
||
// MARK: - Properties | ||
|
||
public var gradientColors: [UIColor] = [] { | ||
didSet { self.updateColors() } | ||
} | ||
|
||
// MARK: - Functions | ||
|
||
// swiftlint:disable identifier_name | ||
public override func hitTest(_ p: CGPoint) -> CALayer? { | ||
return nil | ||
} | ||
// swiftlint:enable identifier_name | ||
|
||
private func updateColors() { | ||
self.colors = self.gradientColors.map { $0.cgColor } | ||
} | ||
|
||
} |