A coding challenge for prospective Senior iOS Developers applying for a role on the IBA iOS developer team.
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
| SELECT | |
| AVG(trace_info.duration_us / 1000000) AS seconds_on_screen, | |
| AVG(trace_info.screen_info.slow_frame_ratio) AS slow_frame_ratio, | |
| AVG(trace_info.screen_info.frozen_frame_ratio) AS frozen_frame_ratio, | |
| event_name as screen, | |
| country | |
| FROM `ibam-d6cd2.firebase_performance.iba_mobilbank_IOS` | |
| WHERE _PARTITIONTIME > TIMESTAMP("2019-05-09") | |
| AND event_type = "SCREEN_TRACE" | |
| AND country = "FR" |
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
| const MY_DOMAIN = 'rezaarkan.com'; | |
| const SLUG_TO_PAGE = { | |
| '': '882cd6dd6e1e482d823b464f326213e5', | |
| 'now': '25b7df64071d420d8f609bf76d9f4114', | |
| 'portfolio': '6000547bed0d441793bfba1498c063e2', | |
| 'resume': '0934b80d2d1544f99dedadb00be9d146', | |
| 'recommendations': '29115129efa44f1a870f390dd2c0a6c0', | |
| 'photos': 'e78c0492a5ec486aa51f4cdb2c6f4603', | |
| 'blog': '29bb193c1a104ba2b832788b57d58cd6', |
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
| // | |
| // HomeRecap.swift | |
| // iosApp | |
| // | |
| import SwiftUI | |
| import shared | |
| struct HomeRecap: View { | |
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 Foundation | |
| class APIService : NSObject { | |
| private let sourcesURL = URL(string: "http://dummy.restapiexample.com/api/v1/employees")! | |
| func apiToGetEmployeeData(completion : @escaping (Employees) -> ()){ | |
| URLSession.shared.dataTask(with: sourcesURL) { (data, urlResponse, error) in | |
| if let data = data { | |
| let jsonDecoder = JSONDecoder() | |
| let empData = try! jsonDecoder.decode(Employees.self, from: data) |
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 Lokalise | |
| func applicationDidBecomeActive(_ application: UIApplication) { | |
| Lokalise.shared.checkForUpdates { _, _ in } | |
| } |
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 Firebase | |
| import FirebaseAnalytics | |
| //MARK - Analytics Service | |
| protocol AnalyticsService { | |
| func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
| func track(event: AnalyticsEvent, parameters: [AnalyticsEventParameter : String]) | |
| var trackingEvents: [AnalyticsEvent] { get } |
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 Foundation | |
| extension DispatchQueue { | |
| func asyncConsumeInMainQueue<T>( | |
| work: @escaping () throws -> T, | |
| mainSuccess: @escaping (T) -> Void, | |
| mainError: @escaping (Error) -> Void) { | |
| async { | |
| do { | |
| let result = try work() |
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 | |
| public protocol AnalyticsServiceType { | |
| var trackedEvents: [AnalyticsSectionEvent] { get } | |
| func initialize(application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?) | |
| func track(event: AnalyticsEvent) | |
| } | |
| extension AnalyticsServiceType { | |
| func shouldTrack(event: AnalyticsSectionEvent) -> Bool { |
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 Foundation | |
| extension DispatchGroup { | |
| /// Completes a series of blocks and finally executes a completion handler. | |
| /// | |
| /// - Parameters: | |
| /// - label: An optional DispatchQueue label (defaults to bg) | |
| /// - qos: An optional DipatchQos (defaults to background) | |
| /// - blocks: The series of blocks to call. |