Posts

Post not yet marked as solved
2 Replies
272 Views
Ever since I've updated to Xcode 15.2 (I'm currently using Xcode 15.3) my console gets flooded with logs from CFNetwork and DataDetectorsUI. I've never seen those logs before. Is there a way to suppress them? I can't even find my own logs anymore without filters. CFNetwork Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> resuming, timeouts(25.0, 604800.0) QOS(0x15) Voucher (null) [Telemetry]: Activity <nw_activity 12:2[78557FD1-54F3-4B77-8C5C-57F500D67286] (reporting strategy default)> on Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> was not selected for reporting Connection 29: set is idle false Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> now using Connection 29 Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> sent request, body S 535 Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> received response, status 201 content U Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> done using Connection 29 Connection 29: set is idle true HTTP/2 Connection 29 Stream 7 ended successfully true Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> request *** is NOT allowed to set HSTS for main doc (null) Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> response ended Task <50C80E0E-9DA5-428F-A473-9D0228088022>.<4> finished successfully Connection 19: cleaning up Connection 19: done Applying proxy auth: response=(null), proxyURL=(null), request=(null), credentials=(null), handle=0x11c2f7d30 Connection 21: cleaning up Connection 23: cleaning up Connection 22: cleaning up DataDetectorsUI operation 0x10ff7e560 operation 0x10ff7e560 is discarded Calling the completion block for 0x10ff7e560 dispatchScanQueryCreationWithCompletionBlock of operation <DDTextKitOperation: 0x10ff7e560> completion block: success: 0 operation 0x10ff7e560 operation 0x10ff7e560 operation 0x10fb2f850 really creating scan query in operation 0x10fb2f850! operation 0x10fb2f850
Posted Last updated
.
Post not yet marked as solved
1 Replies
567 Views
It seems like a WKWebView doesn't handle 421 responses automatically. What basically happened is the following: The client requests a page at foo.example.com During TLS negotiation, the server presents a certificate which is valid for both foo.example.com and bar.example.com (and the client accepts it). This could be done with a wildcard certificate or a SAN certificate. The client reuses the connection to make a request for bar.example.com. The server is unable or unwilling to support cross-domain connection reuse and serves HTTP 421. The client does not automatically retry with a new connection. According to the RFC7540 section 9.1.2 we MAY retry the request manually with a new TCP connection. The iOS' Safari browser and all web browsers handled this correctly by retrying the request. Isn't the webview also supposed to handle this automatically? @eskimo
Posted Last updated
.
Post not yet marked as solved
3 Replies
528 Views
If I put the code for my UIBezierPath inside the draw(_ rect:) function I get these strange very thin black corners around the view and the tail. When dragging the view (e.g. within a presented view controller) these thin lines also start flickering. I assume it's a weird rendering bug. Does anyone know if there is a way to fix this? To test this, just put the following view inside a view controller class RenderingView: UIView { &#9;&#9;lazy var backgroundView: UIView = { &#9;&#9;&#9;&#9;let view = UIView() &#9;&#9;&#9;&#9;view.layer.cornerRadius = 8 &#9;&#9;&#9;&#9;view.translatesAutoresizingMaskIntoConstraints = false &#9;&#9;&#9;&#9;return view &#9;&#9;}() &#9;&#9;private lazy var shadowView: UIView = { &#9;&#9;&#9;&#9;let view = UIView() &#9;&#9;&#9;&#9;view.translatesAutoresizingMaskIntoConstraints = false &#9;&#9;&#9;&#9;return view &#9;&#9;}() &#9;&#9;private lazy var textLabel: UILabel = { &#9;&#9;&#9;&#9;let label = UILabel() &#9;&#9;&#9;&#9;label.numberOfLines = 0 &#9;&#9;&#9;&#9;label.textAlignment = .center &#9;&#9;&#9;&#9;label.translatesAutoresizingMaskIntoConstraints = false &#9;&#9;&#9;&#9;label.text = "Rendering Bug" &#9;&#9;&#9;&#9;return label &#9;&#9;}() &#9;&#9;override init(frame: CGRect) { &#9;&#9;&#9;&#9;super.init(frame: frame) &#9;&#9;&#9;&#9;setup() &#9;&#9;} &#9;&#9;required init?(coder: NSCoder) { &#9;&#9;&#9;&#9;fatalError("init(coder:) has not been implemented") &#9;&#9;} &#9;&#9;private func setup() { &#9;&#9;&#9;&#9;backgroundColor = .clear &#9;&#9;&#9;&#9;backgroundView.backgroundColor = .yellow &#9;&#9;&#9;&#9;layer.borderWidth = 0 &#9;&#9;&#9;&#9;setupLayout() &#9;&#9;} &#9;&#9;private func setupLayout() { &#9;&#9;&#9;&#9;[shadowView, backgroundView, textLabel].forEach(addSubview) &#9;&#9;&#9;&#9;backgroundView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true &#9;&#9;&#9;&#9;backgroundView.topAnchor.constraint(equalTo: topAnchor).isActive = true &#9;&#9;&#9;&#9;backgroundView.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true &#9;&#9;&#9;&#9;backgroundView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true &#9;&#9;&#9;&#9;shadowView.leadingAnchor.constraint(equalTo: backgroundView.leadingAnchor).isActive = true &#9;&#9;&#9;&#9;shadowView.topAnchor.constraint(equalTo: backgroundView.topAnchor).isActive = true &#9;&#9;&#9;&#9;shadowView.trailingAnchor.constraint(equalTo: backgroundView.trailingAnchor).isActive = true &#9;&#9;&#9;&#9;shadowView.bottomAnchor.constraint(equalTo: backgroundView.bottomAnchor).isActive = true &#9;&#9;&#9;&#9;textLabel.leadingAnchor.constraint(equalTo: backgroundView.leadingAnchor, constant: 10).isActive = true &#9;&#9;&#9;&#9;textLabel.trailingAnchor.constraint(equalTo: backgroundView.trailingAnchor, constant: -10).isActive = true &#9;&#9;&#9;&#9;textLabel.topAnchor.constraint(equalTo: backgroundView.topAnchor, constant: 10).isActive = true &#9;&#9;&#9;&#9;textLabel.bottomAnchor.constraint(equalTo: backgroundView.bottomAnchor, constant: -10).isActive = true &#9;&#9;} &#9;&#9;override func draw(_ rect: CGRect) { &#9;&#9;&#9;&#9;shapeBackground() &#9;&#9;} &#9;&#9;private func shapeBackground() { &#9;&#9;&#9;&#9;let tailLayer = CAShapeLayer() &#9;&#9;&#9;&#9;let bezierPath = UIBezierPath(roundedRect: CGRect(x: backgroundView.bounds.minX, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;y: backgroundView.bounds.minY, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;width: backgroundView.bounds.width, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;height: backgroundView.bounds.height - 12), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;cornerRadius: 8) &#9;&#9;&#9;&#9;let shadowBezierPath = UIBezierPath(roundedRect: CGRect(x: backgroundView.bounds.minX + 5, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;y: backgroundView.bounds.minY + 10, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;width: backgroundView.bounds.width - 10, &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;height: backgroundView.bounds.height - 12 - 10), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;cornerRadius: 8) &#9;&#9;&#9;&#9;[bezierPath, shadowBezierPath].forEach { &#9;&#9;&#9;&#9;&#9;&#9;$0.move(to: CGPoint(x: backgroundView.bounds.midX - 12, y: backgroundView.bounds.maxY - 12)) &#9;&#9;&#9;&#9;&#9;&#9;$0.addLine(to: CGPoint(x: backgroundView.bounds.midX, y: backgroundView.bounds.maxY)) &#9;&#9;&#9;&#9;&#9;&#9;$0.addLine(to: CGPoint(x: backgroundView.bounds.midX + 12, y: backgroundView.bounds.maxY - 12)) &#9;&#9;&#9;&#9;&#9;&#9;$0.fill() &#9;&#9;&#9;&#9;&#9;&#9;$0.close() &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;tailLayer.path = bezierPath.cgPath &#9;&#9;&#9;&#9;tailLayer.fillColor = UIColor.white.cgColor &#9;&#9;&#9;&#9;shadowView.layer.shadowPath = shadowBezierPath.cgPath &#9;&#9;&#9;&#9;shadowView.layer.cornerRadius = 8 &#9;&#9;&#9;&#9;backgroundView.layer.masksToBounds = true &#9;&#9;&#9;&#9;backgroundView.layer.mask = tailLayer &#9;&#9;} }
Posted Last updated
.