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 { | |
| NavigationView { | |
| SidebarView() | |
| DetailSplitView(number: 1, color: .red) | |
| } | |
| } | |
| } |
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
| class ViewController: UIViewController { | |
| private let swiftBetaButton1: UIButton = { | |
| var configuration = UIButton.Configuration.filled() // 1 | |
| configuration.title = "Suscríbete a SwiftBeta" // 2 | |
| configuration.subtitle = "Apoya el canal" // 3 | |
| configuration.image = UIImage(systemName: "play.circle.fill") // 4 | |
| let button = UIButton(type: .system) // 5 | |
| button.translatesAutoresizingMaskIntoConstraints = false // 6 | |
| button.configuration = configuration // 7 |
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 names = ["SwiftBeta", "Swift"] | |
| var fruits = ["apple", "orange"] | |
| print(Array(zip(names, fruits))) |
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 urlSessionConfiguration = URLSessionConfiguration.default | |
| let urlSession = URLSession(configuration: urlSessionConfiguration) | |
| let session = URLSession.shared | |
| let url = URL(string: "https://itunes.apple.com/search/media=music&entity=song&term=avicii") | |
| urlSession.dataTask(with: url!) { data, response, error in | |
| print("Data \(String(describing: data))") | |
| print("Response \(String(describing: response))") |
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
| let values = ["SwiftBeta", "Swift", "SwiftUI"].publisher | |
| values.sink { value in | |
| print(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 User { | |
| var name: String | |
| init(name: String) { | |
| self.name = name | |
| } | |
| } |
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 | |
| struct User { | |
| var name: String | |
| } | |
| var user = User(name: "Steve") | |
| var copyUser = user | |
| copyUser.name = "Tim" |
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
| func multiply() -> (Int) -> Int { | |
| return { value in | |
| return value * 2 | |
| } | |
| } | |
| print(multiply()(4)) |
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
| func add(number: Int) -> (Int) -> Int { | |
| return { value in | |
| return value + 2 | |
| } | |
| } | |
| let type = add(number:) |
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
| func add(number: Int) -> (Int) -> Int { | |
| return { value in | |
| return value + 2 | |
| } | |
| } | |
| let type = add(number: 2) |
OlderNewer