NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

SOLVED: Strange error on Day 99 Challenge

Forums > 100 Days of SwiftUI

Hi guys,

I created a watermarked extension to complete the challenge n.1 of day 99. It gives me this error:

Conflicting arguments to generic parameter 'Content' ('<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>')

The code is the same Paul wrote in day 96-98.

The code I written:

import SwiftUI

struct Watermark: ViewModifier {
    var resort: Resort

    func body(content: Content) -> some View {
        ZStack(alignment: .bottomLeading) {


extension View {
    func watermarked(with text: Resort) -> some View {
        modifier(Watermark(resort: text))

and the code I modified and where It gives me the errors:

import SwiftUI

struct ResortView: View {
    let resort: Resort

    @Environment(\.horizontalSizeClass) var sizeClass
    @Environment(\.dynamicTypeSize) var typeSize

    @EnvironmentObject var favorites: Favorites

    @State private var selectedFacility: Facility?
    @State private var showingFacility = false

    var body: some View {
        ScrollView {
            VStack(alignment: .leading, spacing: 0) {
                    .watermarked(with: resort.imageCredit)

                HStack {
                    if sizeClass == .compact && typeSize > .large {
                        VStack(spacing: 10) { ResortDetailsView(resort: resort) }
                        VStack(spacing: 10) { SkiDetailsView(resort: resort) }
                    } else {
                        ResortDetailsView(resort: resort)
                        SkiDetailsView(resort: resort)

                Group {


                    HStack {
                        ForEach(resort.facilityTypes) { facility in
                            Button {
                                selectedFacility = facility
                                showingFacility = true
                            } label: {

                    Button(favorites.contains(resort) ? "Remove from Favorites" : "Add to Favorites") {
                        if favorites.contains(resort) {
                        } else {
        .navigationTitle("\(, \(")
        .alert(selectedFacility?.name ?? "More information", isPresented: $showingFacility, presenting: selectedFacility) { _ in
        } message: { facility in

struct ResortView_Previews: PreviewProvider {
    static var previews: some View {
        NavigationView {
            ResortView(resort: Resort.example)

Thank you


The issue is here .watermarked(with: resort.imageCredit)

In your modifier you indicated that watermarked func accepts Resort type but you're passing String type. You can simply change to .watermarked(with: resort).

The only thing I would adivse to use only the text. Logically, if you use only text there why do you need to pass whole Resort struct? At least you could save some bytes of memory :))))

struct Watermark: ViewModifier {
    var text: String

    func body(content: Content) -> some View {
        ZStack(alignment: .bottomTrailing) {
            Text("Photo by \(text)")


Hacking with Swift is sponsored by Judo

SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!

Try now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.