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

Commit cd7343c

Browse files
Merge pull request #2 from studyplus/fix_minor_changes
Fix minor changes
2 parents 92ca812 + 15c2f92 commit cd7343c

File tree

9 files changed

+29
-13
lines changed

9 files changed

+29
-13
lines changed

Demo/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.7</string>
18+
<string>1.0.8</string>
1919
<key>CFBundleURLTypes</key>
2020
<array>
2121
<dict>

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ SPEC CHECKSUMS:
99

1010
PODFILE CHECKSUM: 99cb6e8dd53026dd13517c24451af319e5c1a23a
1111

12-
COCOAPODS: 1.2.0
12+
COCOAPODS: 1.2.1

StudyplusSDK-V2.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "StudyplusSDK-V2"
3-
s.version = "1.0.7"
3+
s.version = "1.0.8"
44
s.summary = "StudyplusSDK-V2 is Studyplus iOS SDK for Swift"
55
s.homepage = "http://info.studyplus.jp"
66
s.license = { :type => "MIT", :file => "LICENSE" }

StudyplusSDK.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
);
440440
runOnlyForDeploymentPostprocessing = 0;
441441
shellPath = /bin/sh;
442-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
442+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
443443
showEnvVarsInLog = 0;
444444
};
445445
/* End PBXShellScriptBuildPhase section */

StudyplusSDK/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.7</string>
18+
<string>1.0.8</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

StudyplusSDK/StudyplusAPIRequest.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ internal struct StudyplusAPIRequest {
6161

6262
guard let url = buildUrl(path: path) else { return }
6363

64-
let urlSession = URLSession(configuration: URLSessionConfiguration.default)
6564
var request = URLRequest(url: url)
6665
request.httpMethod = method
6766

@@ -74,8 +73,12 @@ internal struct StudyplusAPIRequest {
7473
}
7574

7675
request.addValue("OAuth " + accessToken, forHTTPHeaderField: "HTTP_AUTHORIZATION")
77-
76+
77+
let urlSession = URLSession(configuration: URLSessionConfiguration.default)
7878
let task = urlSession.dataTask(with: request) { (data, response, error) in
79+
80+
urlSession.finishTasksAndInvalidate()
81+
7982
if error == nil && response != nil {
8083
if let httpResponse: HTTPURLResponse = response as? HTTPURLResponse {
8184
if httpResponse.statusCode == 200 || httpResponse.statusCode == 201 || httpResponse.statusCode == 202 {

StudyplusSDK/StudyplusRecord.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ private extension Date {
4343
}
4444

4545
func string(format: String = "yyyy-MM-dd'T'HH:mm:ssZ") -> String {
46+
formatter.locale = Locale.current
4647
formatter.dateFormat = format
4748
return formatter.string(from: self)
4849
}
@@ -59,27 +60,27 @@ public struct StudyplusRecord {
5960
The seconds of the learning.
6061
勉強した時間(秒数)です。
6162
*/
62-
public private(set) var duration: Double
63+
public let duration: Double
6364

6465
/**
6566
The date and time of learning.
6667
勉強した日時です。
6768
*/
68-
public private(set) var recordedAt: Date
69+
public let recordedAt: Date
6970

7071
/**
7172
The amount of learning.
7273
勉強した量です。
7374

7475
see StudyplusRecordAmount
7576
*/
76-
public private(set) var amount: StudyplusRecordAmount?
77+
public let amount: StudyplusRecordAmount?
7778

7879
/**
7980
The comment of learning.
8081
勉強に関するコメントです。
8182
*/
82-
public private(set) var comment: String?
83+
public let comment: String?
8384

8485
/// Initialize StudyplusRecord object.
8586
///

StudyplusSDK/StudyplusRecordAmount.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public struct StudyplusRecordAmount {
3838

3939
学習量
4040
*/
41-
public private(set) var amount: UInt?
41+
public let amount: UInt?
4242

4343
/**
4444
Range of learning amount.
4545

4646
学習範囲
4747
*/
48-
public private(set) var range: (from: UInt, to: UInt)?
48+
public let range: (from: UInt, to: UInt)?
4949

5050
/// Initialize the Amount object with only the total amount of learning.
5151
///
@@ -54,6 +54,7 @@ public struct StudyplusRecordAmount {
5454
/// - Parameter amount: learning amount. 学習量。
5555
public init(amount: UInt) {
5656
self.amount = amount
57+
self.range = nil
5758
}
5859

5960
/// Initialize the Amount object with a range of learning amount.
@@ -67,6 +68,7 @@ public struct StudyplusRecordAmount {
6768
return nil
6869
}
6970

71+
self.amount = nil
7072
self.range = range
7173
}
7274

setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh -x
2+
3+
rm Podfile.lock
4+
rm Cartfile.resolved
5+
rm -rf Pods
6+
rm -rf StudyplusSDK.xcworkspace
7+
8+
pod install
9+
carthage update --no-use-binaries --platform iOS
10+

0 commit comments

Comments
 (0)