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/UIKit.h> | |
@class A_ContainerVC; | |
@protocol A_ContainerVCDelegate <NSObject> | |
-(void)sendValue:(NSString *)Name; | |
@optional |
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 Person { | |
private var _name : String? = "" | |
private var _surName : String? = "" | |
var name : String?{ | |
get { | |
return _name?.uppercased() | |
} |
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 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 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
- (IBAction)updateAction { | |
NSURLRequest* requestForWeatherData = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://api.openweathermap.org/data/2.5/weather?q=London,UK&APPID=????????????"]]; | |
//NOTE : ???? is here -> openweathermap api key write | |
NSURLSession *session = [NSURLSession sharedSession]; | |
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:requestForWeatherData completionHandler:^(NSData * data, NSURLResponse * response, NSError * error) { | |
NSMutableDictionary *allData = [ NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; | |
NSLog(@"%@ - Error %@", allData,error); | |
//data in serialized view |
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 HealthKit | |
class HealthKitManager { | |
class var sharedInstance: HealthKitManager { | |
struct Singleton { | |
static let instance = HealthKitManager() | |
} | |
return Singleton.instance |
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
extension CALayer { | |
var borderUIColor: UIColor { | |
set { | |
self.borderColor = newValue.cgColor | |
} | |
get { | |
return UIColor(cgColor: self.borderColor!) | |
} | |
} |
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 | |
@IBDesignable class DesignableTextField: UITextField { | |
@IBInspectable var borderWidth: CGFloat = 0.0{ | |
didSet{ | |
self.layer.borderWidth = borderWidth | |
} | |
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 | |
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 |
OlderNewer