Swift Playground All In One
阅读原文时间:2023年07月09日阅读:1

Swift Playground All In One

Swift 5.3

  1. Playgrounds in Xcode

Xcode 11.5

https://developer.apple.com/videos/play/wwdc2018/402/

  1. Learn to Code with Swift Playgrounds

https://developer.apple.com/swift-playgrounds/

http://appstore.com/swiftplaygrounds

https://apps.apple.com/app/id1496833156

WkWebView

//: A UIKit based Playground for presenting user interface

import PlaygroundSupport

import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
  var webView: WKWebView!
  override func viewDidLoad() {
    super.viewDidLoad()
    let myURL = URL(string:"https://www.apple.com")
    let myRequest = URLRequest(url: myURL!)
    webView.load(myRequest)
  }
  override func loadView() {
    let webConfiguration = WKWebViewConfiguration()
    webView = WKWebView(frame: .zero, configuration: webConfiguration)
    webView.uiDelegate = self
    view = webView
  }
}
// Present the view controller in the Live View window
PlaygroundPage.current.liveView = ViewController()

//: A UIKit based Playground for presenting user interface

import UIKit
import PlaygroundSupport

class MyViewController : UIViewController {
    override func loadView() {
        let view = UIView()
        view.backgroundColor = .white

        let label = UILabel()
        label.frame = CGRect(x: 150, y: 200, width: 200, height: 20)
        label.text = "Hello World!"
        label.textColor = .black

        view.addSubview(label)
        self.view = view
    }
}
// Present the view controller in the Live View window
PlaygroundPage.current.liveView = MyViewController()

iOS WebView All In One

https://www.cnblogs.com/xgqfrms/p/13883680.html



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章