Created
December 5, 2019 00:09
-
-
Save JWPapi/c0aa4a45360bfac85c144091b83de1d0 to your computer and use it in GitHub Desktop.
where to put users.count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if users.count > 0 { | |
if friendAttendees.count > 0 { | |
attendeesString.append(getYouOrFriendString(uid: friendAttendees[0].uid!, userName: friendAttendees[0].name)) | |
} | |
if friendAttendees.count > 1 { | |
attendeesString.append(getYouOrFriendString(uid: friendAttendees[1].uid!, userName: friendAttendees[1].name)) | |
} | |
if strangerAttendeeCount > 0 { | |
attendeesString.append(NSMutableAttributedString(string: " and \(strangerAttendeeCount) other")) | |
} | |
if strangerAttendeeCount > 0 && friendAttendees.count == 0 { | |
let userCase = strangerAttendeeCount > 1 ? "users" : "user" | |
attendeesString.append(NSMutableAttributedString(string: "\(strangerAttendeeCount) \(userCase)", attributes: [ | |
.font: UIFont.systemFont(ofSize:16), | |
.foregroundColor: UIColor.lightGray | |
] as [NSAttributedString.Key: Any])) | |
} | |
attendeesString.append(NSMutableAttributedString(string: " booked a table.", attributes: [ | |
.font: UIFont.systemFont(ofSize:16), | |
.foregroundColor: UIColor.lightGray | |
] as [NSAttributedString.Key: Any] | |
)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment