一、基础语法

2020-10-17  本文已影响0人  bytebytebyte
Playground view 和 controller

import UIKit
import PlaygroundSupport


let view = UIView()
view.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
view.backgroundColor = UIColor.red
PlaygroundPage.current.liveView = view

let imageView = UIImageView(image: UIImage(named: "logo.JPG"))

imageView.frame = CGRect(x: 0, y: 0, width: 100, height: 100)
PlaygroundPage.current.liveView = imageView

let vc = UITableViewController()
vc.view.backgroundColor = UIColor.lightGray
PlaygroundPage.current.liveView = vc

2.markup语法
markup语法如下,且只在playground下有效
 ##二级标题
 ###三级标题
 单行斜线和冒号不能分开
 多行星号和冒号不能分开
 
 单行markup语法
 //:# 类
 
 多行markup语法
 /*:
 #基础语法
 -变量
 -常量
 ##二级标题
 #面向对象
 -类
 -属性
 -方法
 #汇编分析
 */
  editor -> Show Rendered Markup 或 Show Raw Markup
 
 */

/*:
 # 一级标题
 ## 无序列表
 - 变量
 - 常量
 ## 有序列表
 1. 类
 2. 属性
 3. 方法
 ## 笔记
 > This is a note
 ___
 ## 图片
 [图片上传失败...(image-f850c-1602938543641)]
 
 ## 链接
 * [苹果官网](https://www.apple.com/)
 
 ## 粗体/斜体
 这时**Bold**  这是*Italic 中问不支持*
 
 */

//: [下一页](@next)
//: [上一页](@previous)
上一篇 下一篇

猜你喜欢

热点阅读