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
| struct CachingPlugin: Moya.PluginType { | |
| func didReceive(_ result: Result<Response, MoyaError>, target: TargetType) { | |
| guard let cachableTarget = target as? CachableTarget else { | |
| return | |
| } | |
| guard cachableTarget.cachingEnabled else { return } | |
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
| public protocol CachableTarget { | |
| var cachingEnabled: Bool { get } | |
| var cacheKey: String { get } | |
| } | |
| extension CachableTarget where Self: TargetType { | |
| var cacheKey: String { | |
| return self.path | |
| } | |
| } |
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 PostsTableViewController: DZNEmptyDataSetSource { | |
| func title(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! { | |
| switch self.state { | |
| case .loading: | |
| return NSAttributedString(string: NSLocalizedString("Loading...", comment: "")) | |
| case .refreshing: | |
| return NSAttributedString(string: NSLocalizedString("Refreshing", comment: "")) | |
| case .error: | |
| return NSAttributedString(string: NSLocalizedString("Error", comment: "")) | |
| default: |
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
| public enum LoadableState<ItemType> { | |
| case idle | |
| case loading | |
| case loaded(items: [ItemType]) | |
| case contentUnavailable | |
| case refreshing | |
| case error(error: Error) | |
| } |
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 testForgotPasswordByUsernamePage() { | |
| start(104, "Login Screen: Test if user is able to resset password.") | |
| _ = Application(test: self) | |
| .showLogin() | |
| .openForgotPassword() | |
| .sendRessetPasswordByUsername() | |
| .backToLogin() | |
| } |
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
| test: | |
| stage: test | |
| script: | |
| - bundle exec fastlane ios test | |
| artifacts: | |
| paths: | |
| - fastlane/test_output/ | |
| tags: | |
| - xcode8.3 |
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
| struct HomePage: Page { | |
| var test: BaseCase! | |
| var pageIdentifier: String { return “home_page” } | |
| func openMenu() -> MenuPage { … } | |
| func openMusic() -> MusicLandingPage { … } | |
| func openVideo() -> VideoLandingPage { … } | |
| func openPlaylists() -> PlaylistsLandingPage { … } | |
| func createPlaylist() -> PlaylistNamePage { … } |
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 PlaygroundSupport | |
| import RxSwift | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| extension ObservableType where E: Sequence { | |
| typealias T = E.Iterator.Element | |
| /// Create an observable which is an Array of the projected values |
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
| ["$ curl -i \\\n\t-X POST \\\n\t-b \"__cfduid=db84f6ef92630eb33c1b947145f2de44c1487849321\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Accept-Language: en;q=1.0\" \\\n\t-H \"Authorization: Bearer 6472b3570b118264debf25365958ba2cdde6f79c\" \\\n\t-H \"User-Agent: zinnow/1.0 (com.appunite.zumba; build:16; iOS 10.2.0) Alamofire/4.3.0\" \\\n\t-H \"Accept-Encoding: gzip;q=1.0, compress;q=0.5\" \\\n\t-d \"{\\\"name\\\":\\\"jdkdjdjd\\\",\\\"modified\\\":1488382623,\\\"songs\\\":[{\\\"music\\\":{\\\"can_stream\\\":true,\\\"name\\\":\\\"A Good Man\\\",\\\"release_date\\\":1465862400,\\\"categories\\\":[{\\\"name\\\":\\\"Zumba® Country\\\",\\\"thumbnail_url\\\":\\\"\\\",\\\"image\\\":\\\"\\\",\\\"num_music\\\":10,\\\"description\\\":\\\"Get down and fit to country favorites!\\\",\\\"type\\\":\\\"regular\\\",\\\"display_order\\\":9999,\\\"children_categories\\\":[]},{\\\"name\\\":\\\"Zumba® Original Music\\\",\\\"thumbnail_url\\\":\\\"https:\\/\\/d29za44huniau5.cloudfront.net\\/wp-content\\/uploads\\/2016\\/1 |
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
| lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |