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

Commit 75cc4f9

Browse files
Merge pull request #175 from vimeo/release/3.0.1
Release/3.0.1
2 parents 4faa513 + 0da675b commit 75cc4f9

File tree

20 files changed

+609
-316
lines changed

20 files changed

+609
-316
lines changed

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ SPEC CHECKSUMS:
2929
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
3030
VimeoNetworking: 17f8d451e4a168044f619315d0cd821669676e67
3131

32-
PODFILE CHECKSUM: 1effa997066c11f594672c4411d368973a769d6f
32+
PODFILE CHECKSUM: a8a935f97d6d50906dbff286cd02db46fdd6f52c
3333

3434
COCOAPODS: 1.1.1

Pods/Manifest.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 311 additions & 275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Target Support Files/Pods-VimeoNetworkingExample-iOS/Pods-VimeoNetworkingExample-iOS.debug.xcconfig

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Target Support Files/Pods-VimeoNetworkingExample-iOS/Pods-VimeoNetworkingExample-iOS.release.xcconfig

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Target Support Files/Pods-VimeoNetworkingExample-tvOS/Pods-VimeoNetworkingExample-tvOS.debug.xcconfig

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/Target Support Files/Pods-VimeoNetworkingExample-tvOS/Pods-VimeoNetworkingExample-tvOS.release.xcconfig

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VimeoNetworking [![](https://circleci.com/gh/vimeo/VimeoNetworking.png?style=shield&circle-token=0443de366b231f05e3b1b1b3bf64a434b9ec1cfe)](https://circleci.com/gh/vimeo/VimeoNetworking)
22

3-
**VimeoNetworking** is the authoritative Swift networking library for the Vimeo API. Fully designed and implemented with Swift in mind, **VimeoNetworking** is type-safe, well `enum`erated, and never, ever, *ever* force-unwrapped.
3+
**VimeoNetworking** is the authoritative Swift networking library for the Vimeo API. Fully designed and implemented with Swift in mind, **VimeoNetworking** is type-safe, well `enum`erated, and never, ever, *ever* force-unwrapped.
44

55
##### Hey Creator, if you're primarily interested in uploading videos to Vimeo, you should also check out [VimeoUpload](https://github.com/vimeo/VimeoUpload).
66

@@ -9,15 +9,16 @@
99
- iOS (8.0+)
1010
- tvOS (9.0+)
1111

12-
## Installing with CocoaPods
12+
## Installing
13+
At this stage of development VimeoNetworking is not yet available as a CocoaPod via the public Podspecs repo. For now we recommend including it in your project as a submodule. If you'd still like to work with VimeoNetworking as a development pod, simply configure your Podfile as shown below.
1314

1415
To get started integrating `VimeoNetworking`, add the following lines to your `Podfile` and run `pod install`:
1516

1617
```Ruby
1718
use_frameworks! # required for Swift frameworks
1819

1920
target 'YourAppTargetName' do
20-
pod 'VimeoNetworking', '1.0'
21+
pod 'VimeoNetworking', './Submodules/VimeoNetworking'
2122
end
2223
```
2324

@@ -52,15 +53,15 @@ Before we can actually start getting meaningful data from the API, there's one l
5253

5354
Client credentials allow you to see everything that's publicly available on Vimeo. This is essentially equivalent to visiting Vimeo.com without signing up for an account or logging in. This is the simplest authentication method to implement, just one function completes the grant.
5455

55-
```Swift
56+
```Swift
5657
let authenticationController = AuthenticationController(client: vimeoClient)
5758

58-
authenticationController.clientCredentialsGrant { result in
59+
authenticationController.clientCredentialsGrant { result in
5960
switch result {
6061
case .Success(let account):
6162
print("Successfully authenticated with account: \(account)")
6263
case .Failure(let error):
63-
print("error authenticating: \(error)")
64+
print("error authenticating: \(error)")
6465
}
6566
}
6667
```
@@ -88,15 +89,15 @@ The user will be prompted to log in and grant permissions to your application.
8889
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool
8990
{
9091
authenticationController.codeGrant(responseURL: url) { result in
91-
switch result
92+
switch result
9293
{
9394
case .Success(let account):
9495
print("authenticated successfully: \(account)")
9596
case .Failure(let error):
9697
print("failure authenticating: \(error)")
9798
}
9899
}
99-
100+
100101
return true
101102
}
102103
```
@@ -123,18 +124,18 @@ authenticationController.accessToken("your_access_tocken") { result in
123124
`AuthenticationController` saves the accounts it successfully authenticates in the Keychain. The next time your application launches, you should first attempt to load a previously authenticated account before prompting the user to authenticate.
124125

125126
```Swift
126-
do
127+
do
127128
{
128-
if let account = try authenticationController.loadSavedAccount()
129+
if let account = try authenticationController.loadSavedAccount()
129130
{
130131
print("account loaded successfully: \(account)"
131-
}
132-
else
132+
}
133+
else
133134
{
134135
print("no saved account found, authenticate...")
135136
}
136137
}
137-
catch let error
138+
catch let error
138139
{
139140
print("error loading account: \(error)")
140141
}
@@ -163,7 +164,7 @@ By declaring the expected model object type, we can ensure that both the request
163164
After we send that request, we'll get a `Result` enum back. This could be either a `.Success` or a `.Failure` value. `.Success` will contain a `Response` object, while `.Failure` will contain an `NSError`. Switch between these two cases to handle whichever is encountered:
164165

165166
```Swift
166-
vimeoClient.request(videoRequest) { result in
167+
vimeoClient.request(videoRequest) { result in
167168
switch result {
168169
case .Success(let response: Response):
169170
let video: VIMVideo = response.model
@@ -182,12 +183,12 @@ One neat **ProTip**: Your `Request` model type doesn't just have to be a single
182183
```Swift
183184
let staffPickedVideosRequest = Request<[VIMVideo]>(path: "/channels/staffpicks/videos")
184185

185-
vimeoClient.request(staffPickedVideosRequest) { result in
186-
switch result
186+
vimeoClient.request(staffPickedVideosRequest) { result in
187+
switch result
187188
{
188189
case .Success(let response: Response):
189190
let videos: [VIMVideo] = response.model
190-
for video in videos
191+
for video in videos
191192
{
192193
print("retrieved video: \(video)")
193194
}

VimeoNetworking/Sources/Models/Subscription.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public class Subscription: VIMModelObject
4444
/// Represents wether the user is subscribed to the `share` notification.
4545
var share: NSNumber?
4646

47+
/// Represents wether the is subscribed to the `New video available from followed user` notification.
48+
var followedUserVideoAvailable: NSNumber?
49+
4750
/// Represents the Subscription object as a Dictionary
4851
public var toDictionary: [AnyHashable: Any]
4952
{
@@ -55,7 +58,8 @@ public class Subscription: VIMModelObject
5558
"follow": self.follow ?? false,
5659
"vod_preorder_available": self.vodPreorderAvailable ?? false,
5760
"video_available": self.videoAvailable ?? false,
58-
"share": self.share ?? false]
61+
"share": self.share ?? false,
62+
"followed_user_video_available": self.followedUserVideoAvailable ?? false]
5963

6064
return dictionary
6165
}
@@ -68,7 +72,8 @@ public class Subscription: VIMModelObject
6872
"video_available": "videoAvailable",
6973
"vod_preorder_available": "vodPreorderAvailable",
7074
"vod_rental_expiration_warning": "vodRentalExpirationWarning",
71-
"account_expiration_warning": "accountExpirationWarning"]
75+
"account_expiration_warning": "accountExpirationWarning",
76+
"followed_user_video_available": "followedUserVideoAvailable"]
7277
}
7378

7479
// MARK: - Helpers
@@ -86,6 +91,7 @@ public class Subscription: VIMModelObject
8691
self.follow == false &&
8792
self.vodPreorderAvailable == false &&
8893
self.videoAvailable == false &&
89-
self.share == false)
94+
self.share == false &&
95+
self.followedUserVideoAvailable == false)
9096
}
9197
}

VimeoNetworking/Sources/Models/VIMNotification.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ typedef NS_ENUM(NSUInteger, VIMNotificationType) {
3838
VIMNotificationTypeFollow,
3939
VIMNotificationTypeLike,
4040
VIMNotificationTypeReply,
41-
VIMNotificationTypeVideoAvailable
41+
VIMNotificationTypeVideoAvailable, // User new video available
42+
VIMNotificationTypeFollowedUserVideoAvailable // Followed user new video available
4243
};
4344

4445
@interface VIMNotification : VIMModelObject

0 commit comments

Comments
 (0)