複製資料結構
Select * into NewTable From OldTable Where 1=0
複製TABLE資料結構和資料
Select * into NewTable From OldTable
Select * into NewTable From OldTable Where 1=0
Select * into NewTable From OldTable
這是一款強大的前端開發工具,早期設計Html、CSS總是要手刻畫面,這套軟件大大幫助前端設計師提升開發速度
建議可搭配Sublime、Visual Studio Code等
具有CSS和Html網頁基礎
凡要使用Emmet 下完語法 按TAB鍵
用 ‘>’ 串接 html 的層級
用 ‘+’ 串接同階層
打Emmet不要Key空白鍵
html tag 直接輸入關鍵字,不用輸入’<‘ 和 ‘>’
新增html 5 的檔案: html:5 (按Tab)

創建html 架構 範例
div>h1+div#main>div.site>nav>ul#Item>(li.item$>span{this is my item})*5

這一串看起來很複雜嗎?
不要緊張 很簡單的!
讓我們看下圖,顯示結果

| 語法 | 說明 |
|---|---|
| # | Tag 加入id |
| . | Tag 加入class |
| $ | 自動編碼 1,2,3 依序如下,如果想要二位數編碼01,02,03 可寫成‘$$’ |
| *N | 產生N個Tag |
| {} | Tag加入描述內容 |
| [] | 加入屬性 |
補充說明:
如果想要預設起始值,可以使用’@‘
div.mydiv$@3*2
產生兩個div class各為mydiv3, mydiv4

若想要在Tag加入屬性,可以參考下圖

@IBOutlet weak var btnStart: UIButton!
@IBOutlet weak var progress: UIProgressView!
@IBOutlet weak var labelMsg: UILabel!
//計時器
var timer: Timer?
//計數
var count : Int = 0
override func viewDidLoad() {
super.viewDidLoad()
progress.frame.size.width = 250
//可以自訂progress顏色
progress.progressTintColor = UIColor.red
progress.trackTintColor = UIColor.darkGray
progress.progress = 0
}
@IBAction func donloadClick(_ sender: UIButton) {
//按鈕失效 避免重複點擊
btnStart.isEnabled = false
count = 0
//參數順序亂掉會報錯
//The runTimedCode selector means that the timer will call a method named runTimedCode() every 0.5 seconds until the timer is terminated
timer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector:#selector(runTimedCode), userInfo: nil, repeats: true)
}
func runTimedCode() {
progress.progress = Float(count) / 100
labelMsg.text = "process: \(count)%"
count += 1
if count > 100 {
timer!.invalidate() // stop
timer = nil
btnStart.isEnabled = true
}
}
參考資料:hackingwithswift.comclass ViewController: UIViewController {
@IBOutlet weak var btnPre: UIButton!
@IBOutlet weak var btnNext: UIButton!
@IBOutlet weak var labelName: UILabel!
@IBOutlet weak var image: UIImageView!
//兩種array方法
var arrayImage = ["水上威尼斯","史特拉斯堡-2","科瑪", "新天鵝堡_繽紛","春露"]
var pic: [UIImage] = [
UIImage(named: "水上威尼斯")!,
UIImage(named: "史特拉斯堡-2")!,
UIImage(named: "科瑪")!,
UIImage(named: "新天鵝堡_繽紛")!,
UIImage(named: "春露")!
]
var current:Int = 0
var count:Int = 0
override func viewDidLoad() {
super.viewDidLoad()
count = arrayImage.count
//image.image = UIImage(named: "水上威尼斯")
image.image = pic[0]
labelName.text = arrayImage[0]
}
@IBAction func preClick(_ sender: UIButton) {
current -= 1
if current < 0 {
current = count - 1
}
//image.image = UIImage(named:String(arrayImage[current]))
image.image = pic[current]
labelName.text = arrayImage[current]
}
@IBAction func nextClick(_ sender: UIButton) {
current += 1
if current == count {
current = 0
}
//image.image = UIImage(named:String(arrayImage[current]))
image.image = pic[current]
labelName.text = arrayImage[current]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}
yourButtonName.addTarget(self, action:#selector(functionName(sender:)), for: .touchUpInside)
fun functionName(sender:UIButton) {
//....
}
class ViewController: UIViewController {
@IBOutlet weak var labelTel: UITextField!
@IBOutlet weak var labelMsg: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
for i in 0...11 {
let x:Int = 100 + (i % 4) * 60
let y:Int = 140 + (i / 4) * 60
let buttonNumber:UIButton = UIButton(type: UIButtonType.system) as UIButton
//按鈕位置 大小
buttonNumber.frame = CGRect(x: x,y: y,width: 40, height: 35)
//文字顏色
buttonNumber.setTitleColor(UIColor.white, for: UIControlState.normal)
//按鈕背景
buttonNumber.backgroundColor = UIColor.black
//字型大小
buttonNumber.titleLabel?.font = UIFont(name: "System", size: 22.0)
if i == 10 {
buttonNumber.setTitle("X", for: UIControlState.normal)
//加入事件 #selector(funcName(sender:)) 函數是有參數的
buttonNumber.addTarget(self, action:#selector(clearClick(sender:)), for: .touchUpInside)
} else if i == 11 {
buttonNumber.setTitle("OK", for: UIControlState.normal)
buttonNumber.addTarget(self, action:#selector(sureClick(sender:)), for: UIControlEvents.touchUpInside)
}else {
buttonNumber.setTitle("\(i)", for: UIControlState.normal)
buttonNumber.addTarget(self, action:#selector(numberClick(sender:)), for: UIControlEvents.touchUpInside)
}
//加入按鈕
view.addSubview(buttonNumber)
}
}
func sureClick(sender:UIButton) {
if labelTel.text?.lengthOfBytes(using: String.Encoding.utf8) == 10 {
labelMsg.text = "Call " + labelTel.text!
} else if labelTel.text == "" {
labelMsg.text = "Please enter your phone number."
} else if (labelTel.text?.lengthOfBytes(using: String.Encoding.utf8))! > 10{
labelMsg.text = "Error"
}
}
func clearClick(sender:UIButton){
labelTel.text = ""
labelMsg.text = ""
}
func numberClick(sender:UIButton) {
labelTel.text = labelTel.text! + sender.currentTitle!
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}