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 | |
class SwiftViewController: UIViewController { | |
@IBOutlet weak var logoImageView: UIImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
if let logo = logoImageView.image { | |
let colorLessLogo = logo.withRenderingMode(.alwaysTemplate) | |
logoImageView.image = colorLessLogo |
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 "CustomTableViewCell.h" | |
@implementation CustomTableViewCell | |
- (void)awakeFromNib { | |
[super awakeFromNib]; | |
// Initialization code | |
} | |
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
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 | |
class CustomTableViewCell: UITableViewCell { | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
// Initialization code | |
} | |
override func setSelected(_ selected: Bool, animated: Bool) { | |
super.setSelected(selected, animated: animated) |
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
int randomNumber = arc4random() % 1337; | |
int anotherRandomeNumber = arc4random_uniform(1337); |
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 randomNumber = arc4random_uniform(1337) | |
let anotherRandomNumber = arc4random_uniform(1337) |
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 newinSwift = Int.random(in: 0...1337) |
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
-(BOOL)toggle:(BOOL) value { | |
return !value; | |
} |
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
extension Bool { | |
mutating func toggleValue() { | |
self = !self | |
} | |
} |
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 isLightOn = false | |
isLightOn.toggle() |
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 | |
class SwiftViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
@IBAction func middleButtonTapped(_ sender: UIButton) { | |
UIView.animate(withDuration: 0.5, animations: { |