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

Alesab/onboarding #964

Merged
merged 24 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ let package = Package(
dependencies: [
"BrowserServicesKit"
],
resources: [
.process("Resources")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s interesting, according to Apple this shouldn’t be needed 🤔

When you add a resource to your Swift package, Xcode detects common resource types for Apple platforms and treats them as a resource automatically. For example, you don’t need to make changes to your package manifest for the following resources:
Interface Builder files; for example, XIB files and storyboards
Core Data files; for example, xcdatamodeld files
Asset catalogs
.lproj folders you use to provide localized resources
If you add a resource file that Xcode doesn’t treat as a resource by default, you must configure it in your package manifest, as described in the next section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah… apparently macOS does not like it without 🥲

],
swiftSettings: [
.define("DEBUG", .when(configuration: .debug))
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,3 @@ private let strokeColor = Color.blue
return ContextualOnboardingListView(list: list) { _ in }
.padding()
}


public let bundle = Bundle.module
4 changes: 2 additions & 2 deletions Sources/Onboarding/DaxDialogs/DaxDialogView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public struct DaxDialogView<Content: View>: View {

@ViewBuilder
private var daxLogo: some View {
let icon = Image(.daxIconExperiment)
let icon = Image("DaxIconExperiment", bundle: bundle)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: DaxDialogMetrics.DaxLogo.size, height: DaxDialogMetrics.DaxLogo.size)
Expand All @@ -122,7 +122,7 @@ public struct DaxDialogView<Content: View>: View {
}

private var wrappedContent: some View {
let backgroundColor = Color(.surface)
let backgroundColor = Color("surface", bundle: bundle)
let shadowColors: (Color, Color) = colorScheme == .light ?
(.black.opacity(0.08), .black.opacity(0.1)) :
(.black.opacity(0.20), .black.opacity(0.16))
Expand Down
22 changes: 22 additions & 0 deletions Sources/Onboarding/global.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// global.swift
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation

/// After importing Onboarding you can access this with `Onboarding.bundle`
public let bundle = Bundle.module
Loading