-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from daria-andrioaie/feature/customizable-border
Customizable border
- Loading branch information
Showing
9 changed files
with
97 additions
and
3 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
// | ||
// UIView+Border.swift | ||
// TTSegmentedControl | ||
// | ||
// Created by Daria Andrioaie on 23.08.2023. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIView { | ||
func apply(_ border: TTSegmentedControlBorder) { | ||
layer.borderColor = border.color.cgColor | ||
layer.borderWidth = border.lineWidth | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Sources/TTSegmentedControl/Models/TTSegmentedControlBorder.swift
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,18 @@ | ||
// | ||
// TTSegmentedControlBorder.swift | ||
// TTSegmentedControl | ||
// | ||
// Created by Daria Andrioaie on 23.08.2023. | ||
// | ||
|
||
import UIKit | ||
|
||
public struct TTSegmentedControlBorder { | ||
public let color: UIColor | ||
public let lineWidth: CGFloat | ||
|
||
public init(color: UIColor, lineWidth: CGFloat = 1) { | ||
self.color = color | ||
self.lineWidth = lineWidth | ||
} | ||
} |
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
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