code: def _generate_union_tag_state(self, union):
          
          union_name = fmt_class_prefix(union)
          tag_type = fmt_enum_name('tag', union)
          description_str = ('The `{}` enum type represents the possible tag '
                             'states with which the `{}` union can exist.')
          self.emit_wrapped_text(
              description_str.format(tag_type, union_name),
              prefix=comment_prefix)
          with self.block(
                  'typedef NS_ENUM(NSInteger, {})'.format(tag_type), after=';'):
              for field in union.all_fields:
                  doc = self.process_doc(
                      field.doc, self._docf) if field.doc else undocumented
                  self.emit_wrapped_text(doc, prefix=comment_prefix)
                  self.emit('{},'.format(fmt_enum_name(field.name, union)))
                  self.emit()
          self.emit()
docs: Emits union tag enum type, which stores union state.