From 5cdb04fe0ebe908285b1ae730cb69dbf6a011a44 Mon Sep 17 00:00:00 2001 From: Madison Solarana Date: Tue, 28 Sep 2021 19:07:59 -0500 Subject: [PATCH] pedantic update --- SLRDNSConfigurator/SLRDNSConfigurator.h | 4 ++++ SLRDNSConfigurator/SLRDNSConfigurator.m | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/SLRDNSConfigurator/SLRDNSConfigurator.h b/SLRDNSConfigurator/SLRDNSConfigurator.h index 22e3723..529950d 100644 --- a/SLRDNSConfigurator/SLRDNSConfigurator.h +++ b/SLRDNSConfigurator/SLRDNSConfigurator.h @@ -289,6 +289,10 @@ typedef NS_ENUM(NSUInteger, SLRDoTProvider) { */ @interface SLRDNSConfigurator : NSObject +- (instancetype)init NS_UNAVAILABLE; + ++ (instancetype)new NS_UNAVAILABLE; + /** * Configures the default @c nw_privacy_context with the specified DNS over HTTPS provider. * @param provider The DNS over HTTPS provider to use. diff --git a/SLRDNSConfigurator/SLRDNSConfigurator.m b/SLRDNSConfigurator/SLRDNSConfigurator.m index 83fd3f1..cb1aee3 100644 --- a/SLRDNSConfigurator/SLRDNSConfigurator.m +++ b/SLRDNSConfigurator/SLRDNSConfigurator.m @@ -35,6 +35,18 @@ @implementation SLRDNSConfigurator +#pragma mark - Object Life Cycle + +- (instancetype)init __attribute__((noreturn)) +{ + @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"-init is not available on SLRDNSConfigurator" userInfo:nil]; +} + ++ (instancetype)new __attribute__((noreturn)) +{ + @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"+new is not available on SLRDNSConfigurator" userInfo:nil]; +} + #pragma mark - Public API + (void)configureDefaultNetworkContextWithDoHProvider:(SLRDoHProvider)provider