Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean Xcode 16 warning #266

Merged
merged 3 commits into from
Oct 9, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1300;
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1600;
TargetAttributes = {
24651B2A27043658005AD842 = {
CreatedOnToolsVersion = 13.0;
Expand Down Expand Up @@ -419,6 +419,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = DebugMaxDeploymentTarget;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 5 additions & 13 deletions Sources/CharcoalSwiftUI/Colors/Backgrounds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,10 @@ public extension View {
}
}

// MARK: Development View

private struct BackgroundView: View {
var body: some View {
ZStack {
Text("Charcoal")
Color.clear
}
.background(charcoalColor: .warning)
}
}

#Preview {
BackgroundView()
ZStack {
Text("Charcoal")
Color.clear
}
.background(charcoalColor: .warning)
}
16 changes: 4 additions & 12 deletions Sources/CharcoalSwiftUI/Colors/Foregrounds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@ public extension View {
}
}

// MARK: Development View

private struct ForegroundView: View {
var body: some View {
ZStack {
Text("Charcoal")
.foregroundStyle(charcoalColor: .brand)
}
}
}

#Preview {
ForegroundView()
ZStack {
Text("Charcoal")
.foregroundStyle(charcoalColor: .brand)
}
}
54 changes: 24 additions & 30 deletions Sources/CharcoalSwiftUI/Components/CharcoalSpinner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,38 +114,32 @@ public extension View {
}
}

struct SpinnersPreview: View {
@State var isPresenting = true
@State var isBigPresenting = true
@State var isTransparentPresenting = true

var body: some View {
ZStack {
Color.gray.opacity(0.2)
VStack {
Button {
isPresenting.toggle()
} label: {
Text("Toggle Spinner")
}
VStack {}
.frame(width: 100, height: 100)
.charcoalSpinner(isPresenting: $isPresenting)
@available(iOS 17, *)
#Preview {
@Previewable @State var isPresenting = true
@Previewable @State var isBigPresenting = true
@Previewable @State var isTransparentPresenting = true

ZStack {
Color.gray.opacity(0.2)
VStack {
Button {
isPresenting.toggle()
} label: {
Text("Toggle Spinner")
}
VStack {}
.frame(width: 100, height: 100)
.charcoalSpinner(isPresenting: $isPresenting)

VStack {}
.frame(width: 100, height: 150)
.charcoalSpinner(isPresenting: $isBigPresenting, spinnerSize: 100)
VStack {}
.frame(width: 100, height: 150)
.charcoalSpinner(isPresenting: $isBigPresenting, spinnerSize: 100)

VStack {}
.frame(width: 100, height: 100)
.charcoalSpinner(isPresenting: $isTransparentPresenting, transparentBackground: true)
}
VStack {}
.frame(width: 100, height: 100)
.charcoalSpinner(isPresenting: $isTransparentPresenting, transparentBackground: true)
}
.ignoresSafeArea()
}
}

@available(iOS 17, *)
#Preview {
SpinnersPreview()
.ignoresSafeArea()
}
8 changes: 4 additions & 4 deletions Sources/CharcoalSwiftUI/Components/CharcoalTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public extension View {
}
}

@available(iOS 15, *)
@available(iOS 17, *)
#Preview {
@State var text1 = ""
@State var text2 = ""
@Previewable @State var text1 = ""
@Previewable @State var text2 = ""

return VStack(spacing: 16) {
VStack(spacing: 16) {
TextField("Simple text field", text: $text1)
.charcoalTextField()
TextField("Placeholder", text: $text2)
Expand Down
125 changes: 60 additions & 65 deletions Sources/CharcoalSwiftUI/Components/Toast/CharcoalSnackBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,83 +203,78 @@ public extension View {
}
}

private struct SnackBarsPreviewView: View {
@State var isPresenting = true
@available(iOS 17, *)
#Preview {
@Previewable @State var isPresenting = true

@State var isPresenting2 = true
@Previewable @State var isPresenting2 = true

@State var isPresenting3 = true
@Previewable @State var isPresenting3 = true

@State var textOfLabel = "Hello"
@Previewable @State var textOfLabel = "Hello"

var body: some View {
NavigationView(content: {
TabView {
NavigationView(content: {
TabView {
ZStack {
ZStack {
ZStack {
Button {
isPresenting.toggle()
isPresenting3.toggle()
} label: {
Text("Toggle SnackBar")
}
}
.charcoalSnackBar(
isPresenting: $isPresenting,
screenEdge: .top,
text: "ブックマークしました",
thumbnailImage: Image(uiImage: CharcoalAsset.ColorPaletteGenerated.border.color.imageWithColor(width: 64, height: 64)),
action: {
Button {
isPresenting.toggle()
isPresenting3.toggle()
print("Tapped")
} label: {
Text("Toggle SnackBar")
Text("編集")
}
}
.charcoalSnackBar(
isPresenting: $isPresenting,
screenEdge: .top,
text: "ブックマークしました",
thumbnailImage: Image(uiImage: CharcoalAsset.ColorPaletteGenerated.border.color.imageWithColor(width: 64, height: 64)),
action: {
Button {
print("Tapped")
} label: {
Text("編集")
}
}
)
.charcoalSnackBar(
isPresenting: $isPresenting2,
screenEdge: .bottom,
text: "ブックマークしました",
dismissAfter: 2,
action: {
Button {
print("Tapped")
} label: {
Text("編集")
}
)
.charcoalSnackBar(
isPresenting: $isPresenting2,
screenEdge: .bottom,
text: "ブックマークしました",
dismissAfter: 2,
action: {
Button {
print("Tapped")
} label: {
Text("編集")
}
)
.charcoalSnackBar(
isPresenting: $isPresenting3,
screenEdgeSpacing: 275,
text: "ブックマークしました"
)
}

.tabItem {
Image(systemName: "1.circle")
Text("First")
}

Text("Second Tab")
.tabItem {
Image(systemName: "2.circle")
Text("Second")
}
)
.charcoalSnackBar(
isPresenting: $isPresenting3,
screenEdgeSpacing: 275,
text: "ブックマークしました"
)
}

Text("Third Tab")
.tabItem {
Image(systemName: "3.circle")
Text("Third")
}
.tabItem {
Image(systemName: "1.circle")
Text("First")
}
.navigationTitle("Snackbar")
})
.charcoalOverlayContainer()
}
}

#Preview {
SnackBarsPreviewView()
Text("Second Tab")
.tabItem {
Image(systemName: "2.circle")
Text("Second")
}

Text("Third Tab")
.tabItem {
Image(systemName: "3.circle")
Text("Third")
}
}
.navigationTitle("Snackbar")
})
.charcoalOverlayContainer()
}
Loading
Loading