Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version: 5.8
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "CustomizableSegmentedControl",
platforms: [.iOS(.v14)],
platforms: [.iOS(.v15), .macOS(.v12)], // .tvOS(.v15), .macCatalyst(.v15), .visionOS(.v1)
products: [
.library(
name: "CustomizableSegmentedControl",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ If you're bored with standard segmented control, this framework is for you! `Cus

# Requirements

- iOS 14.0+
- iOS 15.0+
- macOS 12.0+
- Swift 5+

# Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,33 +107,35 @@ extension CustomizableSegmentedControl {
Button(action: action) {
content
.blendModeIfNotNil(contentBlendMode)
.overlay {
.overlay(content: {
if let firstLevelOverlayBlendMode {
content
.blendMode(firstLevelOverlayBlendMode)
.accessibilityHidden(true)
}
}
.overlay {
})
.overlay(content: {
if let highestLevelOverlayBlendMode {
content
.blendMode(highestLevelOverlayBlendMode)
.accessibilityHidden(true)
}
}
.background {
})
.background(content: {
if isSelected {
selectionView
.transition(.offset())
.matchedGeometryEffect(id: backgroundID, in: namespaceID)
}
}
})
.animation(animation, value: isSelected)
}
.buttonStyle(SegmentButtonStyle(isPressed: $isPressed))
.accessibilityElement(children: .combine)
.accessibilityAddTraits(isSelected ? .isSelected : [])
#if os(iOS)
.accessibilityRemoveTraits(isSelected ? [] : .isSelected)
#endif
.accessibilityValue(accessibiltyValue)
}

Expand Down