Add accessibility identifiers to privacy settings view.

pull/2/head
Matthew Chen 6 years ago
parent 99cd3f9b26
commit 79d6384bc9

@ -88,6 +88,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[blocklistSection [blocklistSection
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE",
@"Label for the block list section of the settings view") @"Label for the block list section of the settings view")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"blocklist"]
actionBlock:^{ actionBlock:^{
[weakSelf showBlocklist]; [weakSelf showBlocklist];
}]]; }]];
@ -101,9 +102,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[readReceiptsSection [readReceiptsSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT", addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_READ_RECEIPT",
@"Label for the 'read receipts' setting.") @"Label for the 'read receipts' setting.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"read_receipts"]
isOnBlock:^{ isOnBlock:^{
return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled]; return [OWSReadReceiptManager.sharedManager areReadReceiptsEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleReadReceiptsSwitch:)]]; selector:@selector(didToggleReadReceiptsSwitch:)]];
[contents addSection:readReceiptsSection]; [contents addSection:readReceiptsSection];
@ -116,9 +121,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[typingIndicatorsSection [typingIndicatorsSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_TYPING_INDICATORS", addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_TYPING_INDICATORS",
@"Label for the 'typing indicators' setting.") @"Label for the 'typing indicators' setting.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"typing_indicators"]
isOnBlock:^{ isOnBlock:^{
return [SSKEnvironment.shared.typingIndicators areTypingIndicatorsEnabled]; return [SSKEnvironment.shared.typingIndicators areTypingIndicatorsEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleTypingIndicatorsSwitch:)]]; selector:@selector(didToggleTypingIndicatorsSwitch:)]];
[contents addSection:typingIndicatorsSection]; [contents addSection:typingIndicatorsSection];
@ -132,9 +141,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
addItem:[OWSTableItem addItem:[OWSTableItem
switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_LOCK_SWITCH_LABEL", switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_LOCK_SWITCH_LABEL",
@"Label for the 'enable screen lock' switch of the privacy settings.") @"Label for the 'enable screen lock' switch of the privacy settings.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"screenlock"]
isOnBlock:^{ isOnBlock:^{
return [OWSScreenLock.sharedManager isScreenLockEnabled]; return [OWSScreenLock.sharedManager isScreenLockEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:self target:self
selector:@selector(isScreenLockEnabledDidChange:)]]; selector:@selector(isScreenLockEnabledDidChange:)]];
[contents addSection:screenLockSection]; [contents addSection:screenLockSection];
@ -149,6 +162,8 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
NSLocalizedString(@"SETTINGS_SCREEN_LOCK_ACTIVITY_TIMEOUT", NSLocalizedString(@"SETTINGS_SCREEN_LOCK_ACTIVITY_TIMEOUT",
@"Label for the 'screen lock activity timeout' setting of the privacy settings.") @"Label for the 'screen lock activity timeout' setting of the privacy settings.")
detailText:screenLockTimeoutString detailText:screenLockTimeoutString
accessibilityIdentifier:[NSString
stringWithFormat:@"settings.privacy.%@", @"screen_lock_timeout"]
actionBlock:^{ actionBlock:^{
[weakSelf showScreenLockTimeoutUI]; [weakSelf showScreenLockTimeoutUI];
}]]; }]];
@ -160,9 +175,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
screenSecuritySection.footerTitle = NSLocalizedString(@"SETTINGS_SCREEN_SECURITY_DETAIL", nil); screenSecuritySection.footerTitle = NSLocalizedString(@"SETTINGS_SCREEN_SECURITY_DETAIL", nil);
[screenSecuritySection [screenSecuritySection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @"") addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_SCREEN_SECURITY", @"")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"screen_security"]
isOnBlock:^{ isOnBlock:^{
return [Environment.shared.preferences screenSecurityIsEnabled]; return [Environment.shared.preferences screenSecurityIsEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleScreenSecuritySwitch:)]]; selector:@selector(didToggleScreenSecuritySwitch:)]];
[contents addSection:screenSecuritySection]; [contents addSection:screenSecuritySection];
@ -176,9 +195,14 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString( [callingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
@"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE", @"SETTINGS_CALLING_HIDES_IP_ADDRESS_PREFERENCE_TITLE",
@"Table cell label") @"Table cell label")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@",
@"calling_hide_ip_address"]
isOnBlock:^{ isOnBlock:^{
return [Environment.shared.preferences doCallsHideIPAddress]; return [Environment.shared.preferences doCallsHideIPAddress];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleCallsHideIPAddressSwitch:)]]; selector:@selector(didToggleCallsHideIPAddressSwitch:)]];
[contents addSection:callingSection]; [contents addSection:callingSection];
@ -189,9 +213,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
addItem:[OWSTableItem switchItemWithText:NSLocalizedString( addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
@"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE", @"SETTINGS_PRIVACY_CALLKIT_SYSTEM_CALL_LOG_PREFERENCE_TITLE",
@"Short table cell label") @"Short table cell label")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit_history"]
isOnBlock:^{ isOnBlock:^{
return [Environment.shared.preferences isSystemCallLogEnabled]; return [Environment.shared.preferences isSystemCallLogEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleEnableSystemCallLogSwitch:)]]; selector:@selector(didToggleEnableSystemCallLogSwitch:)]];
callKitSection.footerTitle = NSLocalizedString( callKitSection.footerTitle = NSLocalizedString(
@ -201,20 +229,29 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection *callKitSection = [OWSTableSection new]; OWSTableSection *callKitSection = [OWSTableSection new];
callKitSection.footerTitle callKitSection.footerTitle
= NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer."); = NSLocalizedString(@"SETTINGS_SECTION_CALL_KIT_DESCRIPTION", @"Settings table section footer.");
[callKitSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_TITLE", [callKitSection
@"Short table cell label") addItem:[OWSTableItem switchItemWithText:NSLocalizedString(
@"SETTINGS_PRIVACY_CALLKIT_TITLE", @"Short table cell label")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"callkit"]
isOnBlock:^{ isOnBlock:^{
return [Environment.shared.preferences isCallKitEnabled]; return [Environment.shared.preferences isCallKitEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleEnableCallKitSwitch:)]]; selector:@selector(didToggleEnableCallKitSwitch:)]];
if (self.preferences.isCallKitEnabled) { if (self.preferences.isCallKitEnabled) {
[callKitSection [callKitSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE", addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_PRIVACY_CALLKIT_PRIVACY_TITLE",
@"Label for 'CallKit privacy' preference") @"Label for 'CallKit privacy' preference")
accessibilityIdentifier:[NSString
stringWithFormat:@"settings.privacy.%@", @"callkit_privacy"]
isOnBlock:^{ isOnBlock:^{
return (BOOL) ! return (BOOL) ![Environment.shared.preferences isCallKitPrivacyEnabled];
[Environment.shared.preferences isCallKitPrivacyEnabled]; }
isEnabledBlock:^{
return YES;
} }
target:weakSelf target:weakSelf
selector:@selector(didToggleEnableCallKitPrivacySwitch:)]]; selector:@selector(didToggleEnableCallKitPrivacySwitch:)]];
@ -236,6 +273,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
@"Indicates that 'two factor auth' is enabled in the privacy settings.") @"Indicates that 'two factor auth' is enabled in the privacy settings.")
: NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED", : NSLocalizedString(@"SETTINGS_TWO_FACTOR_AUTH_DISABLED",
@"Indicates that 'two factor auth' is disabled in the privacy settings.")) @"Indicates that 'two factor auth' is disabled in the privacy settings."))
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"2fa"]
actionBlock:^{ actionBlock:^{
[weakSelf show2FASettings]; [weakSelf show2FASettings];
}]]; }]];
@ -243,7 +281,9 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection *historyLogsSection = [OWSTableSection new]; OWSTableSection *historyLogsSection = [OWSTableSection new];
historyLogsSection.headerTitle = NSLocalizedString(@"SETTINGS_HISTORYLOG_TITLE", @"Section header"); historyLogsSection.headerTitle = NSLocalizedString(@"SETTINGS_HISTORYLOG_TITLE", @"Section header");
[historyLogsSection addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_CLEAR_HISTORY", @"") [historyLogsSection
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_CLEAR_HISTORY", @"")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"clear_logs"]
actionBlock:^{ actionBlock:^{
[weakSelf clearHistoryLogs]; [weakSelf clearHistoryLogs];
}]]; }]];
@ -285,6 +325,8 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
action:@selector(didToggleUDShowIndicatorsSwitch:) action:@selector(didToggleUDShowIndicatorsSwitch:)
forControlEvents:UIControlEventValueChanged]; forControlEvents:UIControlEventValueChanged];
[cellSwitch setContentHuggingHorizontalHigh]; [cellSwitch setContentHuggingHorizontalHigh];
cellSwitch.accessibilityIdentifier =
[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender"];
UIStackView *stackView = UIStackView *stackView =
[[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]]; [[UIStackView alloc] initWithArrangedSubviews:@[ label, iconView, spacer, cellSwitch ]];
@ -310,9 +352,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new]; OWSTableSection *unidentifiedDeliveryUnrestrictedSection = [OWSTableSection new];
OWSTableItem *unrestrictedAccessItem = [OWSTableItem OWSTableItem *unrestrictedAccessItem = [OWSTableItem
switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label") switchItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_UNRESTRICTED_ACCESS", @"switch label")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"sealed_sender_unrestricted"]
isOnBlock:^{ isOnBlock:^{
return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal]; return [SSKEnvironment.shared.udManager shouldAllowUnrestrictedAccessLocal];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleUDUnrestrictedAccessSwitch:)]; selector:@selector(didToggleUDUnrestrictedAccessSwitch:)];
[unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem]; [unidentifiedDeliveryUnrestrictedSection addItem:unrestrictedAccessItem];
@ -324,6 +370,8 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[unidentifiedDeliveryLearnMoreSection [unidentifiedDeliveryLearnMoreSection
addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE", addItem:[OWSTableItem disclosureItemWithText:NSLocalizedString(@"SETTINGS_UNIDENTIFIED_DELIVERY_LEARN_MORE",
@"Label for a link to more info about unidentified delivery.") @"Label for a link to more info about unidentified delivery.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@",
@"sealed_sender_learn_more"]
actionBlock:^{ actionBlock:^{
NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL]; NSURL *url = [NSURL URLWithString:kSealedSenderInfoURL];
OWSAssertDebug(url); OWSAssertDebug(url);
@ -335,9 +383,13 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[linkPreviewsSection [linkPreviewsSection
addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_LINK_PREVIEWS", addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_LINK_PREVIEWS",
@"Setting for enabling & disabling link previews.") @"Setting for enabling & disabling link previews.")
accessibilityIdentifier:[NSString stringWithFormat:@"settings.privacy.%@", @"link_previews"]
isOnBlock:^{ isOnBlock:^{
return [SSKPreferences areLinkPreviewsEnabled]; return [SSKPreferences areLinkPreviewsEnabled];
} }
isEnabledBlock:^{
return YES;
}
target:weakSelf target:weakSelf
selector:@selector(didToggleLinkPreviewsEnabled:)]]; selector:@selector(didToggleLinkPreviewsEnabled:)]];
linkPreviewsSection.headerTitle = NSLocalizedString( linkPreviewsSection.headerTitle = NSLocalizedString(

@ -72,8 +72,17 @@ typedef BOOL (^OWSTableSwitchBlock)(void);
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock; + (OWSTableItem *)disclosureItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock;
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
actionBlock:(nullable OWSTableActionBlock)actionBlock;
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text
detailText:(NSString *)detailText
actionBlock:(nullable OWSTableActionBlock)actionBlock;
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text + (OWSTableItem *)disclosureItemWithText:(NSString *)text
detailText:(NSString *)detailText detailText:(NSString *)detailText
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
actionBlock:(nullable OWSTableActionBlock)actionBlock; actionBlock:(nullable OWSTableActionBlock)actionBlock;
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text + (OWSTableItem *)disclosureItemWithText:(NSString *)text
@ -115,6 +124,13 @@ typedef BOOL (^OWSTableSwitchBlock)(void);
target:(id)target target:(id)target
selector:(SEL)selector; selector:(SEL)selector;
+ (OWSTableItem *)switchItemWithText:(NSString *)text
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
isOnBlock:(OWSTableSwitchBlock)isOnBlock
isEnabledBlock:(OWSTableSwitchBlock)isEnabledBlock
target:(id)target
selector:(SEL)selector;
- (nullable UITableViewCell *)customCell; - (nullable UITableViewCell *)customCell;
- (NSNumber *)customRowHeight; - (NSNumber *)customRowHeight;

@ -170,6 +170,16 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
return [self itemWithText:text actionBlock:actionBlock accessoryType:UITableViewCellAccessoryDisclosureIndicator]; return [self itemWithText:text actionBlock:actionBlock accessoryType:UITableViewCellAccessoryDisclosureIndicator];
} }
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
actionBlock:(nullable OWSTableActionBlock)actionBlock
{
return [self itemWithText:text
accessibilityIdentifier:accessibilityIdentifier
actionBlock:actionBlock
accessoryType:UITableViewCellAccessoryDisclosureIndicator];
}
+ (OWSTableItem *)checkmarkItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock + (OWSTableItem *)checkmarkItemWithText:(NSString *)text actionBlock:(nullable OWSTableActionBlock)actionBlock
{ {
return [self itemWithText:text actionBlock:actionBlock accessoryType:UITableViewCellAccessoryCheckmark]; return [self itemWithText:text actionBlock:actionBlock accessoryType:UITableViewCellAccessoryCheckmark];
@ -178,6 +188,14 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
+ (OWSTableItem *)itemWithText:(NSString *)text + (OWSTableItem *)itemWithText:(NSString *)text
actionBlock:(nullable OWSTableActionBlock)actionBlock actionBlock:(nullable OWSTableActionBlock)actionBlock
accessoryType:(UITableViewCellAccessoryType)accessoryType accessoryType:(UITableViewCellAccessoryType)accessoryType
{
return [self itemWithText:text accessibilityIdentifier:nil actionBlock:actionBlock accessoryType:accessoryType];
}
+ (OWSTableItem *)itemWithText:(NSString *)text
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
actionBlock:(nullable OWSTableActionBlock)actionBlock
accessoryType:(UITableViewCellAccessoryType)accessoryType
{ {
OWSAssertDebug(text.length > 0); OWSAssertDebug(text.length > 0);
OWSAssertDebug(actionBlock); OWSAssertDebug(actionBlock);
@ -188,6 +206,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
UITableViewCell *cell = [OWSTableItem newCell]; UITableViewCell *cell = [OWSTableItem newCell];
cell.textLabel.text = text; cell.textLabel.text = text;
cell.accessoryType = accessoryType; cell.accessoryType = accessoryType;
cell.accessibilityIdentifier = accessibilityIdentifier;
return cell; return cell;
}; };
return item; return item;
@ -207,6 +226,14 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text + (OWSTableItem *)disclosureItemWithText:(NSString *)text
detailText:(NSString *)detailText detailText:(NSString *)detailText
actionBlock:(nullable OWSTableActionBlock)actionBlock actionBlock:(nullable OWSTableActionBlock)actionBlock
{
return [self disclosureItemWithText:text detailText:detailText accessibilityIdentifier:nil actionBlock:actionBlock];
}
+ (OWSTableItem *)disclosureItemWithText:(NSString *)text
detailText:(NSString *)detailText
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
actionBlock:(nullable OWSTableActionBlock)actionBlock
{ {
OWSAssertDebug(text.length > 0); OWSAssertDebug(text.length > 0);
OWSAssertDebug(actionBlock); OWSAssertDebug(actionBlock);
@ -220,6 +247,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
cell.textLabel.text = text; cell.textLabel.text = text;
cell.detailTextLabel.text = detailText; cell.detailTextLabel.text = detailText;
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
cell.accessibilityIdentifier = accessibilityIdentifier;
return cell; return cell;
}; };
return item; return item;
@ -385,6 +413,21 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
isEnabledBlock:(OWSTableSwitchBlock)isEnabledBlock isEnabledBlock:(OWSTableSwitchBlock)isEnabledBlock
target:(id)target target:(id)target
selector:(SEL)selector selector:(SEL)selector
{
return [self switchItemWithText:text
accessibilityIdentifier:nil
isOnBlock:isOnBlock
isEnabledBlock:isEnabledBlock
target:target
selector:selector];
}
+ (OWSTableItem *)switchItemWithText:(NSString *)text
accessibilityIdentifier:(nullable NSString *)accessibilityIdentifier
isOnBlock:(OWSTableSwitchBlock)isOnBlock
isEnabledBlock:(OWSTableSwitchBlock)isEnabledBlock
target:(id)target
selector:(SEL)selector
{ {
OWSAssertDebug(text.length > 0); OWSAssertDebug(text.length > 0);
OWSAssertDebug(target); OWSAssertDebug(target);
@ -401,6 +444,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
[cellSwitch setOn:isOnBlock()]; [cellSwitch setOn:isOnBlock()];
[cellSwitch addTarget:weakTarget action:selector forControlEvents:UIControlEventValueChanged]; [cellSwitch addTarget:weakTarget action:selector forControlEvents:UIControlEventValueChanged];
cellSwitch.enabled = isEnabledBlock(); cellSwitch.enabled = isEnabledBlock();
cellSwitch.accessibilityIdentifier = accessibilityIdentifier;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;

Loading…
Cancel
Save