So this block of code allows me to initialize a data model
struct MockMessage: Identifiable {
let id: Int
let imageName: String
let messageText: String
let isCurrentUser: Bool
}
let MOCK_MESSAGES: [MockMessage] = [
.init(id: 0, imageName: "user", messageText: "Hey, what's up?", isCurrentUser: false),
.init(id: iCouldSetANewOne, imageName: iCouldSetANewOne, messageText: iCouldSetANewOne, isCurrentUser: iCouldSetANewOne)]
My question is
1- How can I replicate/initialize attributes instead of manually writing the same attributes over and over again
2- How can I modify it, let's say, the default rotation effect is set to a degree: 25 and I'd like to change it.
Example of Image attributes
Image(systemName: tabs[index].image)
.frame(height: 20)
.rotationEffect(.degrees(-25))
.foregroundColor(.yellow).scaleEffect(1.25)
mockMessages
or create aMock
struct with static properties for the various mock data that I need.