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

Commit 8002775

Browse files
authored
Merge pull request #26 from nodes-ios/swift-3.0
Updating master to Swift 3
2 parents a21e781 + 319a001 commit 8002775

File tree

44 files changed

+2360
-162
lines changed

Some content is hidden

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

44 files changed

+2360
-162
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
language: objective-c
2-
osx_image: xcode8
3-
xcode_sdk: iphonesimulator10.0
2+
osx_image: xcode8.1
43
branches:
54
only:
65
- master
7-
- develop
8-
- swift-3.0
96

107
env:
118
global:
12-
- SPINNER_PROJECT="Spinner.xcodeproj"
9+
- PROJECT_NAME="Spinner.xcodeproj"
1310
- IOS_FRAMEWORK_SCHEME="Spinner"
11+
- TVOS_FRAMEWORK_SCHEME="Spinner-tvOS"
1412

15-
- IOS_SDK=iphonesimulator10.0
13+
- IOS_SDK=iphonesimulator10.1
14+
- TVOS_SDK=appletvsimulator10.0
1615

1716
matrix:
18-
- DESTINATION="OS=10.0,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES
17+
- DESTINATION="OS=10.1,name=iPhone 6S Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES
18+
- DESTINATION="OS=10.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES"
1919

2020
script:
2121
- set -o pipefail
2222

2323
# Build Framework in Debug and Run Tests if specified
2424
- if [ $RUN_TESTS == "YES" ]; then
25-
xcodebuild -project "$SPINNER_PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build test | xcpretty;
25+
xcodebuild -project "$PROJECT_NAME" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build test | xcpretty;
2626
else
27-
xcodebuild -project "$SPINNER_PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build | xcpretty;
27+
xcodebuild -project "$PROJECT_NAME" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO clean build | xcpretty;
2828
fi
2929

3030
# Build in release
31-
- xcodebuild -project "$SPINNER_PROJECT" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO clean build | xcpretty;
31+
- xcodebuild -project "$PROJECT_NAME" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO clean build | xcpretty;
3232

3333
after_success:
3434
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
# Spinner
1+
# Spinner
2+
> Present loading indicators anywhere quickly and easily
3+
4+
A helpful loading spinner tool allowing you to present a UIActivityIndicator view directly in to views and buttons.
5+
6+
## 📝 Requirements
7+
8+
* iOS 8.0+
9+
* Swift 3.0+
10+
*(Swift 2.2 & Swift 2.3 supported in older versions)*
11+
12+
## 📦 Installation
13+
14+
### Carthage
15+
~~~
16+
github "nodes-ios/Spinner" ~> 1.0
17+
~~~
18+
19+
> Last versions compatible with lower Swift versions:
20+
>
21+
> **Swift 2.3**
22+
> `github "nodes-ios/Spinner" == 0.2.5`
23+
>
24+
> **Swift 2.2**
25+
> `github "nodes-ios/Spinner" == 0.2.4`
26+
27+
## 💻 Usage
28+
29+
### Standard spinner
30+
Easily present spinners in views like so:
31+
32+
```swift
33+
let spinner = SpinnerView.showSpinner(inView: view)
34+
```
35+
36+
Spinner also gives you the option to customise the UIActivityIndicator Style, color and whether it should disable user interaction of the passed view. These optional parameters will be set as the following if not set.
37+
38+
```swift
39+
public static func showSpinner(inView view: UIView, style: UIActivityIndicatorViewStyle = .white, color:UIColor? = nil, disablesUserInteraction: Bool = true, dimBackground: Bool = false) -> SpinnerView
40+
```
41+
42+
Example of adding it to a view.
43+
44+
```swift
45+
let spinner = SpinnerView.showSpinner(inView: view, style: UIActivityIndicatorViewStyle.white, color: UIColor.red, disablesUserInteraction: false, dimBackground: true)
46+
```
47+
48+
To remove the spinner from your view simply call dismiss.
49+
50+
```swift
51+
spinner.dismiss()
52+
```
53+
54+
### Custom spinner
55+
If you would rather use something more custom than the UIActivityIndicator, you can set an array of images to the Spinner with a duration time it takes to animate through them and display it in a view.
56+
57+
```swift
58+
public static func set(customImages images: [UIImage], duration: TimeInterval)
59+
60+
public static func showCustomSpinner(inView view: UIView, dimBackground: Bool = false) -> SpinnerView
61+
```
62+
63+
### Buttons
64+
You can also display the spinner in buttons, simply add the spinner to any UIButton and the spinner will hide the title in the button and display the spinner in the centre of the button. Once the spinner is dismissed, the title will be made visible once more.
65+
66+
```swift
67+
public static func showCustomSpinner(inButton button: UIButton, disablesUserInteraction:Bool = true) -> SpinnerView
68+
```
69+
70+
## Credits
71+
Made with ❤️ at [Nodes](http://nodesagency.com).
72+
73+
## 📄 License
74+
**Spinner** is available under the MIT license. See the [LICENSE](https://github.com/nodes-ios/Spinner/blob/master/LICENSE) file for more info.

Spinner-tvOS/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSPrincipalClass</key>
22+
<string></string>
23+
</dict>
24+
</plist>

Spinner-tvOS/Spinner-tvOS.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// Spinner-tvOS.h
3+
// Spinner-tvOS
4+
//
5+
// Created by Todor Brachkov on 03/10/2016.
6+
// Copyright © 2016 Nodes. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for Spinner-tvOS.
12+
FOUNDATION_EXPORT double Spinner_tvOSVersionNumber;
13+
14+
//! Project version string for Spinner-tvOS.
15+
FOUNDATION_EXPORT const unsigned char Spinner_tvOSVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like #import <Spinner_tvOS/PublicHeader.h>
18+
19+

Spinner-tvOSTests/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// Spinner_tvOSTests.swift
3+
// Spinner-tvOSTests
4+
//
5+
// Created by Todor Brachkov on 03/10/2016.
6+
// Copyright © 2016 Nodes. All rights reserved.
7+
//
8+
9+
import XCTest
10+
@testable import Spinner
11+
12+
class Spinner_tvOSTests: XCTestCase {
13+
14+
override func setUp() {
15+
super.setUp()
16+
// Put setup code here. This method is called before the invocation of each test method in the class.
17+
}
18+
19+
override func tearDown() {
20+
// Put teardown code here. This method is called after the invocation of each test method in the class.
21+
super.tearDown()
22+
}
23+
24+
func testExample() {
25+
// This is an example of a functional test case.
26+
// Use XCTAssert and related functions to verify your tests produce the correct results.
27+
}
28+
29+
func testPerformanceExample() {
30+
// This is an example of a performance test case.
31+
self.measure {
32+
// Put the code you want to measure the time of here.
33+
}
34+
}
35+
36+
}

0 commit comments

Comments
 (0)