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 | |
| class ViewController: UIViewController { | |
| var textField: UITextField? | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Setup the textField |
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
| // Setup the textField delegate so that the keyboard will show once clicked | |
| textField?.delegate = self |
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 ViewController: UITextFieldDelegate { | |
| // Called when the user clicks return | |
| func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
| // Make keyboard disappear | |
| textField.resignFirstResponder() | |
| return true | |
| } | |
| } |
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 | |
| class ViewController: UIViewController { | |
| var textField: UITextField? | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Setup the textField |
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 sceneDidEnterBackground(_ scene: UIScene) { | |
| // Enter your code here to be executed when the app enters the background | |
| print("App entered background") | |
| } | |
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 sceneDidBecomeActive(_ scene: UIScene) { | |
| // Enter your code here to be executed whenever the app comes into the foreground | |
| print("App entered foreground") | |
| } |
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 | |
| class ViewController: UIViewController { | |
| private var mainScrollView: UIScrollView! | |
| private var profilePicturesScrollView: UIScrollView! | |
| private var profilePicturesContainer: UIView! | |
| private var profilePictures = [UIImageView]() | |
| override func viewDidLoad() { |
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 | |
| class ViewController: UIViewController { | |
| var scrollView: UIScrollView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Set the scrollView's frame to be the size of the screen |
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 | |
| class ViewController: UIViewController { | |
| var scrollView: UIScrollView! | |
| var images = [UIImageView]() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
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 | |
| class ViewController: UIViewController { | |
| private var label: UILabel = { | |
| let label = UILabel(frame: CGRect(x: 0, y: UIScreen.main.bounds.height/2, width: UIScreen.main.bounds.width, height: 50)) | |
| label.textAlignment = .center | |
| label.text = "No Storyboard!" | |
| return label | |
| }() |
OlderNewer