Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit 3ec8278

Browse files
Merge pull request #11 from ArchimboldiMao/master
Version 1.0.4 (Build 6)
2 parents 9cefe5c + 47b0ec4 commit 3ec8278

File tree

8 files changed

+34
-9
lines changed

8 files changed

+34
-9
lines changed

remotex-iOS.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@
644644
CLANG_WARN_SUSPICIOUS_MOVE = YES;
645645
CLANG_WARN_UNREACHABLE_CODE = YES;
646646
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
647+
CODE_SIGN_IDENTITY = "";
647648
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
648649
COPY_PHASE_STRIP = NO;
649650
DEBUG_INFORMATION_FORMAT = dwarf;
@@ -669,6 +670,7 @@
669670
SDKROOT = iphoneos;
670671
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
671672
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
673+
SWIFT_VERSION = 3.0;
672674
TARGETED_DEVICE_FAMILY = "1,2";
673675
};
674676
name = Debug;
@@ -696,6 +698,7 @@
696698
CLANG_WARN_SUSPICIOUS_MOVE = YES;
697699
CLANG_WARN_UNREACHABLE_CODE = YES;
698700
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
701+
CODE_SIGN_IDENTITY = "";
699702
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
700703
COPY_PHASE_STRIP = NO;
701704
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -713,6 +716,7 @@
713716
MTL_ENABLE_DEBUG_INFO = NO;
714717
SDKROOT = iphoneos;
715718
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
719+
SWIFT_VERSION = 3.0;
716720
TARGETED_DEVICE_FAMILY = "1,2";
717721
VALIDATE_PRODUCT = YES;
718722
};
@@ -724,6 +728,7 @@
724728
buildSettings = {
725729
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
726730
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
731+
CODE_SIGN_IDENTITY = "";
727732
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
728733
DEVELOPMENT_TEAM = "";
729734
INFOPLIST_FILE = "remotex-iOS/Info.plist";
@@ -743,6 +748,7 @@
743748
buildSettings = {
744749
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
745750
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
751+
CODE_SIGN_IDENTITY = "";
746752
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
747753
DEVELOPMENT_TEAM = "";
748754
INFOPLIST_FILE = "remotex-iOS/Info.plist";

remotex-iOS/Controller/JobFeedTableNodeController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ extension JobFeedTableNodeController: ASTableDelegate, ASTableDataSource {
175175

176176
func tableNode(_ tableNode: ASTableNode, didSelectRowAt indexPath: IndexPath) {
177177
let job = jobFeed.jobs[indexPath.row]
178+
let jobTitle = job.jobTitle
178179
let jobID = job.jobID
179180
let url = URL.URLForJobRedirect(withID: jobID)
180-
let jobViewController = JobWebViewController.init(withURL: url)
181+
let jobViewController = JobWebViewController.init(withURL: url, withTitle: jobTitle)
181182
self.navigationController?.pushViewController(jobViewController, animated: true)
182183
tableNode.deselectRow(at: indexPath, animated: false)
183184
}
@@ -188,9 +189,10 @@ extension JobFeedTableNodeController: UIViewControllerPreviewingDelegate {
188189
public func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
189190
if let indexPath = self.node.indexPathForRow(at: location) {
190191
let job = jobFeed.jobs[indexPath.row]
192+
let jobTitle = job.jobTitle
191193
let jobID = job.jobID
192194
let url = URL.URLForJobRedirect(withID: jobID)
193-
let jobViewController = JobWebViewController.init(withURL: url)
195+
let jobViewController = JobWebViewController.init(withURL: url, withTitle: jobTitle)
194196
return jobViewController
195197
} else {
196198
return nil

remotex-iOS/Controller/JobWebViewController.swift

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ import WebKit
1212
class JobWebViewController: UIViewController, WKNavigationDelegate {
1313

1414
var url: URL!
15+
var jobTitle: String!
1516

1617
var webView: WKWebView!
1718

1819
var progressView: UIProgressView!
1920

2021
convenience init() {
21-
self.init(withURL: nil)
22+
self.init(withURL: nil, withTitle: nil)
2223
}
2324

24-
init(withURL url: URL!) {
25+
init(withURL url: URL!, withTitle jobTitle: String!) {
2526
self.url = url
27+
self.jobTitle = jobTitle
2628
super.init(nibName: nil, bundle: nil)
2729
}
2830

@@ -46,11 +48,11 @@ class JobWebViewController: UIViewController, WKNavigationDelegate {
4648
super.viewDidLoad()
4749

4850
setupProgressView()
51+
setupNavigation()
4952
webView.load(URLRequest(url: url))
5053
webView.allowsBackForwardNavigationGestures = true
5154
webView.allowsLinkPreview = true
5255
webView.addObserver(self, forKeyPath: #keyPath(WKWebView.estimatedProgress), options: .new, context: nil)
53-
5456
}
5557

5658
override func viewWillDisappear(_ animated: Bool) {
@@ -107,6 +109,21 @@ class JobWebViewController: UIViewController, WKNavigationDelegate {
107109
}
108110
}
109111

112+
func setupNavigation() {
113+
self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonSystemItem.action, target: self, action: #selector(shareAction))
114+
}
115+
116+
func shareAction() {
117+
let image = Constants.ShareContext.LogoImage
118+
let shareTitle: String! = self.jobTitle
119+
let shareURL: URL! = self.url
120+
var shareObject = [Any]()
121+
shareObject = [image, shareURL, shareTitle] as [Any]
122+
let activityViewController = UIActivityViewController(activityItems: shareObject, applicationActivities: nil)
123+
activityViewController.popoverPresentationController?.sourceView = self.view // so that iPads won't crash
124+
self.present(activityViewController, animated: true, completion: nil)
125+
}
126+
110127
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
111128
setupProgressView()
112129
}

remotex-iOS/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.3</string>
18+
<string>1.0.4</string>
1919
<key>CFBundleVersion</key>
20-
<string>5</string>
20+
<string>6</string>
2121
<key>Fabric</key>
2222
<dict>
2323
<key>APIKey</key>

remotex-iOS/Model/AboutModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct AboutModel {
3535
self.remoteXWebSite = "https://remotex.ooclab.org"
3636
self.remoteXSlack = "https://remotex.slack.com"
3737
self.remoteXEmail = "admin@ooclab.org"
38-
self.linkInfo = "联系方式\n网 站:\(remoteXWebSite)\nSlack:\(remoteXSlack)\n邮 件:\(remoteXEmail)\nqq群: remotex 633498747\n微信群: 加 lijian_gnu 拉入群"
38+
self.linkInfo = "联系方式\n网 站:\(remoteXWebSite)\nSlack:\(remoteXSlack)\n邮 件:\(remoteXEmail)\nQQ: RemoteX 633498747\n微信: lijian_gnu(手动拉入微信群)"
3939

4040
}
4141
}

remotex-iOSTests/View/AboutNodeTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AboutNodeTests: FBSnapshotTestCase {
6666

6767
XCTAssertNotNil(linkInfoNode)
6868
XCTAssertEqual(linkInfoNode.view.frame, CGRect.init(x: 0, y: 0, width: 0, height: 0))
69-
let linkInfoText = "联系方式\n网 站:https://remotex.ooclab.org\nSlack:https://remotex.slack.com\n邮 件:admin@ooclab.org\nqq群: remotex 633498747\n微信群: 加 lijian_gnu 拉入群"
69+
let linkInfoText = "联系方式\n网 站:https://remotex.ooclab.org\nSlack:https://remotex.slack.com\n邮 件:admin@ooclab.org\nQQ: RemoteX 633498747\n微信: lijian_gnu(手动拉入微信群)"
7070
XCTAssertEqual(linkInfoNode.attributedText?.string, linkInfoText)
7171

7272
XCTAssertNotNil(versionNode)
1.03 KB
Loading
1.03 KB
Loading

0 commit comments

Comments
 (0)