-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CM-1318] Add key command for navigation (#7)
* rebase * [UPDATE] review comments resolved * [UPDATE] resolved review comment * [UPDATE] added test file
- Loading branch information
1 parent
6da3f5b
commit 358f0ab
Showing
7 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
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
9 changes: 9 additions & 0 deletions
9
Sources/YCarousel/Assets/Strings/en.lproj/Localizable.strings
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Localizable.strings | ||
|
||
|
||
Created by Sahil Saini on 05/04/23. | ||
|
||
*/ | ||
"Previous_Arrow_Button" = "Previous"; | ||
"Next_Arrow_Button" = "Next"; |
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
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
22 changes: 22 additions & 0 deletions
22
Sources/YCarousel/Enums/CarouselViewController+Strings.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// CarouselViewController+Strings.swift | ||
// YCarousel | ||
// | ||
// Created by Sahil Saini on 05/04/23. | ||
// Copyright © 2023 Y Media Labs. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import YCoreUI | ||
|
||
extension CarouselViewController { | ||
/// Strings | ||
enum Strings: String, Localizable, CaseIterable { | ||
/// Buttons | ||
case previous = "Previous_Arrow_Button" | ||
case next = "Next_Arrow_Button" | ||
|
||
/// Bundle | ||
static var bundle: Bundle { .module } | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
Tests/YCarouselTests/Enums/CarouselViewController+StringsTests.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// CarouselViewController+StringsTests.swift | ||
// YCarousel | ||
// | ||
// Created by Sahil Saini on 07/04/23. | ||
// Copyright © 2023 Y Media Labs. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import YCarousel | ||
|
||
final class CarouselViewControllerStringsTests: XCTestCase { | ||
func testLoadStrings() { | ||
CarouselViewController.Strings.allCases.forEach { | ||
// Given a localized string constant | ||
let string = $0.localized | ||
// should not be empty | ||
XCTAssertFalse(string.isEmpty) | ||
// should not equal its key | ||
XCTAssertNotEqual($0.rawValue, string) | ||
} | ||
} | ||
} |