> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-ios-v5-calls-corrections.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Raise Hand

> Add raise hand behavior in CometChat Calls SDK v5 on iOS so participants can request attention during group calls.

Allow participants to raise their hand to get attention during calls. This feature is useful for large meetings, webinars, or any scenario where participants need to signal they want to speak.

## Raise Hand

Signal that you want to speak or get attention:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    CallSession.shared.raiseHand()
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    [[CallSession shared] raiseHand];
    ```
  </Tab>
</Tabs>

## Lower Hand

Remove the raised hand indicator:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    CallSession.shared.lowerHand()
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    [[CallSession shared] lowerHand];
    ```
  </Tab>
</Tabs>

## Listen for Raise Hand Events

Monitor when participants raise or lower their hands using `ParticipantEventListener`:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    class CallViewController: UIViewController, ParticipantEventListener {
        
        override func viewDidLoad() {
            super.viewDidLoad()
            CallSession.shared.addParticipantEventListener(self)
        }
        
        deinit {
            CallSession.shared.removeParticipantEventListener(self)
        }
        
        func onParticipantHandRaised(participant: Participant) {
            print("\(participant.name ?? "") raised their hand")
            // Show notification or visual indicator
            showHandRaisedNotification(participant)
        }

        func onParticipantHandLowered(participant: Participant) {
            print("\(participant.name ?? "") lowered their hand")
            // Remove notification or visual indicator
            hideHandRaisedIndicator(participant)
        }

        // Other callbacks...
        func onParticipantJoined(participant: Participant) {}
        func onParticipantLeft(participant: Participant) {}
        func onParticipantListChanged(participants: [Participant]) {}
        func onParticipantAudioMuted(participant: Participant) {}
        func onParticipantAudioUnmuted(participant: Participant) {}
        func onParticipantVideoPaused(participant: Participant) {}
        func onParticipantVideoResumed(participant: Participant) {}
        func onParticipantStartedScreenShare(participant: Participant) {}
        func onParticipantStoppedScreenShare(participant: Participant) {}
        func onParticipantStartedRecording(participant: Participant) {}
        func onParticipantStoppedRecording(participant: Participant) {}
        func onDominantSpeakerChanged(participant: Participant) {}
    }
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    @interface CallViewController () <ParticipantEventListener>
    @end

    @implementation CallViewController

    - (void)viewDidLoad {
        [super viewDidLoad];
        [[CallSession shared] addParticipantEventListener:self];
    }

    - (void)dealloc {
        [[CallSession shared] removeParticipantEventListener:self];
    }

    - (void)onParticipantHandRaisedWithParticipant:(Participant *)participant {
        NSLog(@"%@ raised their hand", participant.name);
        // Show notification or visual indicator
        [self showHandRaisedNotification:participant];
    }

    - (void)onParticipantHandLoweredWithParticipant:(Participant *)participant {
        NSLog(@"%@ lowered their hand", participant.name);
        // Remove notification or visual indicator
        [self hideHandRaisedIndicator:participant];
    }

    // Other callbacks...

    @end
    ```
  </Tab>
</Tabs>

## Track Raised Hands

`Participant` carries **no** raised-hand property, and the SDK exposes no getter for one. Keep an
ordered list of your own, driven by the `onParticipantHandRaised` / `onParticipantHandLowered`
callbacks.

<Warning>
  These callbacks fire only when a hand goes **up or down**. A client that joins mid-call cannot
  discover hands that were already raised before it joined.
</Warning>

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    // Raised hands, oldest first. Keyed by uid, because that is the only identifier
    // `Participant` actually carries.
    private var raisedHands: [(uid: String, name: String, at: Date)] = []

    func onParticipantHandRaised(participant: Participant) {
        guard let uid = participant.uid else { return }
        DispatchQueue.main.async {
            guard !self.raisedHands.contains(where: { $0.uid == uid }) else { return }
            self.raisedHands.append((uid, participant.name ?? uid, Date()))
            self.updateRaisedHandsList(self.raisedHands)
        }
    }

    func onParticipantHandLowered(participant: Participant) {
        guard let uid = participant.uid else { return }
        DispatchQueue.main.async {
            self.raisedHands.removeAll { $0.uid == uid }
            self.updateRaisedHandsList(self.raisedHands)
        }
    }

    // Someone who leaves should not stay in the queue.
    func onParticipantLeft(participant: Participant) {
        guard let uid = participant.uid else { return }
        DispatchQueue.main.async {
            self.raisedHands.removeAll { $0.uid == uid }
            self.updateRaisedHandsList(self.raisedHands)
        }
    }
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    // NSMutableArray of uid strings, oldest first.
    @property (nonatomic, strong) NSMutableArray<NSString *> *raisedHandUIDs;

    - (void)onParticipantHandRaisedWithParticipant:(Participant *)participant {
        NSString *uid = participant.uid;
        if (!uid) { return; }
        dispatch_async(dispatch_get_main_queue(), ^{
            if (![self.raisedHandUIDs containsObject:uid]) {
                [self.raisedHandUIDs addObject:uid];
                [self updateRaisedHandsList:self.raisedHandUIDs];
            }
        });
    }

    - (void)onParticipantHandLoweredWithParticipant:(Participant *)participant {
        NSString *uid = participant.uid;
        if (!uid) { return; }
        dispatch_async(dispatch_get_main_queue(), ^{
            [self.raisedHandUIDs removeObject:uid];
            [self updateRaisedHandsList:self.raisedHandUIDs];
        });
    }
    ```
  </Tab>
</Tabs>

## Hide Raise Hand Button

To disable the raise hand feature, hide the button in the call UI:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let sessionSettings = CometChatCalls.sessionSettingsBuilder
        .hideRaiseHandButton(true)
        .build()
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    SessionSettings *sessionSettings = [[[CometChatCalls sessionSettingsBuilder]
        hideRaiseHandButton:YES]
        build];
    ```
  </Tab>
</Tabs>
