diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/PollController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/PollController.swift index 3914e51b..7a1e2cb9 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/PollController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/PollController.swift @@ -34,11 +34,16 @@ class PollController: ViewController { } private func moveOptions(indices: IndexSet, newIndex: Int) { - poll.options.moveObjects(at: indices, to: newIndex) + // see AttachmentsListController.moveAttachments + var array = poll.pollOptions + array.move(fromOffsets: indices, toOffset: newIndex) + poll.options = NSMutableOrderedSet(array: array) } private func removeOption(_ option: PollOption) { - poll.options.remove(option) + var array = poll.pollOptions + array.remove(at: poll.options.index(of: option)) + poll.options = NSMutableOrderedSet(array: array) } private var canAddOption: Bool { diff --git a/Packages/ComposeUI/Sources/ComposeUI/Views/EmojiTextField.swift b/Packages/ComposeUI/Sources/ComposeUI/Views/EmojiTextField.swift index cbb9906c..ef856abe 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Views/EmojiTextField.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Views/EmojiTextField.swift @@ -52,6 +52,11 @@ struct EmojiTextField: UIViewRepresentable { if text != uiView.text { uiView.text = text } + if placeholder != uiView.attributedPlaceholder?.string { + uiView.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [ + .foregroundColor: UIColor.secondaryLabel, + ]) + } context.coordinator.text = $text context.coordinator.maxLength = maxLength