File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed
Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 479479 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
480480 PRODUCT_BUNDLE_IDENTIFIER = tokyo.yagra.macaronTests;
481481 PRODUCT_NAME = "$(TARGET_NAME)";
482- SWIFT_SWIFT3_OBJC_INFERENCE = On ;
482+ SWIFT_SWIFT3_OBJC_INFERENCE = Off ;
483483 SWIFT_VERSION = 4.0;
484484 };
485485 name = Debug;
493493 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
494494 PRODUCT_BUNDLE_IDENTIFIER = tokyo.yagra.macaronTests;
495495 PRODUCT_NAME = "$(TARGET_NAME)";
496- SWIFT_SWIFT3_OBJC_INFERENCE = On ;
496+ SWIFT_SWIFT3_OBJC_INFERENCE = Off ;
497497 SWIFT_VERSION = 4.0;
498498 };
499499 name = Release;
Original file line number Diff line number Diff line change @@ -12,11 +12,17 @@ public protocol MacaronCellDataType {
1212 var CellClassName : String { get }
1313}
1414
15- public extension MacaronCellDataType {
16- public func handle( _ handler: ( Self ) -> Void ) -> Self {
17- handler ( self )
18- return self
19- }
15+
16+ precedencegroup HandlingCondition {
17+ associativity : left
18+ higherThan : AssignmentPrecedence
19+ lowerThan : TernaryPrecedence
20+ }
21+
22+ infix operator <! : HandlingCondition
23+ public func <! < D> ( d: D , handler: ( D ) -> Void ) -> D where D: MacaronCellDataType {
24+ handler ( d)
25+ return d
2026}
2127
2228open class MacaronCellData < Cell: MacaronCellType > : MacaronCellDataType {
Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ class macaronTests: XCTestCase {
1313
1414 override func setUp( ) {
1515 super. setUp ( )
16- // Put setup code here. This method is called before the invocation of each test method in the class.
1716 }
1817
1918 override func tearDown( ) {
20- // Put teardown code here. This method is called after the invocation of each test method in the class.
2119 super. tearDown ( )
2220 }
23-
24- func testExample( ) {
25- // This is an example of a functional test case.
26- // Use XCTAssert and related functions to verify your tests produce the correct results.
21+
22+ func testCustomOperator( ) {
23+ let data = TextCellData ( text: " hoge " ) <! {
24+ $0. text = " fuga "
25+ }
26+ XCTAssertEqual ( data. text, " fuga " )
2727 }
2828
2929 func testPerformanceExample( ) {
You can’t perform that action at this time.
0 commit comments