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
/* | |
here is stackView as tableView in table cell | |
Created by jeri pm | |
*/ | |
import UIKit | |
class StepThreeTableViewCell: UITableViewCell { | |
@IBOutlet weak var titleTable: UILabel! | |
@IBOutlet weak var subview: UIView! |
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
/* | |
here is stackView as tableView in table cell | |
Created by jeri pm | |
*/ | |
import UIKit | |
class StepThreeTableViewCell: UITableViewCell { | |
@IBOutlet weak var titleTable: UILabel! | |
@IBOutlet weak var subview: UIView! |
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
// | |
// ScrollStackView.swift | |
// iOS-Extensions | |
// | |
// Created by Denis Koryttsev on 07/08/2017. | |
// Copyright © 2017 Denis Koryttsev. All rights reserved. | |
// | |
import UIKit |
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
// | |
// ScrollStackView.swift | |
// iOS-Extensions | |
// | |
// Created by Denis Koryttsev on 07/08/2017. | |
// Copyright © 2017 Denis Koryttsev. All rights reserved. | |
// | |
import UIKit |
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 | |
import PlaygroundSupport | |
let scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | |
scrollView.backgroundColor = .red | |
let stackView = UIStackView(frame: CGRect(x: 0, y: 0, width: 1000, height: 100)) | |
stackView.backgroundColor = .gray | |
stackView.axis = .horizontal | |
stackView.spacing = 10 |
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 | |
import PlaygroundSupport | |
let scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | |
scrollView.backgroundColor = .red | |
let stackView = UIStackView(frame: CGRect(x: 0, y: 0, width: 1000, height: 100)) | |
stackView.backgroundColor = .gray | |
stackView.axis = .horizontal | |
stackView.spacing = 10 |
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
/* | |
Closure examples | |
(1) function in function. | |
Inner function has access to variables of the outer function | |
*/ | |
func outer() -> Int { | |
var outerVar = 5 | |
func inner() { | |
outerVar += 5 | |
} |
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
private lazy var debugLabel: UILabel = { | |
let label = UILabel(frame: CGRectMake(20, 20, 200, 20)) | |
label.textColor = UIColor.redColor() | |
label.backgroundColor = UIColor.whiteColor() | |
return label | |
}() // the parentheses tells swift to use the return value of the closure, not the closure itself. |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
// | |
// Closure basicsg | |
// |
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
//: Playground - noun: a place where people can play | |
// nhathm01247@gmail.com | |
import Foundation | |
/** DECLARE A CLOSURE **/ | |
// Declare a variable to hold a closure | |
var add: (Int, Int) -> Int |
NewerOlder