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/

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 发布文章使用:只允许注册用户才可以访问!


Swift Playground All In One的更多相关文章

  1. Swift Playground词法分析器DEMO

    正在看极客时间宫文学老师的编译原理之美,用swift playground写了一个第二课"int age >= 45"的词法解析DEMO 为了保持原课程代码,DEMO用了顺序 ...

  2. Swift PlayGround无限Running问题

    这个问题我想肯定很多人都有遇到过,如果你正好面试iOS,用这个playground写算法的话遇到这种情况只能hehe了-- 我是这样解决的,一开始我build project的时候选得是iOS的pla ...

  3. Swift 3 新特性

    原文:What's New in Swift 3? ,作者:Ben Morrow,译者:kmyhy Swift 3将于今年下半年推出,为Swift开发者们带来了很多核心代码的改变.如果你没有关注过 S ...

  4. Breaking Down Type Erasure in Swift

    Type Erasure Pattern We can use the type erasure pattern to combine both generic type parameters and ...

  5. Xcode & swift

    swift-apps swift 2018 apps Xcode Swift Playground https://developer.apple.com/download/ https://deve ...

  6. Swift来了,是不是能够入手IOS开发了?

    在今天的WWDC2014上,苹果公布了一种全新的Swift.在苹果高管 Craig Federighi 的描写叙述中,Swift 在各个方面优于 Objective-C,也不会有那么多复杂的符号和表达 ...

  7. Swift 环境搭建

    Swift 环境搭建 Swift是一门开源的编程语言,该语言用于开发OS X和iOS应用程序. 在正式开发应用程序前,我们需要搭建Swift开发环境,以便更好友好的使用各种开发工具和语言进行快速应用开 ...

  8. iOS:iOS开发非常全的三方库、插件等等

    iOS开发非常全的三方库.插件等等 github排名:https://github.com/trending, github搜索:https://github.com/search. 此文章转自git ...

  9. WWDC 2016 总结

    一年一次的WWDC,是开发者充值信仰的时刻,今天你的信仰充值了吗?欢迎在本文下面留言吐槽. 有外媒称,这届WWDC苹果将“fun”伪装成“innovation”,的确,看看另两家老对手,微软有黑科技H ...

随机推荐

  1. Android N wifi auto connect流程分析

    定义 当有两个或者两个以上的已经保存的无线网络可以连接时,系统通过选择算法来选择一个最优网络. 在Android L,wifi的自动重连机制是由WifiAutoJoinController 类来实现, ...

  2. error Unexpected use of comma operator no-sequences解决过程

    error Unexpected use of comma operator no-sequences解决过程 报错内容: ERROR in ./pages/course/_id.vue friend ...

  3. Profile Guided Optimization Link Time Optimization

    https://github.com/python/cpython Profile Guided Optimization PGO takes advantage of recent versions ...

  4. LINUX动态库(.SO)搜索路径(目录)设置方法

    LINUX动态库(.SO)搜索路径(目录)设置方法 [root@VM_0_11_centos ld.so.conf.d]# cat /etc/ld.so.confinclude ld.so.conf. ...

  5. tcp服务器

    如同上面的电话机过程一样,在程序中,如果想要完成一个tcp服务器的功能,需要的流程如下: socket创建一个套接字 bind绑定ip和port listen使套接字变为可以被动链接 accept等待 ...

  6. DDD领域驱动设计:仓储

    1 前置阅读 在阅读本文章之前,你可以先阅读: 什么是DDD DDD的实体.值对象.聚合根的基类和接口:设计与实现 2 什么是仓储? 仓储封装了基础设施来提供查询和持久化聚合操作. 它们集中提供常见的 ...

  7. Java——I/O,字节流与字符流,BufferedOutputStream,InputStream等(附相关练习代码)

    I/O: I/O是什么? 在程序中,所有的数据都是以流的形式进行传输或者保存. 程序需要数据的时候,就要使用输入流读取数据. 程序需要保存数据的时候,就要使用输出流来完成. 程序的输入以及输出都是以流 ...

  8. GJ项目技术代码相关总结

    第一次实习公司的GJ项目快要结束,自己总结了一些工作中的代码,留到记录学习. 根据下拉条件,进行查询,展示出不同的表单选项:并在鼠标进入到指定区域时显示部分内容,鼠标移出内容区域时,隐藏内容. 焦点移 ...

  9. SLAM01

    上周末发现了一个巨大的问题,就是我们目前构建的室内定位的方法中,一个基本的假设是错的----这就非常尴尬了. 于是乎赶紧抱一波佛脚,学习一下slam里相关的问题是怎么解决的,找找灵感. 结果看了个开头 ...

  10. C++基本之--静态成员函数和静态成员变量

    #include <iostream> using namespace std; class Internet { public: Internet(char *name,char *ad ...