class SearchViewModel<T> {
// inputs
private let searchSubject = PublishSubject<String>()
var searchObserver: AnyObserver<String> {
return searchSubject.asObserver()
}
// outputs
private let loadingSubject = PublishSubject()
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
{ | |
"locationActivityMetrics" : { | |
"cumulativeBestAccuracyForNavigationTime" : "20 secs", | |
"cumulativeBestAccuracyTime" : "30 secs", | |
"cumulativeHundredMetersAccuracyTime" : "30 secs", | |
"cumulativeNearestTenMetersAccuracyTime" : "30 secs", | |
"cumulativeKilometerAccuracyTime" : "20 secs", | |
"cumulativeThreeKilometersAccuracyTime" : "20 secs" | |
}, | |
"cellularConditionMetrics" : { |
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 <XCTest/XCTest.h> | |
#import "User.h" | |
@interface UserTests : XCTestCase | |
@end | |
@implementation UserTests { | |
User *subject; | |
} |
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 <Specta/Specta.h> | |
#import "User.h" | |
SpecBegin(User) | |
__block User *subject; | |
before(^{ | |
subject = [[User alloc] init]; | |
}); |
func search(byTerm term: String) -> Observable<[T]> {
fatalError("Override this function with your custom implementation")
}
- Add strictly the properties that you will use as opposed to all the properties delivered in the network response.
- Conform to
Codable
when used to map network response - Use
CodingKeys
enum when mapping a reduced part of the response or when needing to specify different names (specially if the names coming from the server make little sense). - Question: Class or Struct Convention?
struct SelectCarResponse: Codable {
This is a Visual Code Extension that allows you to generate native code (swift and java) to initialize and interact with React Native views.
The React Native framework comes with a set of APIs that allows us to load and interact with views. For the React Native SDK to be able to retrieve our view we need to specify our bundle containing the Javascript sources, and pass along the props we wanna initialize this view with. For every view we initialize we might also need to send messages back and forth between both ends of our application (native side and react native side). To accomplish this we need to conform to a protocol (iOS) and implement an interface (Java).
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
{"lastUpload":"2017-07-29T21:12:58.647Z","extensionVersion":"v2.8.2"} |
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 Cocoa | |
struct MyNumber { | |
private var string:String! | |
var lenght:Int { | |
get { | |
return string.characters.count | |
} |
NewerOlder