This file contains 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/UIKit.h> | |
@class A_ContainerVC; | |
@protocol A_ContainerVCDelegate <NSObject> | |
-(void)sendValue:(NSString *)Name; | |
@optional |
This file contains 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 Person { | |
private var _name : String? = "" | |
private var _surName : String? = "" | |
var name : String?{ | |
get { | |
return _name?.uppercased() | |
} |
This file contains 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 getDateAndTime() -> (String,String) { | |
let formatterDate = DateFormatter() | |
let formatterTime = DateFormatter() | |
formatterDate.dateFormat = "dd/MM/yyyy" | |
formatterTime.dateFormat = "HH:mm" | |
let currentDate = Date() | |
let date = formatterDate.string(from:currentDate) |
This file contains 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 HealthKit | |
class HealthKitManager { | |
class var sharedInstance: HealthKitManager { | |
struct Singleton { | |
static let instance = HealthKitManager() | |
} | |
return Singleton.instance |
This file contains 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
extension CALayer { | |
var borderUIColor: UIColor { | |
set { | |
self.borderColor = newValue.cgColor | |
} | |
get { | |
return UIColor(cgColor: self.borderColor!) | |
} | |
} |
This file contains 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 | |
@IBDesignable class DesignableTextField: UITextField { | |
@IBInspectable var borderWidth: CGFloat = 0.0{ | |
didSet{ | |
self.layer.borderWidth = borderWidth | |
} | |
This file contains 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 | |
func calculateNet(correct:Int = 0 , wrong:Int = 0 , count:Int = 0) -> (Float) { | |
var result : Float = 0 | |
if (correct <= count && correct >= 0) && (wrong <= count && wrong >= 0) { | |
if (correct + wrong <= count){ | |
result = Float(correct) - Float(wrong)/4 |
This file contains 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
extension UIImageView{ | |
func frameForImageInImageViewAspectFit() -> CGRect | |
{ | |
if let img = self.image { | |
let imageRatio = img.size.width / img.size.height; | |
let viewRatio = self.frame.size.width / self.frame.size.height; | |
if(imageRatio < viewRatio) | |
{ |
OlderNewer