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 DataModel { | |
| let name: String | |
| } | |
| let dataModel = DataModel(name: "SwiftBeta") | 
  
    
      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 DataModel { | |
| let name: String | |
| } | |
| let dataModel = DataModel(name: "SwiftBeta") | 
  
    
      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 numbers = ["1", "2", "3"].map(Int.init) | |
| print(numbers) | 
  
    
      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
    
  
  
    
  | //Queremos transformar A en B, y para ello podemos usar una Higher Order Function en Swift | |
| let A = [["1"], ["2", "3"], ["4"], ["5", "6", "7"]] | |
| let B = ["1", "2", "3", "4", "5", "6", "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
    
  
  
    
  | let name: String? = "Suscríbete a SwiftBeta" | |
| let type1: String? = "SwiftUI" | |
| let type2: String? = "Swift" | |
| let type3: String? = "Xcode" | |
| let finalValue = name ?? type1 ?? type2 ?? type3 | |
| print(finalValue) | 
  
    
      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 printMessage() { | |
| print("Message 1") | |
| defer { | |
| print("Message 2") | |
| } | |
| print("Message 3") | |
| } | |
| printMessage() | 
  
    
      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 data = """ | |
| { | |
| "user": "SwiftBeta", | |
| "subscriber": true | |
| } | |
| """.data(using: .utf8)! | |
| struct User: Encodable { | |
| let user: String | |
| let subscriber: Bool | 
  
    
      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 CharacterModel: Decodable { | |
| let id: Int | |
| let name: String | |
| let image: String | |
| let episode: [String] | |
| let locationName: String | |
| let locationURL: String | |
| enum CodingKeys: String, CodingKey { | |
| case id | 
  
    
      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 str: String? = "Hello, world!" | |
| print(str ?? "default") | 
  
    
      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 sum(a: Int, b: Int) -> Int { | |
| return a + b | |
| } | |
| let result = sum(a: 2, b: 3) | |
| print(result) |