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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
import PlaygroundSupport | |
//https://habrahabr.ru/post/103681/ | |
protocol MyProtocol{ | |
//Можем объявить статическую функцию в протоколе | |
static func someFunc()-> String |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
import PlaygroundSupport | |
//https://habrahabr.ru/post/103681/ | |
protocol MyProtocol{ | |
//Можем объявить статическую функцию в протоколе | |
static func someFunc()-> String |
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 Foundation | |
import UIKit | |
class ViewControllerAdd: UIViewController { | |
var delegate : DataTableView? | |
@IBAction func exittoVC(_ sender: Any) { | |
delegate?.relodeTableView() | |
self.dismiss(animated: true, completion: nil) |
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 ViewControllerAdd: UIViewController { | |
var delegate : DataTableView? | |
@IBAction func exittoVC(_ sender: Any) { | |
delegate?.relodeTableView() | |
self.dismiss(animated: true, completion: nil) | |
} | |
} |
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 ViewControllerAdd: UIViewController { | |
var delegate : DataTableView? | |
@IBAction func exittoVC(_ sender: Any) { | |
delegate?.relodeTableView() | |
self.dismiss(animated: true, completion: nil) | |
} | |
} |
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
Your code here |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
enum MyErrors: Error { | |
case DivisionByZero | |
} | |
//MARK: Описываем функцию, которая будент выкидывать исключение, при попытке деления на ноль. | |
func divide(_ what: Float, by divider: Float) throws -> Float? { |
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 | |
import Foundation | |
class ConnectBLE { | |
var callBackFunc: ()->() | |
init(callFunc: @escaping () -> ()){ | |
callBackFunc = callFunc | |
} | |
} |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
var dictOfProductsForCategory: [Int: [[String:Any]]] = [:] | |
//I want dictOfProductsForCategory[3183] eventually to be set with 4-items Array | |
//How can I do this? | |
var result1: [[String:Any]]? = [["id":5, "title": "Some Title"], ["id":6, "title": "Another Title"]] |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
//Пробовать с разными - раскоментаривать по очереди | |
var someString: String? = "bjbb" | |
//var someString: String? = "3456" | |
//var someString: Int? = 3456 |
NewerOlder