diff options
author | Vitaly Takmazov | 2020-12-30 07:58:06 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-12-30 07:58:06 +0300 |
commit | 3d0d75fd56fe5823468318129de4da55e4b27b25 (patch) | |
tree | 9a489ee5fa19794d6a0f450039ebec639fbad657 | |
parent | 339c1aec15b65d40a29e14f0255ca64806fbb172 (diff) |
Drop unused library
-rw-r--r-- | Juick.xcodeproj/project.pbxproj | 6 | ||||
-rw-r--r-- | Juick/Helpers/NSURL+PathParameters.h | 37 | ||||
-rw-r--r-- | Juick/Helpers/NSURL+PathParameters.m | 167 | ||||
-rw-r--r-- | Juick/ViewControllers/MessagesViewController.m | 3 |
4 files changed, 0 insertions, 213 deletions
diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index bcf5641..715bb22 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -55,7 +55,6 @@ 77C364922243FAEF0017522C /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 77C364912243FAEF0017522C /* Colors.xcassets */; }; 77C36495224417E90017522C /* DiscoverViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C36494224417E90017522C /* DiscoverViewController.m */; }; 77C36498224417FC0017522C /* DiscussionsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C36497224417FC0017522C /* DiscussionsController.m */; }; - 77C67EE51828342000427098 /* NSURL+PathParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C67EE41828342000427098 /* NSURL+PathParameters.m */; }; 77C67EEC18283F2D00427098 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77C67EEB18283F2D00427098 /* QuartzCore.framework */; }; 77C6ADDE1F770EB2000AEA8C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77C6ADDD1F770EB2000AEA8C /* Main.storyboard */; }; 77C6ADE41F7717BC000AEA8C /* ThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C6ADE31F7717BC000AEA8C /* ThreadViewController.m */; }; @@ -174,8 +173,6 @@ 77C36494224417E90017522C /* DiscoverViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DiscoverViewController.m; sourceTree = "<group>"; }; 77C36496224417FC0017522C /* DiscussionsController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DiscussionsController.h; sourceTree = "<group>"; }; 77C36497224417FC0017522C /* DiscussionsController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DiscussionsController.m; sourceTree = "<group>"; }; - 77C67EE31828342000427098 /* NSURL+PathParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+PathParameters.h"; sourceTree = "<group>"; }; - 77C67EE41828342000427098 /* NSURL+PathParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+PathParameters.m"; sourceTree = "<group>"; }; 77C67EEB18283F2D00427098 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 77C6ADDD1F770EB2000AEA8C /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; }; 77C6ADE21F7717BC000AEA8C /* ThreadViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThreadViewController.h; sourceTree = "<group>"; }; @@ -354,8 +351,6 @@ 774DD4601D735E1D00C7F290 /* Helpers */ = { isa = PBXGroup; children = ( - 77C67EE31828342000427098 /* NSURL+PathParameters.h */, - 77C67EE41828342000427098 /* NSURL+PathParameters.m */, 77B09992189D0B9900A84F59 /* UIImage+Utils.h */, 77B09993189D0B9900A84F59 /* UIImage+Utils.m */, 7785605E2343D24E00BB37A2 /* NSData+Hex.h */, @@ -548,7 +543,6 @@ 77975A1D182B6E9A00410C2B /* NewPostViewController.m in Sources */, 774746AD239F82A10001C7F9 /* NSDate+TimeAgo.m in Sources */, 77C36495224417E90017522C /* DiscoverViewController.m in Sources */, - 77C67EE51828342000427098 /* NSURL+PathParameters.m in Sources */, 77E35A82189A5B5A00B2D216 /* LoginViewController.m in Sources */, 773E6397204BCB64008B8F8D /* ConversationCell.m in Sources */, 778560602343D24E00BB37A2 /* NSData+Hex.m in Sources */, diff --git a/Juick/Helpers/NSURL+PathParameters.h b/Juick/Helpers/NSURL+PathParameters.h deleted file mode 100644 index 73fc004..0000000 --- a/Juick/Helpers/NSURL+PathParameters.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// NSURL+PathParameters.h -// -// Created by Johan Kool on 27/9/2011. -// Copyright 2011 Koolistov Pte. Ltd. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// * Neither the name of KOOLISTOV PTE. LTD. nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - - -#import <Foundation/Foundation.h> - -@interface NSURL (PathParameters) - -- (NSURL *)URLByReplacingPathWithPath:(NSString *)path; -- (NSURL *)URLByAppendingPathWithRelativePath:(NSString *)path; -- (NSURL *)URLByAppendingParameters:(NSDictionary *)parameters; -- (NSURL *)URLByAppendingParameterName:(NSString *)parameter value:(id)value; - -@end diff --git a/Juick/Helpers/NSURL+PathParameters.m b/Juick/Helpers/NSURL+PathParameters.m deleted file mode 100644 index 6752757..0000000 --- a/Juick/Helpers/NSURL+PathParameters.m +++ /dev/null @@ -1,167 +0,0 @@ -// -// NSURL+PathParameters.m -// -// Created by Johan Kool on 27/9/2011. -// Copyright 2011 Koolistov Pte. Ltd. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// * Neither the name of KOOLISTOV PTE. LTD. nor the names of its contributors may be used to -// endorse or promote products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// - -#import "NSURL+PathParameters.h" - -@interface NSString (URLParameters) - -- (NSString *)stringByEscapingForURLArgument; - -@end - -@implementation NSString (URLParameters) - -- (NSString *)stringByEscapingForURLArgument { - return [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"!*'\"();:@&=+$,/?%#[] "]]; -} - -@end - -@implementation NSURL (PathParameters) - -- (NSURL *)URLByReplacingPathWithPath:(NSString *)path { - // scheme://username:password@domain:port/path?query_string#fragment_id - - // Chop off path, query and fragment from absoluteString, then add new path and put back query and fragment - - NSString *absoluteString = [self absoluteString]; - NSUInteger endIndex = [absoluteString length]; - - NSString *fragment = [self fragment]; - if (fragment) { - endIndex -= [fragment length]; - endIndex--; // The # character - } - - NSString *query = [self query]; - if (query) { - endIndex -= [query length]; - endIndex--; // The ? character - } - - // Check if the last character of the path is a slash (range must be valid as endIndex must be smaller or equal to length) - BOOL trailingSlashOnPath = [[absoluteString substringWithRange:NSMakeRange(endIndex - 1, 1)] isEqualToString:@"/"]; - - NSString *originalPath = [self path]; // This method strips any trailing slash "/" - if (originalPath) { - endIndex -= [originalPath length]; - if (trailingSlashOnPath && [originalPath length] > 1) { // Don't get confused with the starting slash - endIndex--; - } - } - - absoluteString = [absoluteString substringToIndex:endIndex]; - absoluteString = [absoluteString stringByAppendingString:path]; - if (query) { - absoluteString = [absoluteString stringByAppendingString:@"?"]; - absoluteString = [absoluteString stringByAppendingString:query]; - } - if (fragment) { - absoluteString = [absoluteString stringByAppendingString:@"#"]; - absoluteString = [absoluteString stringByAppendingString:fragment]; - } - - return [NSURL URLWithString:absoluteString]; -} - -- (NSURL *)URLByAppendingPathWithRelativePath:(NSString *)path { - NSString *originalPath = [self path]; - NSString *combinedPath = [[originalPath stringByAppendingPathComponent:path] stringByStandardizingPath]; - // Don't standardize away a trailing slash - if ([path length] > 1 && [path hasSuffix:@"/"]) { - combinedPath = [combinedPath stringByAppendingString:@"/"]; - } - return [self URLByReplacingPathWithPath:combinedPath]; -} - -- (NSURL *)URLByAppendingParameters:(NSDictionary *)parameters { - NSMutableString *query = [[self query] mutableCopy]; - - if (!query) { - query = [NSMutableString stringWithString:@""]; - } - - // Sort parameters to be appended so that our solution is stable (and testable) - NSArray *parameterNames = [parameters allKeys]; - parameterNames = [parameterNames sortedArrayUsingSelector:@selector(compare:)]; - - for (NSString *parameterName in parameterNames) { - id value = [parameters objectForKey:parameterName]; - NSAssert3([parameterName isKindOfClass:[NSString class]], @"Got '%@' of type %@ as key for parameter with value '%@'. Expected an NSString.", parameterName, NSStringFromClass([parameterName class]), value); - - // The value needs to be an NSString, or be able to give us an NSString - if (![value isKindOfClass:[NSString class]]) { - if ([value respondsToSelector:@selector(stringValue)]) { - value = [value stringValue]; - } else { - // Fallback to simply giving the description - value = [value description]; - } - } - - if ([query length] == 0) { - [query appendFormat:@"%@=%@", [parameterName stringByEscapingForURLArgument], [value stringByEscapingForURLArgument]]; - } else { - [query appendFormat:@"&%@=%@", [parameterName stringByEscapingForURLArgument], [value stringByEscapingForURLArgument]]; - } - } - - // scheme://username:password@domain:port/path?query_string#fragment_id - - // Chop off query and fragment from absoluteString, then add new query and put back fragment - - NSString *absoluteString = [self absoluteString]; - NSUInteger endIndex = [absoluteString length]; - - NSString *fragment = [self fragment]; - if (fragment) { - endIndex -= [fragment length]; - endIndex--; // The # character - } - - NSString *originalQuery = [self query]; - if (originalQuery) { - endIndex -= [originalQuery length]; - endIndex--; // The ? character - } - - absoluteString = [absoluteString substringToIndex:endIndex]; - absoluteString = [absoluteString stringByAppendingString:@"?"]; - absoluteString = [absoluteString stringByAppendingString:query]; - if (fragment) { - absoluteString = [absoluteString stringByAppendingString:@"#"]; - absoluteString = [absoluteString stringByAppendingString:fragment]; - } - - return [NSURL URLWithString:absoluteString]; -} - -- (NSURL *)URLByAppendingParameterName:(NSString *)parameter value:(id)value { - return [self URLByAppendingParameters:[NSDictionary dictionaryWithObjectsAndKeys:value, parameter, nil]]; -} - - -@end diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index d25f438..e58baae 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -16,9 +16,6 @@ #import "ThreadViewController.h" #import "BlogViewController.h" - -#import "NSURL+PathParameters.h" - NSString* const messageCellIdentifier = @"messageCell"; @implementation MessagesViewController |