git-subtree-dir: server git-subtree-mainline:6a4054c15agit-subtree-split:800090542d
29 lines
674 B
Objective-C
29 lines
674 B
Objective-C
//
|
|
// MBIMURLUtilities.m
|
|
// kordophoned
|
|
//
|
|
// Created by James Magahern on 1/17/23.
|
|
// Copyright © 2023 James Magahern. All rights reserved.
|
|
//
|
|
|
|
#import "MBIMURLUtilities.h"
|
|
|
|
@implementation NSURL (MBIMURLUtilities)
|
|
|
|
- (nullable NSString *)valueForQueryItemWithName:(NSString *)queryItemName
|
|
{
|
|
NSURLComponents *urlComponents = [NSURLComponents componentsWithURL:self resolvingAgainstBaseURL:NO];
|
|
|
|
NSString *value = nil;
|
|
for (NSURLQueryItem *queryItem in [urlComponents queryItems]) {
|
|
if ([[queryItem name] isEqualToString:queryItemName]) {
|
|
value = [queryItem value];
|
|
break;
|
|
}
|
|
}
|
|
|
|
return value;
|
|
}
|
|
|
|
@end
|