Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit d98ccb1

Browse files
committed
Add open source license and app information
1 parent a67763d commit d98ccb1

File tree

5 files changed

+122
-3
lines changed

5 files changed

+122
-3
lines changed

Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ end
2727
target 'worktime' do
2828
common_pods
2929

30+
pod 'Carte'
3031
pod 'GoogleSignIn'
3132

3233
pod 'RxKeyboard'

Podfile.lock

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PODS:
55
- AppAuth/ExternalUserAgent (= 1.2.0)
66
- AppAuth/Core (1.2.0)
77
- AppAuth/ExternalUserAgent (1.2.0)
8+
- Carte (2.2.0)
89
- Differentiator (4.0.1)
910
- GoogleSignIn (5.0.0):
1011
- AppAuth (~> 1.1)
@@ -59,6 +60,7 @@ PODS:
5960

6061
DEPENDENCIES:
6162
- Alamofire (~> 5.0.0-beta.7)
63+
- Carte
6264
- GoogleSignIn
6365
- KeychainAccess (~> 3.2.0)
6466
- Moya/RxSwift (~> 14.0.0-alpha.2)
@@ -78,6 +80,7 @@ SPEC REPOS:
7880
https://github.com/cocoapods/specs.git:
7981
- Alamofire
8082
- AppAuth
83+
- Carte
8184
- Differentiator
8285
- GoogleSignIn
8386
- GTMAppAuth
@@ -100,6 +103,7 @@ SPEC REPOS:
100103
SPEC CHECKSUMS:
101104
Alamofire: bd07938ceecad59d2492aeecb1f785a8f2721160
102105
AppAuth: bce82c76043657c99d91e7882e8a9e1a93650cd4
106+
Carte: bca44c5112fac5866c2fa3da9fa018fa54eb8ba7
103107
Differentiator: 886080237d9f87f322641dedbc5be257061b0602
104108
GoogleSignIn: a62edd0516721d2a3db1259a5681b91f9b41c06a
105109
GTMAppAuth: 4deac854479704f348309e7b66189e604cf5e01e
@@ -119,6 +123,6 @@ SPEC CHECKSUMS:
119123
SwiftLint: 5553187048b900c91aa03552807681bb6b027846
120124
Then: 71866660c7af35a7343831f7668e7cd2b62ee0f2
121125

122-
PODFILE CHECKSUM: c3e2ac75b9232b2a8100a574f3f74c462d4360c5
126+
PODFILE CHECKSUM: 8c514a492226088fe1e7f4d575cb5d54ffc4f347
123127

124128
COCOAPODS: 1.7.5

scripts/rvm-carte.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
# Xcode scripting does not invoke rvm. To get the correct ruby,
4+
# we must invoke rvm manually. This requires loading the rvm
5+
# *shell function*, which can manipulate the active shell-script
6+
# environment.
7+
# cf. http://rvm.io/workflow/scripting
8+
9+
# Load RVM into a shell session *as a function*
10+
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
11+
12+
# First try to load from a user install
13+
source "$HOME/.rvm/scripts/rvm"
14+
15+
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
16+
17+
# Then try to load from a root install
18+
source "/usr/local/rvm/scripts/rvm"
19+
else
20+
21+
printf "ERROR: An RVM installation was not found.\n"
22+
exit 128
23+
fi
24+
25+
# rvm will use the controlling versioning (e.g. .ruby-version) for the
26+
# pwd using this function call.
27+
rvm use .
28+
29+
ruby -v
30+
31+
rvm info
32+
33+
if [[ $1 == "pre" ]]
34+
then
35+
./scripts/invoke-rvm.sh
36+
ruby ${PODS_ROOT}/Carte/Sources/Carte/carte.rb pre
37+
elif [[ $1 == "post" ]]
38+
then
39+
./scripts/invoke-rvm.sh
40+
ruby ${PODS_ROOT}/Carte/Sources/Carte/carte.rb post
41+
else
42+
echo "Invalid argument"
43+
exit 1
44+
fi

worktime.xcodeproj/project.pbxproj

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@
338338
9136FDB073CE3FE5E5749F32 /* [CP] Check Pods Manifest.lock */,
339339
C333DE4B22EAA991009418CE /* Sources */,
340340
C333DE4C22EAA991009418CE /* Frameworks */,
341+
3C7EECF32327FD7000DAA1B1 /* [Carte] Pre Script */,
341342
C333DE4D22EAA991009418CE /* Resources */,
343+
3C7EECF42327FD7500DAA1B1 /* [Carte] Post Script */,
342344
CC32DACD1C5A74FDD682E643 /* [CP] Embed Pods Frameworks */,
343345
C333DE7A22EAAAA4009418CE /* Embed App Extensions */,
344346
E7C745249606D2B7C1720E8E /* [CP] Copy Pods Resources */,
@@ -476,6 +478,42 @@
476478
shellPath = /bin/sh;
477479
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n";
478480
};
481+
3C7EECF32327FD7000DAA1B1 /* [Carte] Pre Script */ = {
482+
isa = PBXShellScriptBuildPhase;
483+
buildActionMask = 2147483647;
484+
files = (
485+
);
486+
inputFileListPaths = (
487+
);
488+
inputPaths = (
489+
);
490+
name = "[Carte] Pre Script";
491+
outputFileListPaths = (
492+
);
493+
outputPaths = (
494+
);
495+
runOnlyForDeploymentPostprocessing = 0;
496+
shellPath = /bin/sh;
497+
shellScript = "${SRCROOT}/scripts/rvm-carte.sh pre\n";
498+
};
499+
3C7EECF42327FD7500DAA1B1 /* [Carte] Post Script */ = {
500+
isa = PBXShellScriptBuildPhase;
501+
buildActionMask = 2147483647;
502+
files = (
503+
);
504+
inputFileListPaths = (
505+
);
506+
inputPaths = (
507+
);
508+
name = "[Carte] Post Script";
509+
outputFileListPaths = (
510+
);
511+
outputPaths = (
512+
);
513+
runOnlyForDeploymentPostprocessing = 0;
514+
shellPath = /bin/sh;
515+
shellScript = "${SRCROOT}/scripts/rvm-carte.sh post\n";
516+
};
479517
3CC2167823242F0A00C21A3F /* Lint */ = {
480518
isa = PBXShellScriptBuildPhase;
481519
buildActionMask = 2147483647;

worktime/View Controllers/SettingsViewController.swift

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
// Copyright © 2019 heek.kr. All rights reserved.
77
//
88

9+
import Carte
910
import GoogleSignIn
1011
import Pure
1112
import RxSwift
1213
import RxDataSources
1314
import RxKeyboard
15+
import SafariServices
1416
import SnapKit
1517
import Then
1618
import UIKit
@@ -83,6 +85,14 @@ class SettingsViewController: BaseViewController, FactoryModule {
8385
let notifyNowCell = UITableViewCell().then {
8486
$0.textLabel?.text = "지금 알림 받아보기"
8587
}
88+
let appInformationCell = UITableViewCell().then {
89+
$0.textLabel?.text = "Worktime 정보"
90+
$0.accessoryType = .disclosureIndicator
91+
}
92+
let openSourceLicenseCell = UITableViewCell().then {
93+
$0.textLabel?.text = "오픈소스 라이센스"
94+
$0.accessoryType = .disclosureIndicator
95+
}
8696

8797

8898
// MARK: Initialize
@@ -139,6 +149,10 @@ class SettingsViewController: BaseViewController, FactoryModule {
139149
cell.textLabel?.textColor = isEnabled ? .black : .lightGray
140150
cell.selectionStyle = isEnabled ? .default : .none
141151
return cell
152+
case .appInformation:
153+
return self.appInformationCell
154+
case .openSourceLicense:
155+
return self.openSourceLicenseCell
142156
}
143157
},
144158
titleForHeaderInSection: { dataSource, index in
@@ -203,12 +217,20 @@ class SettingsViewController: BaseViewController, FactoryModule {
203217
}
204218
.map { SettingsTableSectionModel(title: "알림", items: $0) }
205219

220+
let informationSection = Observable.just(
221+
SettingsTableSectionModel(title: "정보", items: [
222+
.appInformation,
223+
.openSourceLicense
224+
])
225+
)
226+
206227
Observable.combineLatest(
207228
accountSection,
208229
selectedCalendarSection,
209-
notificationSection
230+
notificationSection,
231+
informationSection
210232
)
211-
.map { [$0, $1, $2] }
233+
.map { [$0, $1, $2, $3] }
212234
.bind(to: self.tableView.rx.items(dataSource: dataSource))
213235
.disposed(by: self.disposeBag)
214236

@@ -260,6 +282,12 @@ class SettingsViewController: BaseViewController, FactoryModule {
260282
return
261283
}
262284
}
285+
case .appInformation:
286+
let viewController = SFSafariViewController(url: URL(string: "https://worktime.heek.kr/policy/")!)
287+
self.present(viewController, animated: true)
288+
case .openSourceLicense:
289+
let viewController = CarteViewController()
290+
self.navigationController?.pushViewController(viewController, animated: true)
263291
case .selectCalendar(isEnabled: false),
264292
.eventTitle,
265293
.notification(_, isEnabled: false),
@@ -357,6 +385,10 @@ enum SettingsTableRow {
357385
// Notification
358386
case notification(time: Int?, isEnabled: Bool)
359387
case notifyNow(isEnabled: Bool)
388+
389+
// Information
390+
case appInformation
391+
case openSourceLicense
360392
}
361393

362394
struct SettingsTableSectionModel {

0 commit comments

Comments
 (0)