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 animateTextField(textField: UITextField, up: Bool) | |
{ | |
let movementDistance:CGFloat = -130 | |
let movementDuration: Double = 0.3 | |
var movement:CGFloat = 0 | |
if up | |
{ | |
movement = movementDistance | |
} |
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
bool showPassClick; | |
this.showPassClick = true; | |
partial void BtnShowPassword_TouchUpInside(UIButton sender) | |
{ | |
if (showPassClick == true) | |
{ | |
txtPassword.SecureTextEntry = false; | |
showPassClick = false; |
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
bool saveUserClick; | |
this.saveUserClick = true; | |
partial void BtnSaveUsername_TouchUpInside(UIButton sender) | |
{ | |
if (saveUserClick == true) | |
{ | |
saveUserClick = false; | |
btnSaveUsername.SetTitle("Save Username ", UIControlState.Normal); |
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
NSUserDefaults userdefaults = NSUserDefaults.StandardUserDefaults; | |
public override void ViewDidAppear(bool animated) | |
{ | |
base.ViewDidAppear(animated); | |
this.txtUserName.Text = NSUserDefaults.StandardUserDefaults.StringForKey("username"); | |
this.txtPassword.Text = NSUserDefaults.StandardUserDefaults.StringForKey("password"); | |
} | |
NSUserDefaults.StandardUserDefaults.SetString(credentials.username.ToString(), "username"); |
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
partial void btn_expand(UIButton sender) | |
{ | |
stkSummary.Hidden = !stkSummary.Hidden; | |
if (stkSummary.Hidden) { | |
btnExpand.SetImage(UIImage.FromBundle("Dashboard_Plus_Button"), UIControlState.Normal); | |
} | |
else if (!stkSummary.Hidden){ | |
btnExpand.SetImage(UIImage.FromBundle("Dashboard_Minus_Button"), UIControlState.Normal); |
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
Console.WriteLine(DateTime.Now); | |
// This block takes 1 second to run because all | |
// 5 tasks are running simultaneously | |
{ | |
var a = Task.Delay(1000); | |
var b = Task.Delay(1000); | |
var c = Task.Delay(1000); | |
var d = Task.Delay(1000); | |
var e = Task.Delay(1000); |
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 isValidEmail(testStr:String) -> Bool { | |
let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | |
let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) | |
return emailTest.evaluate(with: testStr) | |
} | |
isValidEmail(testStr: "sjehutchmail.com") |
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
UIView.Animate(0.25, | |
animation: () => { | |
this.testView.BackgroundColor = new UIColor(red: 0.18f, green: 0.60f, blue: 0.95f, alpha: 1.0f); | |
}, | |
completion: () => { | |
this.testView.BackgroundColor = new UIColor(red: 0.08f, green: 0.38f, blue: 0.80f, alpha: 1.0f); | |
} | |
); |
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 | |
import UIKit | |
class GradientView: UIView { | |
override open class var layerClass: AnyClass { | |
return CAGradientLayer.classForCoder() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) |