Swift 4 - Создайте CustomWindow
в вашем AppDelegate.swift
, который просматривает ваши раскадровки, который регистрирует касания, но не отменяет их. Код:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate{
var topWindow: CustomWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
topWindow = CustomWindow(frame: UIScreen.main.bounds)
topWindow?.rootViewController = UIViewController()
topWindow?.windowLevel = UIWindowLevelNormal + 1
topWindow?.isHidden = false
}
Создайте класс CustomWindow.swift, который получает ваши действия и обрабатывает их. Код:
import UIKit
class CustomWindow: UIWindow{
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
// What you want to do in here.
return false
}
Ваш HTTP-клиент отключен.
У этого может быть несколько причин:
Вы можете довольно легко эмулировать поведение:
URL url = new URL("http://example.com/path/to/the/file");
int numberOfBytesToRead = 200;
byte[] buffer = new byte[numberOfBytesToRead];
int numberOfBytesRead = url.openStream().read(buffer);