8000 Port objective-c tutorials to Swift · syk-coder/rabbitmq-tutorials@c1f3f3c · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c1f3f3c

Browse files
author
Daniil Fedotov
committed
Port objective-c tutorials to Swift
1 parent 083b214 commit c1f3f3c

File tree

59 files changed

+3047
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3047
-0
lines changed

swift/.DS_Store

6 KB
Binary file not shown.

swift/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tutorial?/Carthage/Build
2+
tutorial?/Carthage/Checkouts
3+
*xcuserdata*

swift/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Swift code for RabbitMQ tutorials
2+
3+
Swift code examples for the [RabbitMQ tutorials](http://www.rabbitmq.com/getstarted.html).
4+
5+
## Requirements
6+
7+
To run this code you need
8+
[Carthage](https://github.com/Carthage/Carthage) to pull down dependencies,
9+
which include the
10+
[Objective-C client](https://github.com/rabbitmq/rabbitmq-objc-client) itself.
11+
12+
If you have Homebrew installed, simply:
13+
14+
```sh
15+
brew install carthage
16+
```
17+
18+
You also need a running RabbitMQ server on localhost.
19+
20+
## Installation
21+
22+
Each tutorial has its own Xcode project. Before the projects can be run, you
23+
need to download and build their dependencies.
24+
25+
For example, to install tutorial 1:
26+
27+
```sh
28+
cd tutorial1
29+
carthage bootstrap --platform iOS
30+
```
31+
32+
You should then be able to open [the project](tutorial1/tutorial1.xcodeproj) in Xcode and hit Run. Output is
33+
NSLogged.
34+
35+
See [ViewController.swift](tutorial1/tutorial1/ViewController.swift) for the
36+
implementation (each tutorial has its own `ViewController.swift`).
37+
38+
## Running the tutorials on master
39+
40+
If you're QAing a change, or just want to run these tutorials on the master version of the client, follow these steps.
41+
42+
### Edit `Cartfile`
43+
44+
Change the version number to the word "master"
45+
46+
### Clear Carthage cache and update
47+
48+
`rm -rf ~/Library/Caches/org.carthage.CarthageKit && carthage update --platform iOS`
49+
50+
### Rebuild the project in Xcode
51+
52+
If there have been breaking changes, you might now need to make changes to the tutorial.

swift/bump_dependencies.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
rm -rf ~/Library/Caches/org.carthage.CarthageKit
6+
7+
for tutdir in `ls | grep "tutorial[1-9]"`
8+
do
9+
cd $tutdir
10+
carthage update --platform iOS
11+
cd ..
12+
done

swift/tutorial1/.DS_Store

6 KB
Binary file not shown.

swift/tutorial1/Cartfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github "rabbitmq/rabbitmq-objc-client" "v0.10.0"

swift/tutorial1/Cartfile.resolved

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github "robbiehanson/CocoaAsyncSocket" "7.5.0"
2+
github "jeffh/JKVValue" "v1.3.1"
3+
github "rabbitmq/rabbitmq-objc-client" "v0.10.0"

0 commit comments

Comments
 (0)
0