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
for element in cells { | |
switch element { | |
case .one(let typeOne): | |
print("\(typeOne.bar1) \(typeOne.foo1) \(typeOne.foo2) ") | |
case .two(let typeTwo): | |
print("\(typeTwo.fooString) \(typeTwo.foo1) \(typeTwo.barBool) ") | |
} | |
} |
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
var cells: [OurStructs] = [] |
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
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
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
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
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
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
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
let count = 15 | |
let center = CGPoint(x: view.frame.width/2, y:view.frame.height/2) | |
button.center = center | |
let radius : CGFloat = 100 | |
var angle = CGFloat(2 * M_PI) | |
for i in 1...count { | |
let x = cos(angle) * radius + center.x |
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
final class PulsateViewAnimator: NSObject { | |
private weak var view: UIView? | |
private var timer: Timer? | |
private let breathOutDuration: TimeInterval | |
private let holdDuration: TimeInterval | |
private let breathInDuration: TimeInterval | |
private let pulseScaleIdentity: CGAffineTransform |
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
let button = UIButton(frame: CGRect(x: 75, y: 75, width: 100, height: 50)) | |
button.backgroundColor = UIColor.green | |
button.setTitle("Boom Boom", for: .normal) | |
button.titleLabel?.textColor = UIColor.black | |
let view = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) | |
PlaygroundPage.current.liveView = view | |
view.addSubview(button) |
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
final class PulsatingButtonViewController: UIViewController { | |
private var button: UIButton? | |
private var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.button = UIButton(frame: CGRect(x: 250, y: 250, width: 100, height: 50)) | |
if let button = self.button { |