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 Item: Codable { | |
var title: String | |
var snippet: String | |
} | |
struct Mojim: Codable { | |
var items: [Item] | |
} |
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 Foursqure:Codable { | |
var response: SqureResponse | |
} | |
struct SqureResponse:Codable { | |
var venues: [SqureVenues] | |
} | |
struct SqureVenues:Codable { | |
var name: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 UIKit | |
class testViewController: UIViewController { | |
@IBOutlet weak var label: UILabel! | |
@IBOutlet weak var appleLabel: UILabel! | |
@IBOutlet weak var shape: UISegmentedControl! | |
@IBOutlet weak var slider: UISlider! | |
func pyramid(){ | |
let number = Int(round(slider.value)) |
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 timeViewController: UIViewController { | |
@IBOutlet weak var uplus8Label: UILabel! | |
@IBOutlet weak var ucut12Label: UILabel! | |
@IBOutlet weak var uplus9Label: UILabel! | |
@IBOutlet weak var uplus1Label: UILabel! | |
@IBOutlet weak var uplus12Label: UILabel! | |
@IBOutlet weak var ucut8Label: UILabel! | |
@IBOutlet weak var utcLabel: UILabel! |
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 tempViewController: UIViewController { | |
@IBOutlet weak var topTextField: UITextField! | |
@IBOutlet weak var topLeftLabel: UILabel! | |
@IBOutlet weak var topRightLabel: UILabel! | |
@IBOutlet weak var fahLabel: UILabel! | |
@IBOutlet weak var celsiusLabel: UILabel! | |
@IBOutlet weak var kLabel: UILabel! |
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 payViewController: UIViewController { | |
@IBOutlet weak var totalLabel: UILabel! | |
@IBOutlet weak var taxLabel: UILabel! | |
@IBOutlet weak var servicefeeLabel: UILabel! | |
@IBOutlet weak var priceText: UITextField! | |
@IBOutlet weak var sstLabel: UILabel! | |
@IBOutlet weak var servicefeeText: UITextField! | |
@IBOutlet weak var taxSwitch: UISwitch! |
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 payViewController: UIViewController { | |
@IBOutlet weak var totalLabel: UILabel! | |
@IBOutlet weak var taxLabel: UILabel! | |
@IBOutlet weak var servicefeeLabel: UILabel! | |
@IBOutlet weak var priceText: UITextField! | |
@IBOutlet weak var sstLabel: UILabel! | |
@IBOutlet weak var servicefeeText: UITextField! | |
@IBOutlet weak var taxSwitch: UISwitch! |
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 rect = CGRect(x: 0, y: 0, width: 1000, height: 500) | |
let backgroundView = UIView(frame: rect) | |
backgroundView.backgroundColor = UIColor(displayP3Red: 218/255, green: 32/255, blue: 50/255, alpha: 1) | |
//藍方 | |
rect = CGRect(x: (backgroundView.frame.width/3), y: 0, width: (backgroundView.frame.width/3), height: (backgroundView.frame.height)) | |
let blueView = UIView(frame: rect) | |
blueView.backgroundColor = UIColor(displayP3Red: 0, green: 102/255, blue: 179/255, alpha: 1) | |
//藍方end |
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 | |
let rectLabel = CGRect(x: 0, y: 0, width: 200, height: 200) | |
let label01 = UILabel(frame: rectLabel) | |
label01.numberOfLines = 0 | |
label01.backgroundColor = UIColor(displayP3Red: 125/255, green: 255/255, blue: 10/255, alpha: 0.8) | |
label01.text = "learn to create label in \nPlayground" | |
label01.textColor = UIColor(displayP3Red: 10/255, green: 10/255, blue: 255/255, alpha: 1) | |
label01.layer.cornerRadius = 50 |
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 SafariServices | |
import PlaygroundSupport | |
let urlSource = URL(string: "https://developer.apple.com/videos/all-videos") | |
let safari = SFSafariViewController(url: urlSource!) | |
PlaygroundPage.current.liveView = safari |
NewerOlder