> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Raise Hand

> CometChat Calling SDK v5 - Raise Hand for iOS

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>

## Check Raised Hand Status

The `Participant` object includes a `raisedHandTimestamp` property to check if a participant has their hand raised:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    func onParticipantListChanged(participants: [Participant]) {
        let raisedHands = participants
            .filter { $0.raisedHandTimestamp > 0 }
            .sorted { $0.raisedHandTimestamp < $1.raisedHandTimestamp }
        
        // Display participants with raised hands in order
        updateRaisedHandsList(raisedHands)
    }
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    - (void)onParticipantListChangedWithParticipants:(NSArray<Participant *> *)participants {
        NSMutableArray *raisedHands = [NSMutableArray array];
        for (Participant *p in participants) {
            if (p.raisedHandTimestamp > 0) {
                [raisedHands addObject:p];
            }
        }
        // Sort by timestamp and display
        [raisedHands sortUsingComparator:^NSComparisonResult(Participant *a, Participant *b) {
            return [@(a.raisedHandTimestamp) compare:@(b.raisedHandTimestamp)];
        }];
        [self updateRaisedHandsList:raisedHands];
    }
    ```
  </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>
