Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniocasero committed Oct 14, 2018
1 parent ab6fe8f commit 9b3ca05
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 70 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.2
11 changes: 11 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
included:
- Sources
- Tests

disabled_rules:
- identifier_name
- type_name
- cyclomatic_complexity
- file_length

line_length: 200
21 changes: 0 additions & 21 deletions Arrows.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
/* Begin PBXFileReference section */
52D6D97C1BEFF229002C0205 /* Arrows.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Arrows.framework; sourceTree = BUILT_PRODUCTS_DIR; };
52D6D9F01BEFFFBE002C0205 /* Arrows.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Arrows.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8933C7891EB5B82A000D00A4 /* ArrowsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArrowsTests.swift; sourceTree = "<group>"; };
AD2FAA261CD0B6D800659CF4 /* Arrows.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Arrows.plist; sourceTree = "<group>"; };
AD2FAA281CD0B6E100659CF4 /* ArrowsTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ArrowsTests.plist; sourceTree = "<group>"; };
C48D94EF21733452008A498D /* ArrowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArrowView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -41,7 +39,6 @@
isa = PBXGroup;
children = (
8933C7811EB5B7E0000D00A4 /* Sources */,
8933C7831EB5B7EB000D00A4 /* Tests */,
52D6D99C1BEFF38C002C0205 /* Configs */,
52D6D97D1BEFF229002C0205 /* Products */,
);
Expand All @@ -60,7 +57,6 @@
isa = PBXGroup;
children = (
DD7502721C68FC1B006590AF /* Frameworks */,
DD7502731C68FC20006590AF /* Tests */,
);
path = Configs;
sourceTree = "<group>";
Expand All @@ -73,15 +69,6 @@
path = Sources;
sourceTree = "<group>";
};
8933C7831EB5B7EB000D00A4 /* Tests */ = {
isa = PBXGroup;
children = (
8933C7891EB5B82A000D00A4 /* ArrowsTests.swift */,
);
name = Tests;
path = Tests/ArrowsTests;
sourceTree = "<group>";
};
DD7502721C68FC1B006590AF /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand All @@ -90,14 +77,6 @@
name = Frameworks;
sourceTree = "<group>";
};
DD7502731C68FC20006590AF /* Tests */ = {
isa = PBXGroup;
children = (
AD2FAA281CD0B6E100659CF4 /* ArrowsTests.plist */,
);
name = Tests;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down
24 changes: 0 additions & 24 deletions Configs/ArrowsTests.plist

This file was deleted.

16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ class YourViewController: UIViewController {

The perfect companion for `Arrows` is [Panels](https://github.com/antoniocasero/Panels), take a look!

## More options

```swift
/// Get the current position, if you want to change
/// position use `update` function
fileprivate(set) var arrowPosition: Position = .middle

/// Animation duration between arrow states (accesible from IB)
@IBInspectable open var arrowAnimationDuration: Double = 0.30

/// Set arrow color (accesible from IB)
@IBInspectable open var arrowColor: UIColor = .black
```

<p align="center">
<img src="Resources/ArrowExample.gif" width="237" height="471" alt="Arrowa demo1">
</p>
Expand All @@ -47,7 +61,7 @@ The perfect companion for `Arrows` is [Panels](https://github.com/antoniocasero/
Add the line `pod "Arrows"` to your `Podfile`

### Carthage
Add the line `github "antoniocasero/Arrowa"` to your `Cartfile`
Add the line `github "antoniocasero/Arrows"` to your `Cartfile`

## Author
Project created by Antonio Casero ([@acaserop](https://twitter.com/acaserop) on Twitter).
Expand Down
9 changes: 5 additions & 4 deletions Sources/ArrowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ open class ArrowView: UIView {
/// Get the current position, if you want to change
/// position use `update` function
fileprivate(set) var arrowPosition: Position = .middle
@IBInspectable var arrowColor: UIColor = .black {

/// Set arrow color
@IBInspectable open var arrowColor: UIColor = .black {
didSet {
arrowLayer.fillColor = arrowColor.cgColor
}
}

/// Animation duration between arrow states
open var arrowAnimationDuration: Double = 0.30
@IBInspectable open var arrowAnimationDuration: Double = 0.30

/// Arrow positions
///
Expand Down Expand Up @@ -81,7 +83,7 @@ open class ArrowView: UIView {
}

extension ArrowView {
private func commonInit(){
private func commonInit() {
layer.frame = self.bounds
backgroundColor = .clear
update(to: arrowPosition, animated: false)
Expand Down Expand Up @@ -111,7 +113,6 @@ extension ArrowView {
controlPoint1: CGPoint(x: arrowFrame.minX + 0.86212 * frame.width, y: arrowFrame.minY + 0.48781 * arrowFrame.height),
controlPoint2: CGPoint(x: arrowFrame.minX + 0.85246 * frame.width, y: arrowFrame.minY + 0.45044 * arrowFrame.height))


bezierPath.close()
bezierPath.miterLimit = 4
return bezierPath
Expand Down
19 changes: 0 additions & 19 deletions Tests/ArrowsTests/ArrowsTests.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import XCTest
@testable import ArrowsTests

XCTMain([
testCase(ArrowsTests.allTests),
testCase(ArrowsTests.allTests)
])

0 comments on commit 9b3ca05

Please sign in to comment.