-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(copy): Allow copying link and selection of a message
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
- Loading branch information
1 parent
76ed892
commit 202a727
Showing
6 changed files
with
179 additions
and
27 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,41 @@ | ||
// | ||
// SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// | ||
|
||
import UIKit | ||
import Foundation | ||
import SwiftyAttributes | ||
|
||
@objcMembers class MessageTextViewController: UIViewController { | ||
|
||
@IBOutlet public weak var messageTextView: UITextView! | ||
|
||
private var messageText = "" | ||
|
||
init(messageText: String) { | ||
super.init(nibName: "MessageTextViewController", bundle: nil) | ||
|
||
self.messageText = messageText | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
NCAppBranding.styleViewController(self) | ||
|
||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: NSLocalizedString("Close", comment: ""), primaryAction: UIAction { [unowned self] _ in | ||
self.dismiss(animated: true) | ||
}) | ||
|
||
self.messageTextView.layer.cornerRadius = 8 | ||
self.messageTextView.layer.masksToBounds = true | ||
self.messageTextView.textContainerInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10) | ||
self.messageTextView.text = messageText | ||
} | ||
|
||
} |
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,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="System colors in document resources" minToolsVersion="11.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GithubPermalinkViewController" customModule="NextcloudTalk" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="messageTextView" destination="cBP-KD-G41" id="i1n-9c-Aw9"/> | ||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> | ||
</connections> | ||
</placeholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" layoutManager="textKit1" translatesAutoresizingMaskIntoConstraints="NO" id="cBP-KD-G41" userLabel="MessageTextView"> | ||
<rect key="frame" x="10" y="102" width="394" height="750"/> | ||
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor"/> | ||
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, 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. Nam liber te conscient to factor tum poen legum odioque civiuda.</string> | ||
<color key="textColor" systemColor="labelColor"/> | ||
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> | ||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> | ||
</textView> | ||
</subviews> | ||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> | ||
<color key="backgroundColor" systemColor="systemBackgroundColor"/> | ||
<constraints> | ||
<constraint firstItem="cBP-KD-G41" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="10" id="1kw-8j-kX2"/> | ||
<constraint firstAttribute="trailing" secondItem="cBP-KD-G41" secondAttribute="trailing" constant="10" id="WFu-fW-DVD"/> | ||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="cBP-KD-G41" secondAttribute="bottom" constant="10" id="aq2-kt-9iz"/> | ||
<constraint firstItem="cBP-KD-G41" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="10" id="jFw-Kg-42l"/> | ||
</constraints> | ||
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/> | ||
<point key="canvasLocation" x="82.608695652173921" y="91.741071428571431"/> | ||
</view> | ||
</objects> | ||
<resources> | ||
<systemColor name="labelColor"> | ||
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
<systemColor name="secondarySystemBackgroundColor"> | ||
<color red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
</systemColor> | ||
<systemColor name="systemBackgroundColor"> | ||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
</systemColor> | ||
</resources> | ||
</document> |
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