This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Role: Identifiable { | |
var id = UUID() | |
var name: String | |
var rating: Int | |
var image: String | |
var weapon: String | |
var number: Int | |
var movie: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack(alignment: .leading, spacing: 20){ | |
HeaderView() | |
HStack(alignment: .center, spacing: 20){ | |
VStack(alignment: .center, spacing: 10){ | |
Image("Lovey") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
let names = [["cat0", "cat1", "cat2"],["cat3", "cat4","cat5"],["cat6", "cat7","cat8"],["cat9", "cat10","cat11"],["cat12", "cat13","cat14"],["cat15", "cat16","cat17"],["cat18", "cat19","cat20"],["cat21", "cat22","cat23"],["cat24", "cat25","cat26"],["cat27", "cat28","cat29"],["cat30", "cat31","cat32"]] | |
//array 裡包array, 外層array決定row的數量,內層array決定每個row的照片數量 | |
var columnCount = 3 | |
let photoWidth = (UIScreen.main.bounds.size.width - 1 ) / 3 | |
//設定照片為3欄並且隨螢幕調整 | |
var body: some View { | |
List { | |
ForEach(0..<names.count) { (row) in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class PraySunnyViewController: UIViewController { | |
@IBOutlet weak var rainningImageView: UIImageView! | |
@IBOutlet weak var sunnyImageView: UIImageView! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
var timer: Timer? | |
var goal: Date! | |
class ViewController: UIViewController { | |
@IBOutlet weak var sunnyTextfield: UITextField! | |
@IBOutlet weak var sunnyDatePicker: UIDatePicker! | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView : View { | |
var body: some View { | |
ZStack { | |
//西瓜皮 | |
Path { (path) in | |
//右1 | |
path.move(to: CGPoint(x: 20, y: 100)) | |
path.addLine(to: CGPoint(x: 20, y: 220)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var records = [Record]() | |
func initHomeworks(){ | |
records.append(Record(title:"#78 利用delegate在controller間溝通&傳資料的步驟說明")) | |
records.append(Record(title:"#77 搭配UIImgagePickerController選照片")) | |
records.append(Record(title:"#76 scroll view delegate-分頁和圖片的縮放")) | |
records.append(Record(title:"#75 單位轉換的Measurement,Unit&MeasurementFormatter")) | |
records.append(Record(title:"#74 利用CIFilter實現美麗的圖片濾鏡")) | |
records.append(Record(title:"#73 包含左右滑動區塊的table view")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Record.swift | |
// HWToDoList | |
// | |
// Created by Chang Sophia on 4/24/19. | |
// Copyright © 2019 Chang Sophia. All rights reserved. | |
// | |
import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
// Created by Chang Sophia on 11/26/18. | |
// Copyright © 2018 Chang Sophia. All rights reserved. | |
// | |
import UIKit | |
class RoleTableViewController: UITableViewController { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ScrollViewViewController: UIViewController, UIScrollViewDelegate{ | |
@IBOutlet weak var myScrollView: UIScrollView! | |
@IBOutlet weak var myImageView: UIImageView! | |
var scrollViewImage: UIImage? | |
func viewForZooming(in scrollView: UIScrollView) -> UIView? { |
NewerOlder