<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
| <!-- http://www.brucelawson.co.uk/2010/a-minimal-html5-document/ --> | |
| <!doctype html> | |
| <html lang=en> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blah</title> | |
| </head> | |
| <body> | |
| <p>I'm the content</p> |
| // Taken from http://PSPDFKit.com. This snippet is under public domain. | |
| #define UIKitVersionNumber_iOS_7_0 0xB57 | |
| BOOL PSPDFIsUIKitFlatMode(void) { | |
| static BOOL isUIKitFlatMode = NO; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| // We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7. | |
| if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) { | |
| isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0; | |
| } |
| NSURLConnection | NSURLSession | |
| ------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
| NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
| ------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
| NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| | N |
| #pragma mark - NSFetchedResultsControllerDelegate methods | |
| - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller { | |
| [self.tableView beginUpdates]; | |
| } | |
| - (void)controller:(NSFetchedResultsController *)controller | |
| didChangeObject:(id)anObject | |
| atIndexPath:(NSIndexPath *)indexPath | |
| forChangeType:(NSFetchedResultsChangeType)type |
| /** | |
| * K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex") | |
| * | |
| * More language ports, as well as legacy 2014 OpenSimplex, can be found here: | |
| * https://github.com/KdotJPG/OpenSimplex2 | |
| */ | |
| public class OpenSimplex2S { | |
| private static final long PRIME_X = 0x5205402B9270C86FL; |
| # Set the build number to the current git commit count. | |
| # | |
| # Permanent home: | |
| # https://gist.github.com/jaredsinclair/af6898f93674ee5923f3 | |
| # | |
| # Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/ | |
| # Updated with dSYM handling from http://yellowfeather.co.uk/blog/auto-incrementing-build-number-in-xcode-revisited/ | |
| git=`sh /etc/profile; which git` | |
| appBuild=`"$git" rev-list HEAD --count` |
| import UIKit | |
| import Foundation | |
| class ViewController: UIViewController, NSURLSessionDelegate { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| httpGet(NSMutableURLRequest(URL: NSURL(string: "https://example.com")!)) | |
| } |
| // Very slightly adapted from http://stackoverflow.com/a/30141700/106244 | |
| // 99.99% Credit to Martin R! | |
| // Mapping from XML/HTML character entity reference to character | |
| // From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references | |
| private let characterEntities : [String: Character] = [ | |
| // XML predefined entities: | |
| """ : "\"", | |
| "&" : "&", |