Author: Chris Lattner
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
| // | |
| // ContentView.swift | |
| // InfinityTabView | |
| // | |
| // Created by beader on 2022/10/9. | |
| // | |
| import SwiftUI | |
| struct ContentView: View { |
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 SwiftUI | |
| struct ScrollViewRTL<Content: View>: View { | |
| @ViewBuilder var content: Content | |
| @Environment(\.layoutDirection) private var layoutDirection | |
| var type: RowType | |
| init(type: RowType, @ViewBuilder content: () -> Content) { | |
| self.type = type | |
| self.content = content() |
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
| // Checkout the explanation article here - https://sameer-syd.medium.com/swiftui-two-directional-snaplist-95cb852957be | |
| import SwiftUI | |
| import Combine | |
| struct HomeView: View { | |
| @StateObject var viewModel: HomeViewModel | |
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 LazyView<Content: View>: View { | |
| let build: () -> Content | |
| init(_ build: @autoclosure @escaping () -> Content) { | |
| self.build = build | |
| } | |
| var body: Content { | |
| build() | |
| } | |
| } |
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
| //First, define a custom bundle class as like as below | |
| import Foundation | |
| //A key used for exchanging associated object | |
| var _BUNDLE_KEY = 0 | |
| class BundleEx : Bundle { | |
| override func localizedString(forKey key: String, value: String?, table tableName: String?) -> 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
| mr | Marathi | |
|---|---|---|
| bs | Bosnian | |
| ee_TG | Ewe (Togo) | |
| ms | Malay | |
| kam_KE | Kamba (Kenya) | |
| mt | Maltese | |
| ha | Hausa | |
| es_HN | Spanish (Honduras) | |
| ml_IN | Malayalam (India) | |
| ro_MD | Romanian (Moldova) |