Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func giftMessage(with giftModel: PTChatGiftNotificationModel) -> String {
- switch giftModel.sender {
- case .me:
- switch giftModel.receiver {
- //I to myself
- case .me:
- return String(format: NSLocalizedString("You sent a %@ to yourself!", comment: "You sent a %@ to yourself!"),
- giftModel.giftDesciption)
- //I to somebody
- case let .person(_, receiverName):
- return String(format: NSLocalizedString("You sent a %@ to %@!", comment: "You sent a %@ to %@!"),
- giftModel.giftDesciption, receiverName)
- // I to room
- case .room:
- return String(format: NSLocalizedString("You sent a %@ to room!", comment: "You sent a %@ to room!"),
- giftModel.giftDesciption)
- }
- case let .person(_, senderName):
- switch giftModel.receiver {
- //Somebody to me
- case .me:
- return String(format: NSLocalizedString("%@ sent a %@ to you!", comment: "%@ sent a %@ to you!"),
- senderName, giftModel.giftDesciption)
- //Somebody to somebody
- case let .person(_, receiverName):
- return String(format: NSLocalizedString("%@ sent a %@ to %@!", comment: "You sent a %@ to %@!"),
- senderName, giftModel.giftDesciption, receiverName)
- //Somebody to room
- case .room:
- return String(format: NSLocalizedString("%@ sent a %@ to room!", comment: "You sent a %@ to room!"),
- senderName, giftModel.giftDesciption)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement