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 Alamofire | |
import SwiftyJSON | |
import Foundation | |
let API_BASE_URL = "http://api.fozoglu.com" | |
class APICallManager { | |
static let instance = APICallManager() | |
enum RequestMethod { |
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
// | |
// ViewController.swift | |
// Keychain_Example | |
// | |
// Created by Furkan Ozoglu on 13.11.2017. | |
// Copyright © 2017 Furkan Ozoglu. All rights reserved. | |
// | |
import UIKit | |
import Locksmith |
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
{ | |
"messages": [], | |
"routes": { | |
"hasM": true, | |
"fieldAliases": { | |
"ObjectID": "ObjectID", | |
"Name": "Name", | |
"FirstStopID": "FirstStopID", | |
"LastStopID": "LastStopID", | |
"StopCount": "StopCount", |
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 writeLabel(firstTextfield: String) -> Int { | |
guard let d : Int = Int(firstTextfield) else { | |
let d : Int = 0 | |
print("Değer Yok") | |
return d | |
} | |
print(d) | |
return d |
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 open(scheme: String) { | |
if let url = URL(string: scheme) { | |
if #available(iOS 10, *) { | |
UIApplication.shared.open(url, options: [:], | |
completionHandler: { | |
(success) in | |
print("Open \(scheme): \(success)") | |
}) | |
} else { | |
let success = UIApplication.shared.openURL(url) |
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 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) | |
{ |
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 |
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
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 HealthKit | |
class HealthKitManager { | |
class var sharedInstance: HealthKitManager { | |
struct Singleton { | |
static let instance = HealthKitManager() | |
} | |
return Singleton.instance |
NewerOlder