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
| // swiftlint:disable file_length | |
| fileprivate func compareOptionals<T>(lhs: T?, rhs: T?, compare: (_ lhs: T, _ rhs: T) -> Bool) -> Bool { | |
| switch (lhs, rhs) { | |
| case let (lValue?, rValue?): | |
| return compare(lValue, rValue) | |
| case (nil, nil): | |
| return true | |
| default: | |
| return false | |
| } |
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
| // swiftlint:disable line_length | |
| // swiftlint:disable variable_name | |
| // ❤️ https://github.com/krzysztofzablocki/Sourcery/blob/master/Templates/Templates/AutoMockable.stencil | |
| {% for import in argument.autoMockableImports %} | |
| import {{ import }} | |
| {% endfor %} | |
| {% for import in argument.autoMockableTestableImports %} | |
| @testable import {{ import }} | |
| {% endfor %} | |
| {% macro swiftifyMethodName name %}{{ name | replace:"(","_" | replace:")","" | replace:":","_" | replace:"`","" | snakeToCamelCase | lowerFirstWord }}{% endmacro %} |
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
| // Generated using Sourcery 1.6.0 — https://github.com/krzysztofzablocki/Sourcery | |
| // DO NOT EDIT | |
| class MyFirstDayAtMagicalSchool { | |
| //MARK: boom1 transformed to frog-prefix | |
| func frog_boom1() {} | |
| //MARK: boom2 transformed to frog-prefix | |
| func frog_boom2() {} | |
| //MARK: boom3 transformed to frog-prefix | |
| func frog_boom3(str: String, int: Int) {} |
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
| // sourcery: MyFirstSpell | |
| protocol BoomProtocol { | |
| func boom1() | |
| func boom2() -> String | |
| func boom3(str: String, int: Int) | |
| func boom4(args: String...) | |
| } |
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
| {% for type in types.protocols where type|annotated:"MyFirstSpell" %} | |
| class MyFirstDayAtMagicalSchool { | |
| {% for method in type.allMethods %} | |
| //MARK: {{method.shortName}} transformed to frog-prefix | |
| func frog_{{method.name}} {} | |
| {%endfor%} | |
| } | |
| {% endfor %} |
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
| {% for type in types.protocols where type|annotated:"MyFirstSpell" %} | |
| {% for method in type.allMethods %} | |
| // I found method {{method.shortName}} | |
| {%endfor%} | |
| {% endfor %} |
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
| class FooProtocolMock: FooProtocol { | |
| //MARK: - foo1 | |
| var foo1CallsCount = 0 | |
| var foo1Called: Bool { | |
| return foo1CallsCount > 0 | |
| } | |
| var foo1Closure: (() -> Void)? | |
| func foo1() { |
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
| // sourcery: AutoMockable | |
| protocol FooProtocol { | |
| func foo1() | |
| func foo2() -> String | |
| func foo3(str: String, int: Int) -> Int | |
| } |
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
| // sourcery: AutoMockable | |
| protocol FooProtocol { | |
| func foo1() | |
| func foo2() -> String | |
| func foo3(str: String, int: Int) -> Int | |
| } |
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 GOOGLE_API_KEY = "XXXXX"; | |
| const GOOGLE_GCM_URL = "https://fcm.googleapis.com/fcm/send"; | |
| $fields = array( | |
| 'to' => $device_token, | |
| 'sound' => 'default', | |
| 'priority' => 'high', | |
| 'data' => array("title" => $this-title, | |
| "message" => $this->message // You may add more data | |
| ) |