Swift Playground All In One
2024-09-03 09:04:40
Swift Playground All In One
Swift 5.3
- Playgrounds in Xcode
Xcode 11.5
https://developer.apple.com/videos/play/wwdc2018/402/
- Learn to Code with Swift Playgrounds
https://developer.apple.com/swift-playgrounds/
Swift Playgrounds for iPad
http://appstore.com/swiftplaygrounds
Swift Playgrounds for Mac
https://apps.apple.com/app/id1496833156
demo
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()
refs
iOS WebView All In One
https://www.cnblogs.com/xgqfrms/p/13883680.html
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
最新文章
- [Web开发] 在HTML代码里面如何判断IE版本
- mongodb的查询语句学习摘要
- SAP ALV内嵌(In-place)Excel的问与答
- 一个js对象的代码结构
- android.content.Context 含义及使用
- COUNT(*)与COUNT(列名)的区别(转)
- PHPCMS栏目调用2
- GitHub 的分支创建与合并
- TCP错误恢复特性之一TCP重传
- python---协程 学习笔记
- 业余草基于JAVA的模块化开发框架JarsLink
- iptables 端口转发规则
- 前K个高频元素
- 将Long类型转为字母数字组合的jar包---Hashids
- Integer Sequence Dividing CodeForces - 1102A (规律)
- 高性能计算linux集群常用配置
- 创建含有多module的springboot工程(八)
- python之模块poplib之常见用法
- VS2013密钥(所有版本)
- ligerUI利用a标签下载文件