// Summary of steps /* 0. understand the prompt (question) 1. clarifying questions (ask at least 2 clarification questions) 2. pseudo code 3. test your pseudo code 4. ask the interviewer if you can start coding after testing your pseudocode
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
{ | |
"results": [ | |
{ | |
"gender": "male", | |
"name": { | |
"title": "Monsieur", | |
"first": "Alfonso", | |
"last": "Rolland" | |
}, | |
"location": { |
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
// Making sections for a 2D array to be used in a CollectionView or TableView. [Fellow] => [[Fellow]] | |
import Foundation | |
struct Fellow { | |
let name: String | |
let cohort: String | |
static func allFellows() -> [Fellow] { | |
return [ |
- Firebase pods are installed
- Firebase Storage is configured on your Firebase console.
- Media has been uploaded to Firebase Storage.
- You have already downloaded the Google-Info.plist file and added it to Xcode.
- Firebase has been configured in the AppDelegate.
- Firebase Authentication is configured or Firebase Storage read access is set to public i.e read: true;
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 | |
final class DetailView: UIView { | |
// setting up a scroll view | |
// 1. add scrollview | |
// 2. add content view | |
// 3. add subviews to content view | |
// Note: must set high priority of content view to low, default is 1000 | |
Delegates: You use delegates to interact with Cocoa objects that inform you of events in an app.
Apple docs - delegation
// Object A
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
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 Bundle { | |
enum BundleError: Error { | |
case noResource(String) | |
case noContents(String) | |
case decodingError(Error) | |
} | |
func parseJSONData<T: Decodable>(_ name: String, ext: String = "json") throws -> T { | |
guard let path = Bundle.main.path(forResource: name, ofType: ext) else { | |
throw BundleError.noResource(name) |
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
// Date extension | |
extension Date { | |
static func getStringFromDate(date: Date) -> String { | |
let dateFormatter = DateFormatter() | |
dateFormatter.dateFormat = "EEEE, MMM d, yyyy" | |
let dateString = dateFormatter.string(from: date) | |
return dateString | |
} | |
static func getDateFromString(dateString: String) -> Date? { | |
let formatter = ISO8601DateFormatter() |
NewerOlder