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
using System; | |
using Android.App; | |
using Android.Content.PM; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
using Android.OS; | |
using Xamarin.Forms.Platform.Android; | |
namespace SG.Droid { |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using Xamarin.Forms; | |
namespace SG.iOS { | |
[Register("AppDelegate")] | |
public partial class AppDelegate : UIApplicationDelegate { |
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 loginPage = new ContentPage { | |
Title = "Profile", | |
Icon = "Profile.png", | |
Content = new StackLayout { | |
Spacing = 20, Padding = 50, VerticalOptions = LayoutOptions.Center, | |
Children = { | |
new Entry { Placeholder = "Username" }, | |
new Entry { Placeholder = "Password", IsPassword = true }, | |
new Button { | |
Text = "Login", |
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 osName = string.Empty; | |
if (Device.OS == TargetPlatform.iOS) | |
osName = "Hola iOS!"; | |
if (Device.OS == TargetPlatform.Android) | |
osName = "Hola Droid!"; | |
if (Device.OS == TargetPlatform.WinPhone) | |
osName = "Hola WinPhone!"; |
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 Employee: Equatable, Hashable { | |
var ID: Int | |
var personalInformation: PersonalInformation | |
var wage: Double | |
init(ID: Int, personalInformation: PersonalInformation, wage: Double) { | |
self.ID = ID | |
self.personalInformation = personalInformation | |
self.wage = wage | |
} |
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 PersonalInformation { | |
var name: String | |
var address: String | |
var dateOfBirth: NSDate | |
var age: Int { | |
get { | |
var today = NSDate() | |
var aTimeInterval = | |
today.timeIntervalSinceDate(dateOfBirth) |
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 | |
enum Gender: Printable { | |
case Female | |
case Male | |
var description: String { | |
switch self { | |
case .Male: return "Male" | |
case .Female: return "Female" | |
} |
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 getBound(anArray: [Int], test: (Int, Int) -> Bool) -> Int { | |
var bound = anArray[0] | |
for item in anArray[1..<anArray.count] { | |
if test(item, bound) { | |
bound = item | |
} | |
} | |
return bound | |
} |
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 Airline { | |
static var corporateInformation = CorporateInformation( | |
name: "Bad Airlines", | |
address: "Bad Street 666", | |
webSiteURL: "www.bad.com", | |
) | |
var employees: Set<Employee> | |
var numberOfEmployees: Int { | |
get { |
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
/* condiciones iniciales */ | |
numero(1). | |
numero(2). | |
numero(3). | |
numero(4). | |
numero(5). | |
numero(6). | |
numero(7). | |
numero(8). | |
numero(9). |