Skip to content

id UUID #1

@m4gu4l

Description

@m4gu4l

Hola Ale
Con este código no me corre la aplicación
struct TodoItem: Codable, Identifiable {
let id = UUID()
let todo: String

Pero si le pongo como variable al id, sí corre la aplicación

struct TodoItem: Codable, Identifiable {
var id = UUID()
let todo: String

No sé cual es la explicación, con la constante me daba error cuando el button llama a los datos...
self.allTodos.append(TodoItem(todo: self.newTodo))
Un abrazo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions