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
| <SkippedTests> | |
| <Test | |
| Identifier = "MyTestClass/test_method_name()"> | |
| </Test> | |
| </SkippedTests> |
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 MyTestClass: XCTestCase { | |
| // get called before first test begins | |
| override class func setUp() { | |
| super.setup() | |
| // do something | |
| } | |
| // get called before running each of the test cases in the class | |
| override func setUp() { |
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 BlogView: View { | |
| let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
| var body: some View { | |
| VStack(spacing: 16) { | |
| Text("Blog Title") | |
| .font(.title) | |
| Text(text) | |
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
| var body: some View { | |
| VStack(spacing: 16) { | |
| Text(text) | |
| HStack { | |
| Spacer() | |
| .frame(width: 16) | |
| image | |
| Spacer() | |
| } | |
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
| extension String { | |
| var toEnglishNumberInt: Int? { | |
| let formatter: NumberFormatter = NumberFormatter() | |
| formatter.locale = NSLocale(localeIdentifier: "EN") as Locale? | |
| guard let final = formatter.number(from: self) else { return nil } | |
| return Int(truncating: final) | |
| } | |
| } |
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 ContentView_Previews: PreviewProvider { | |
| static var previews: some View { | |
| Group { | |
| ContentView() | |
| .environment(\.layoutDirection, .leftToRight) | |
| .previewDisplayName("Left to Right") | |
| ContentView() | |
| .environment(\.layoutDirection, .rightToLeft) | |
| .previewDisplayName("Right To Left") |
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 ContentView: View { | |
| let text = "این یک متن تست است. در این متن به بررسی عملکرد زبان های راست به چپ میپردازیم." | |
| @Environment(\.layoutDirection) var direction | |
| var body: some View { | |
| VStack(spacing: 16) { | |
| Text(text) | |
| HStack { | |
| Spacer() |
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
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| let image = UIImage(systemName: "pencil.circle.fill") | |
| if self.view.effectiveUserInterfaceLayoutDirection == .rightToLeft { | |
| imageView.image = image?.imageFlippedForRightToLeftLayoutDirection() | |
| } else { | |
| imageView.image = image | |
| } | |
| } |
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
| Image(systemName: "pencil.circle.fill") | |
| .resizable() | |
| .frame(width: 100, height: 100) | |
| .rotationEffect(.degrees(90)) |
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 ContentView: View { | |
| let text = "این یک متن تست است. در این متن به بررسی عملکرد زبان های راست به چپ میپردازیم." | |
| var body: some View { | |
| VStack(spacing: 16) { | |
| Text(text) | |
| HStack { | |
| Spacer() |
NewerOlder