-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #487 from Adamant-im/develop
Release 3.6.1
- Loading branch information
Showing
44 changed files
with
512 additions
and
310 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
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
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 @@ | ||
// | ||
// ChatSelectTextViewFactory.swift | ||
// Adamant | ||
// | ||
// Created by Yana Silosieva on 13.02.2024. | ||
// Copyright © 2024 Adamant. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import Swinject | ||
import UIKit | ||
import SwiftUI | ||
|
||
struct ChatSelectTextViewFactory { | ||
@MainActor | ||
func makeViewController(text: String) -> UIViewController { | ||
let view = SelectTextView(text: text) | ||
|
||
return UIHostingController( | ||
rootView: view | ||
) | ||
} | ||
} |
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
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
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,64 @@ | ||
// | ||
// SelectTextView.swift | ||
// Adamant | ||
// | ||
// Created by Yana Silosieva on 13.02.2024. | ||
// Copyright © 2024 Adamant. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct SelectTextView: View { | ||
let text: String | ||
@Environment(\.dismiss) private var dismiss | ||
|
||
var body: some View { | ||
if #available(iOS 16.0, *) { | ||
NavigationStack { | ||
contentView | ||
} | ||
} else { | ||
NavigationView { | ||
contentView | ||
} | ||
} | ||
} | ||
|
||
var contentView: some View { | ||
VStack { | ||
TextView(text: text) | ||
.accentColor(.blue) | ||
.padding() | ||
|
||
Spacer() | ||
} | ||
.navigationBarTitle(String.adamant.chat.selectText, displayMode: .inline) | ||
.navigationBarItems( | ||
trailing: | ||
Button( | ||
action: { dismiss() } | ||
) { | ||
Image(systemName: "xmark") | ||
} | ||
) | ||
.navigationViewStyle(.stack) | ||
} | ||
} | ||
|
||
private struct TextView: UIViewRepresentable { | ||
let text: String | ||
|
||
func makeUIView(context: Context) -> UITextView { | ||
let textView = UITextView() | ||
textView.isEditable = false | ||
textView.text = text | ||
textView.font = .systemFont(ofSize: 17) | ||
textView.selectAll(nil) | ||
return textView | ||
} | ||
|
||
func updateUIView(_ textView: UITextView, context: Context) { | ||
textView.text = text | ||
} | ||
} |
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
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
Oops, something went wrong.