mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.5 KiB
Objective-C
45 lines
1.5 KiB
Objective-C
//
|
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import "PhoneNumber.h"
|
|
#import <libPhoneNumber_iOS/NBPhoneNumberUtil.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface PhoneNumberUtil : NSObject
|
|
|
|
@property (nonatomic, retain) NBPhoneNumberUtil *nbPhoneNumberUtil;
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
+ (instancetype)sharedThreadLocal;
|
|
|
|
+ (BOOL)name:(NSString *)nameString matchesQuery:(NSString *)queryString;
|
|
|
|
+ (NSString *)callingCodeFromCountryCode:(NSString *)countryCode;
|
|
+ (nullable NSString *)countryNameFromCountryCode:(NSString *)countryCode;
|
|
+ (NSArray *)countryCodesForSearchTerm:(nullable NSString *)searchTerm;
|
|
|
|
// Returns a list of country codes for a calling code in descending
|
|
// order of population.
|
|
- (NSArray<NSString *> *)countryCodesFromCallingCode:(NSString *)callingCode;
|
|
// Returns the most likely country code for a calling code based on population.
|
|
- (NSString *)probableCountryCodeForCallingCode:(NSString *)callingCode;
|
|
|
|
+ (NSUInteger)translateCursorPosition:(NSUInteger)offset
|
|
from:(NSString *)source
|
|
to:(NSString *)target
|
|
stickingRightward:(bool)preferHigh;
|
|
|
|
+ (NSString *)examplePhoneNumberForCountryCode:(NSString *)countryCode;
|
|
|
|
- (nullable NBPhoneNumber *)parse:(NSString *)numberToParse defaultRegion:(NSString *)defaultRegion error:(NSError **)error;
|
|
- (NSString *)format:(NBPhoneNumber *)phoneNumber
|
|
numberFormat:(NBEPhoneNumberFormat)numberFormat
|
|
error:(NSError **)error;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|