我是Xcode的新手.有人可以帮我实现加载微调器吗?
1)我需要从网页开始到网页加载结束运行加载微调器
2)另外,我需要在网站/互联网关闭的情况下显示错误提醒
import UIKit
import WebKit
class WebView : WKWebView {
/**
Initialize the WKWebView.
*/
init(){
let webConfig:WKWebViewConfiguration = WKWebViewConfiguration()
super.init(frame:CGRectZero,configuration:webConfig)
self.translatesAutoresizingMaskIntoConstraints = false
self.allowsBackForwardNavigationGestures = true
createHomePage()
}
/**
Set the position for the WKWebView.
*/
func setPosition(view: UIView) {
self.translatesAutoresizingMaskIntoConstraints = false;
let height = NSLayoutConstraint(item: self, attribute: .Height, relatedBy: .Equal, toItem: view, attribute: .Height, multiplier: 1, constant: +0)
let width = NSLayoutConstraint(item: self, attribute: .Width, relatedBy: .Equal, toItem: view, attribute: .Width, multiplier: 1, constant: 0) …Run Code Online (Sandbox Code Playgroud) class Calculator[A:Numeric]{
var x:A = _;
def sum() : A = x+x; //error:
}
Run Code Online (Sandbox Code Playgroud)
编译器错误: