mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Respond to CR.
// FREEBIE
This commit is contained in:
parent
89e244ee0a
commit
db31454320
|
@ -1,11 +1,11 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1217" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="tuk-0x-yCb">
|
||||||
<device id="retina4_7" orientation="portrait">
|
<device id="retina4_7" orientation="portrait">
|
||||||
<adaptation id="fullscreen"/>
|
<adaptation id="fullscreen"/>
|
||||||
</device>
|
</device>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
|
||||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||||
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
|
||||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||||
|
@ -678,7 +678,7 @@
|
||||||
<objects>
|
<objects>
|
||||||
<navigationController storyboardIdentifier="UserInitialViewController" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="tuk-0x-yCb" customClass="SignalsNavigationController" sceneMemberID="viewController">
|
<navigationController storyboardIdentifier="UserInitialViewController" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="tuk-0x-yCb" customClass="SignalsNavigationController" sceneMemberID="viewController">
|
||||||
<toolbarItems/>
|
<toolbarItems/>
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="VNq-cN-pk9">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" id="VNq-cN-pk9">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<color key="barTintColor" red="0.082137122750282288" green="0.46843802928924561" blue="0.91112053394317627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="barTintColor" red="0.082137122750282288" green="0.46843802928924561" blue="0.91112053394317627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
@ -788,7 +788,7 @@
|
||||||
<scene sceneID="nF7-wR-ITu">
|
<scene sceneID="nF7-wR-ITu">
|
||||||
<objects>
|
<objects>
|
||||||
<navigationController storyboardIdentifier="SettingsNavigationController" id="u7y-N1-6Ba" sceneMemberID="viewController">
|
<navigationController storyboardIdentifier="SettingsNavigationController" id="u7y-N1-6Ba" sceneMemberID="viewController">
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="OEe-gh-9Ii">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" id="OEe-gh-9Ii">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
</navigationBar>
|
</navigationBar>
|
||||||
|
@ -1069,7 +1069,7 @@
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="aboutLabel" destination="qeN-f1-cIQ" id="kmc-iU-NK5"/>
|
<outlet property="aboutLabel" destination="qeN-f1-cIQ" id="kmc-iU-NK5"/>
|
||||||
<outlet property="advancedLabel" destination="dkL-Nz-E6H" id="HUw-SB-apQ"/>
|
<outlet property="advancedLabel" destination="dkL-Nz-E6H" id="HUw-SB-apQ"/>
|
||||||
<outlet property="blocklistLabel" destination="jQa-vx-tCW" id="m54-NJ-dpu"/>
|
<outlet property="blockListLabel" destination="jQa-vx-tCW" id="m54-NJ-dpu"/>
|
||||||
<outlet property="destroyAccountButton" destination="4Mk-ly-6fq" id="6Xj-Rb-kfF"/>
|
<outlet property="destroyAccountButton" destination="4Mk-ly-6fq" id="6Xj-Rb-kfF"/>
|
||||||
<outlet property="inviteLabel" destination="9FD-M0-WLe" id="TfU-b4-OtN"/>
|
<outlet property="inviteLabel" destination="9FD-M0-WLe" id="TfU-b4-OtN"/>
|
||||||
<outlet property="linkedDevicesLabel" destination="hrc-lZ-NeA" id="VkD-E5-2kW"/>
|
<outlet property="linkedDevicesLabel" destination="hrc-lZ-NeA" id="VkD-E5-2kW"/>
|
||||||
|
@ -1181,7 +1181,7 @@
|
||||||
<objects>
|
<objects>
|
||||||
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="cZ7-de-SUi" sceneMemberID="viewController">
|
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="cZ7-de-SUi" sceneMemberID="viewController">
|
||||||
<toolbarItems/>
|
<toolbarItems/>
|
||||||
<navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" translucent="NO" id="gzw-fh-en2">
|
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="gzw-fh-en2">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<color key="barTintColor" red="0.082137122750282288" green="0.46843802928924561" blue="0.91112053394317627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="barTintColor" red="0.082137122750282288" green="0.46843802928924561" blue="0.91112053394317627" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
@ -1306,11 +1306,11 @@
|
||||||
<viewControllerLayoutGuide type="bottom" id="kH6-9L-pzh"/>
|
<viewControllerLayoutGuide type="bottom" id="kH6-9L-pzh"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="P0X-AM-Yjw">
|
<view key="view" contentMode="scaleToFill" id="P0X-AM-Yjw">
|
||||||
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ukg-om-VX3" userLabel="Group Details">
|
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ukg-om-VX3" userLabel="Group Details">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
|
<rect key="frame" x="0.0" y="20" width="375" height="100"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ul8-NY-i4c">
|
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ul8-NY-i4c">
|
||||||
<rect key="frame" x="8" y="20" width="60" height="60"/>
|
<rect key="frame" x="8" y="20" width="60" height="60"/>
|
||||||
|
@ -1345,7 +1345,7 @@
|
||||||
</constraints>
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsMultipleSelection="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="cFo-AT-Srf">
|
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsMultipleSelection="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="cFo-AT-Srf">
|
||||||
<rect key="frame" x="0.0" y="108" width="375" height="495"/>
|
<rect key="frame" x="0.0" y="128" width="375" height="539"/>
|
||||||
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<view key="tableHeaderView" contentMode="scaleToFill" id="ekO-kw-iHV" userLabel="Header View">
|
<view key="tableHeaderView" contentMode="scaleToFill" id="ekO-kw-iHV" userLabel="Header View">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="40"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="40"/>
|
||||||
|
|
|
@ -83,8 +83,9 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
_countryNameButton.titleLabel.font = [UIFont ows_mediumFontWithSize:16.f];
|
_countryNameButton.titleLabel.font = [UIFont ows_mediumFontWithSize:16.f];
|
||||||
[_countryNameButton setTitleColor:[UIColor blackColor]
|
[_countryNameButton setTitleColor:[UIColor blackColor]
|
||||||
forState:UIControlStateNormal];
|
forState:UIControlStateNormal];
|
||||||
[_countryNameButton setTitle:NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"")
|
[_countryNameButton
|
||||||
forState:UIControlStateNormal];
|
setTitle:NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"Label for the country code field")
|
||||||
|
forState:UIControlStateNormal];
|
||||||
[_countryNameButton addTarget:self
|
[_countryNameButton addTarget:self
|
||||||
action:@selector(showCountryCodeView:)
|
action:@selector(showCountryCodeView:)
|
||||||
forControlEvents:UIControlEventTouchUpInside];
|
forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
@ -116,7 +117,8 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
UILabel *phoneNumberLabel = [UILabel new];
|
UILabel *phoneNumberLabel = [UILabel new];
|
||||||
phoneNumberLabel.font = [UIFont ows_mediumFontWithSize:16.f];
|
phoneNumberLabel.font = [UIFont ows_mediumFontWithSize:16.f];
|
||||||
phoneNumberLabel.textColor = [UIColor blackColor];
|
phoneNumberLabel.textColor = [UIColor blackColor];
|
||||||
phoneNumberLabel.text = NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"");
|
phoneNumberLabel.text
|
||||||
|
= NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"Label for the phone number textfield");
|
||||||
[phoneNumberRow addSubview:phoneNumberLabel];
|
[phoneNumberRow addSubview:phoneNumberLabel];
|
||||||
[phoneNumberLabel autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:20.f];
|
[phoneNumberLabel autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:20.f];
|
||||||
[phoneNumberLabel autoVCenterInSuperview];
|
[phoneNumberLabel autoVCenterInSuperview];
|
||||||
|
@ -125,7 +127,8 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
_phoneNumberTextField.font = [UIFont ows_mediumFontWithSize:16.f];
|
_phoneNumberTextField.font = [UIFont ows_mediumFontWithSize:16.f];
|
||||||
_phoneNumberTextField.textAlignment = NSTextAlignmentRight;
|
_phoneNumberTextField.textAlignment = NSTextAlignmentRight;
|
||||||
_phoneNumberTextField.textColor = [UIColor ows_signalBrandBlueColor];
|
_phoneNumberTextField.textColor = [UIColor ows_signalBrandBlueColor];
|
||||||
_phoneNumberTextField.placeholder = NSLocalizedString(@"REGISTRATION_ENTERNUMBER_DEFAULT_TEXT", @"");
|
_phoneNumberTextField.placeholder = NSLocalizedString(
|
||||||
|
@"REGISTRATION_ENTERNUMBER_DEFAULT_TEXT", @"Placeholder text for the phone number textfield");
|
||||||
_phoneNumberTextField.keyboardType = UIKeyboardTypeNumberPad;
|
_phoneNumberTextField.keyboardType = UIKeyboardTypeNumberPad;
|
||||||
_phoneNumberTextField.delegate = self;
|
_phoneNumberTextField.delegate = self;
|
||||||
[_phoneNumberTextField addTarget:self
|
[_phoneNumberTextField addTarget:self
|
||||||
|
@ -206,7 +209,7 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
[_countryCodeButton layoutSubviews];
|
[_countryCodeButton layoutSubviews];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setcallingCode:(NSString *)callingCode
|
- (void)setCallingCode:(NSString *)callingCode
|
||||||
{
|
{
|
||||||
_callingCode = callingCode;
|
_callingCode = callingCode;
|
||||||
|
|
||||||
|
@ -233,6 +236,7 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
- (void)tryToBlockPhoneNumber
|
- (void)tryToBlockPhoneNumber
|
||||||
{
|
{
|
||||||
if (![self hasValidPhoneNumber]) {
|
if (![self hasValidPhoneNumber]) {
|
||||||
|
OWSAssert(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,8 +252,7 @@ NSString * const kAddToBlockListViewControllerCellIdentifier = @"kAddToBlockList
|
||||||
message:[NSString
|
message:[NSString
|
||||||
stringWithFormat:NSLocalizedString(@"BLOCK_LIST_VIEW_BLOCKED_ALERT_MESSAGE_FORMAT",
|
stringWithFormat:NSLocalizedString(@"BLOCK_LIST_VIEW_BLOCKED_ALERT_MESSAGE_FORMAT",
|
||||||
@"The message format of the 'phone number blocked' alert in "
|
@"The message format of the 'phone number blocked' alert in "
|
||||||
@"the block view. It is populated with the blocked phone "
|
@"the block view. Embeds {{the blocked phone number}}."),
|
||||||
@"number."),
|
|
||||||
[parsedPhoneNumber toE164]]
|
[parsedPhoneNumber toE164]]
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
NSString * const kBlockListViewControllerCellIdentifier = @"kBlockListViewControllerCellIdentifier";
|
|
||||||
|
|
||||||
// TODO: We should label phone numbers with contact names where possible.
|
// TODO: We should label phone numbers with contact names where possible.
|
||||||
@interface BlockListViewController ()
|
@interface BlockListViewController ()
|
||||||
|
|
||||||
|
@ -42,10 +40,8 @@ typedef NS_ENUM(NSInteger, BlockListViewControllerSection) {
|
||||||
_blockingManager = [OWSBlockingManager sharedManager];
|
_blockingManager = [OWSBlockingManager sharedManager];
|
||||||
_blockedPhoneNumbers = [_blockingManager blockedPhoneNumbers];
|
_blockedPhoneNumbers = [_blockingManager blockedPhoneNumbers];
|
||||||
|
|
||||||
self.title = NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"");
|
self.title
|
||||||
|
= NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view");
|
||||||
[self.tableView registerClass:[UITableViewCell class]
|
|
||||||
forCellReuseIdentifier:kBlockListViewControllerCellIdentifier];
|
|
||||||
|
|
||||||
[self addNotificationListeners];
|
[self addNotificationListeners];
|
||||||
}
|
}
|
||||||
|
@ -102,7 +98,7 @@ typedef NS_ENUM(NSInteger, BlockListViewControllerSection) {
|
||||||
|
|
||||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
{
|
{
|
||||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kBlockListViewControllerCellIdentifier];
|
UITableViewCell *cell = [UITableViewCell new];
|
||||||
OWSAssert(cell);
|
OWSAssert(cell);
|
||||||
|
|
||||||
switch (indexPath.section) {
|
switch (indexPath.section) {
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#import "OWSTableViewController.h"
|
#import "OWSTableViewController.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class TSThread;
|
@class TSThread;
|
||||||
|
|
||||||
@interface DebugUITableViewController : OWSTableViewController
|
@interface DebugUITableViewController : OWSTableViewController
|
||||||
|
@ -12,3 +14,5 @@
|
||||||
fromViewController:(UIViewController *)fromViewController;
|
fromViewController:(UIViewController *)fromViewController;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class OWSTableItem;
|
@class OWSTableItem;
|
||||||
@class OWSTableSection;
|
@class OWSTableSection;
|
||||||
|
|
||||||
|
@ -19,10 +21,9 @@
|
||||||
|
|
||||||
@interface OWSTableSection : NSObject
|
@interface OWSTableSection : NSObject
|
||||||
|
|
||||||
@property (nonatomic) NSString *title;
|
@property (nonatomic, nullable) NSString *title;
|
||||||
|
|
||||||
+ (OWSTableSection *)sectionWithTitle:(NSString *)title
|
+ (OWSTableSection *)sectionWithTitle:(NSString *)title items:(NSArray<OWSTableItem *> *)items;
|
||||||
items:(NSArray *)items;
|
|
||||||
|
|
||||||
- (void)addItem:(OWSTableItem *)item;
|
- (void)addItem:(OWSTableItem *)item;
|
||||||
|
|
||||||
|
@ -54,3 +55,5 @@ typedef void (^OWSTableActionBlock)();
|
||||||
- (void)presentFromViewController:(UIViewController *)fromViewController;
|
- (void)presentFromViewController:(UIViewController *)fromViewController;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "OWSTableViewController.h"
|
#import "OWSTableViewController.h"
|
||||||
//#import "Environment.h"
|
|
||||||
//#import "Signal-Swift.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@ -18,14 +16,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@implementation OWSTableContents
|
@implementation OWSTableContents
|
||||||
|
|
||||||
-(instancetype)init {
|
- (instancetype)init
|
||||||
|
{
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_sections = [NSMutableArray new];
|
_sections = [NSMutableArray new];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addSection:(OWSTableSection *)section {
|
- (void)addSection:(OWSTableSection *)section
|
||||||
|
{
|
||||||
OWSAssert(section);
|
OWSAssert(section);
|
||||||
|
|
||||||
[_sections addObject:section];
|
[_sections addObject:section];
|
||||||
|
@ -45,28 +45,26 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@implementation OWSTableSection
|
@implementation OWSTableSection
|
||||||
|
|
||||||
+ (OWSTableSection *)sectionWithTitle:(NSString *)title
|
+ (OWSTableSection *)sectionWithTitle:(NSString *)title items:(NSArray<OWSTableItem *> *)items
|
||||||
items:(NSArray *)items {
|
{
|
||||||
OWSTableSection *section = [OWSTableSection new];
|
OWSTableSection *section = [OWSTableSection new];
|
||||||
section.title = title;
|
section.title = title;
|
||||||
section.items = [items mutableCopy];
|
section.items = [items mutableCopy];
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(instancetype)init {
|
- (instancetype)init
|
||||||
|
{
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_items = [NSMutableArray new];
|
_items = [NSMutableArray new];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addItem:(OWSTableItem *)item {
|
- (void)addItem:(OWSTableItem *)item
|
||||||
|
{
|
||||||
OWSAssert(item);
|
OWSAssert(item);
|
||||||
|
|
||||||
if (!_items) {
|
|
||||||
_items = [NSMutableArray new];
|
|
||||||
}
|
|
||||||
|
|
||||||
[_items addObject:item];
|
[_items addObject:item];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +75,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
@interface OWSTableItem ()
|
@interface OWSTableItem ()
|
||||||
|
|
||||||
@property (nonatomic) OWSTableItemType itemType;
|
@property (nonatomic) OWSTableItemType itemType;
|
||||||
@property (nonatomic) NSString *title;
|
@property (nonatomic, nullable) NSString *title;
|
||||||
@property (nonatomic) OWSTableActionBlock actionBlock;
|
@property (nonatomic, nullable) OWSTableActionBlock actionBlock;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -86,8 +84,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@implementation OWSTableItem
|
@implementation OWSTableItem
|
||||||
|
|
||||||
+ (OWSTableItem *)actionWithTitle:(NSString *)title
|
+ (OWSTableItem *)actionWithTitle:(NSString *)title actionBlock:(OWSTableActionBlock)actionBlock
|
||||||
actionBlock:(OWSTableActionBlock)actionBlock {
|
{
|
||||||
OWSAssert(title.length > 0);
|
OWSAssert(title.length > 0);
|
||||||
|
|
||||||
OWSTableItem *item = [OWSTableItem new];
|
OWSTableItem *item = [OWSTableItem new];
|
||||||
|
@ -105,7 +103,8 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||||
|
|
||||||
@implementation OWSTableViewController
|
@implementation OWSTableViewController
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad
|
||||||
|
{
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self.navigationController.navigationBar setTranslucent:NO];
|
[self.navigationController.navigationBar setTranslucent:NO];
|
||||||
}
|
}
|
||||||
|
@ -150,14 +149,16 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||||
|
|
||||||
#pragma mark - Table view data source
|
#pragma mark - Table view data source
|
||||||
|
|
||||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
||||||
|
{
|
||||||
OWSAssert(self.contents);
|
OWSAssert(self.contents);
|
||||||
|
|
||||||
OWSAssert(self.contents.sections.count > 0);
|
OWSAssert(self.contents.sections.count > 0);
|
||||||
return (NSInteger) self.contents.sections.count;
|
return (NSInteger) self.contents.sections.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)sectionIndex {
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)sectionIndex
|
||||||
|
{
|
||||||
OWSTableSection *section = [self sectionForIndex:sectionIndex];
|
OWSTableSection *section = [self sectionForIndex:sectionIndex];
|
||||||
OWSAssert(section.items.count > 0);
|
OWSAssert(section.items.count > 0);
|
||||||
return (NSInteger) section.items.count;
|
return (NSInteger) section.items.count;
|
||||||
|
@ -180,7 +181,8 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
{
|
||||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||||
|
|
||||||
OWSTableItem *item = [self itemForIndexPath:indexPath];
|
OWSTableItem *item = [self itemForIndexPath:indexPath];
|
||||||
|
@ -204,7 +206,8 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||||
|
|
||||||
#pragma mark - Presentation
|
#pragma mark - Presentation
|
||||||
|
|
||||||
- (void)presentFromViewController:(UIViewController *)fromViewController {
|
- (void)presentFromViewController:(UIViewController *)fromViewController
|
||||||
|
{
|
||||||
OWSAssert(fromViewController);
|
OWSAssert(fromViewController);
|
||||||
|
|
||||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self];
|
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self];
|
||||||
|
@ -217,7 +220,8 @@ NSString * const kOWSTableCellIdentifier = @"kOWSTableCellIdentifier";
|
||||||
completion:nil];
|
completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)donePressed:(id)sender {
|
- (void)donePressed:(id)sender
|
||||||
|
{
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,14 @@ static NSString *const kCodeSentSegue = @"codeSent";
|
||||||
[[Environment getCurrent] setSignUpFlowNavigationController:self.navigationController];
|
[[Environment getCurrent] setSignUpFlowNavigationController:self.navigationController];
|
||||||
|
|
||||||
_titleLabel.text = NSLocalizedString(@"REGISTRATION_TITLE_LABEL", @"");
|
_titleLabel.text = NSLocalizedString(@"REGISTRATION_TITLE_LABEL", @"");
|
||||||
[_countryNameButton setTitle:NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"")
|
[_countryNameButton
|
||||||
forState:UIControlStateNormal];
|
setTitle:NSLocalizedString(@"REGISTRATION_DEFAULT_COUNTRY_NAME", @"Label for the country code field")
|
||||||
_phoneNumberTextField.placeholder = NSLocalizedString(@"REGISTRATION_ENTERNUMBER_DEFAULT_TEXT", @"");
|
forState:UIControlStateNormal];
|
||||||
[_phoneNumberButton setTitle:NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"")
|
_phoneNumberTextField.placeholder = NSLocalizedString(
|
||||||
forState:UIControlStateNormal];
|
@"REGISTRATION_ENTERNUMBER_DEFAULT_TEXT", @"Placeholder text for the phone number textfield");
|
||||||
|
[_phoneNumberButton
|
||||||
|
setTitle:NSLocalizedString(@"REGISTRATION_PHONENUMBER_BUTTON", @"Label for the phone number textfield")
|
||||||
|
forState:UIControlStateNormal];
|
||||||
[_phoneNumberButton.titleLabel setAdjustsFontSizeToFitWidth:YES];
|
[_phoneNumberButton.titleLabel setAdjustsFontSizeToFitWidth:YES];
|
||||||
[_sendCodeButton setTitle:NSLocalizedString(@"REGISTRATION_VERIFY_DEVICE", @"") forState:UIControlStateNormal];
|
[_sendCodeButton setTitle:NSLocalizedString(@"REGISTRATION_VERIFY_DEVICE", @"") forState:UIControlStateNormal];
|
||||||
[_existingUserButton setTitle:NSLocalizedString(@"ALREADY_HAVE_ACCOUNT_BUTTON", @"registration button text")
|
[_existingUserButton setTitle:NSLocalizedString(@"ALREADY_HAVE_ACCOUNT_BUTTON", @"registration button text")
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
//
|
//
|
||||||
// SettingsTableViewController.h
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||||||
// Signal
|
|
||||||
//
|
|
||||||
// Created by Dylan Bourgeois on 03/11/14.
|
|
||||||
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
@ -19,7 +15,7 @@
|
||||||
@property (strong, nonatomic) IBOutlet UILabel *linkedDevicesLabel;
|
@property (strong, nonatomic) IBOutlet UILabel *linkedDevicesLabel;
|
||||||
@property (strong, nonatomic) IBOutlet UILabel *advancedLabel;
|
@property (strong, nonatomic) IBOutlet UILabel *advancedLabel;
|
||||||
@property (strong, nonatomic) IBOutlet UILabel *aboutLabel;
|
@property (strong, nonatomic) IBOutlet UILabel *aboutLabel;
|
||||||
@property (strong, nonatomic) IBOutlet UILabel *blocklistLabel;
|
@property (strong, nonatomic) IBOutlet UILabel *blockListLabel;
|
||||||
@property (strong, nonatomic) IBOutlet UILabel *inviteLabel;
|
@property (strong, nonatomic) IBOutlet UILabel *inviteLabel;
|
||||||
@property (strong, nonatomic) IBOutlet UIButton *destroyAccountButton;
|
@property (strong, nonatomic) IBOutlet UIButton *destroyAccountButton;
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,8 @@ typedef enum {
|
||||||
self.linkedDevicesLabel.text
|
self.linkedDevicesLabel.text
|
||||||
= NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager");
|
= NSLocalizedString(@"LINKED_DEVICES_TITLE", @"Menu item and navbar title for the device manager");
|
||||||
self.inviteLabel.text = NSLocalizedString(@"SETTINGS_INVITE_TITLE", @"Settings table view cell label");
|
self.inviteLabel.text = NSLocalizedString(@"SETTINGS_INVITE_TITLE", @"Settings table view cell label");
|
||||||
self.blocklistLabel.text = NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list row of the settings view");
|
self.blockListLabel.text
|
||||||
|
= NSLocalizedString(@"SETTINGS_BLOCK_LIST_TITLE", @"Label for the block list section of the settings view");
|
||||||
|
|
||||||
[self.destroyAccountButton setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"")
|
[self.destroyAccountButton setTitle:NSLocalizedString(@"SETTINGS_DELETE_ACCOUNT_BUTTON", @"")
|
||||||
forState:UIControlStateNormal];
|
forState:UIControlStateNormal];
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
|
|
||||||
- (instancetype)init NS_UNAVAILABLE;
|
- (instancetype)init NS_UNAVAILABLE;
|
||||||
|
|
||||||
// This convenience function can be used to reformat a phone number
|
// This convenience function can be used to reformat the contents of
|
||||||
// text field as the types, pastes, etc.
|
// a phone number text field as the user modifies its text by typing,
|
||||||
|
// pasting, etc.
|
||||||
+ (void)phoneNumberTextField:(UITextField *)textField
|
+ (void)phoneNumberTextField:(UITextField *)textField
|
||||||
shouldChangeCharactersInRange:(NSRange)range
|
shouldChangeCharactersInRange:(NSRange)range
|
||||||
replacementString:(NSString *)insertionText
|
replacementString:(NSString *)insertionText
|
||||||
|
|
Loading…
Reference in a new issue