Skip to content

Commit

Permalink
Update dependencies and circleci configuration (jjochen#148)
Browse files Browse the repository at this point in the history
* update dependencies

* remove CODE_SIGNING_REQUIRED=NO for tests

* reintegrate cocoapods

* add device agnostic snapshot for iPhone X on iOS 11.4

* use xcode 9.4 and iOS 11.4 on circle ci

* upgrade to recommended project settings

* hr in readme

* swiftformat, resolve linter warnings

* improve tests for JJCircleView (does not fix problem with coverage: http://www.openradar.me/40734694)
  • Loading branch information
jjochen authored Jun 21, 2018
1 parent 60d7e80 commit db9c187
Show file tree
Hide file tree
Showing 16 changed files with 183 additions and 155 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 2
defaults: &defaults

macos:
xcode: "9.1.0"
xcode: "9.4.0"

shell: /bin/bash --login -eo pipefail

Expand Down Expand Up @@ -76,8 +76,8 @@ jobs:
<<: *defaults

environment:
DESTINATION: platform=iOS Simulator,OS=11.1,name=iPhone X
SIMULATOR: iPhone X (11.1) [
DESTINATION: platform=iOS Simulator,OS=11.4,name=iPhone X
SIMULATOR: iPhone X (11.4) [

steps:
- checkout
Expand Down
173 changes: 81 additions & 92 deletions Example/JJFloatingActionButton.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -67,7 +66,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
41 changes: 24 additions & 17 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
PODS:
- FBSnapshotTestCase (2.1.4):
- FBSnapshotTestCase/SwiftSupport (= 2.1.4)
- FBSnapshotTestCase/Core (2.1.4)
- FBSnapshotTestCase/SwiftSupport (2.1.4):
- FBSnapshotTestCase/Core
- iOSSnapshotTestCase (3.0.0):
- iOSSnapshotTestCase/SwiftSupport (= 3.0.0)
- iOSSnapshotTestCase/Core (3.0.0)
- iOSSnapshotTestCase/SwiftSupport (3.0.0):
- iOSSnapshotTestCase/Core
- JJFloatingActionButton (0.9.2)
- Nimble (7.0.3)
- Nimble-Snapshots (6.3.0):
- Nimble-Snapshots/Core (= 6.3.0)
- Nimble-Snapshots/Core (6.3.0):
- FBSnapshotTestCase (~> 2.0)
- Nimble (7.1.2)
- Nimble-Snapshots (6.7.1):
- Nimble-Snapshots/Core (= 6.7.1)
- Nimble-Snapshots/Core (6.7.1):
- iOSSnapshotTestCase (~> 3.0)
- Nimble (~> 7.0)
- Quick (1.2.0)
- Quick (1.3.0)

DEPENDENCIES:
- JJFloatingActionButton (from `../`)
- Nimble
- Nimble-Snapshots
- Quick

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- iOSSnapshotTestCase
- Nimble
- Nimble-Snapshots
- Quick

EXTERNAL SOURCES:
JJFloatingActionButton:
:path: ../
:path: "../"

SPEC CHECKSUMS:
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
iOSSnapshotTestCase: 23984ffe05289728d646cbb6a7a10b4fb1c93440
JJFloatingActionButton: 15cdcbef3c733b6b103484e64066b99f07ad486f
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
Nimble-Snapshots: f5459b5b091678dc942d03ec4741cacb58ba4a52
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
Nimble: 3835ba9f459daa6b347f8a8e110aaae8ca1920a8
Nimble-Snapshots: 7ab1d5fd4a794b983805c6f6b8091fb00d772754
Quick: 03278013f71aa05fe9ecabc94fbcc6835f1ee76f

PODFILE CHECKSUM: 8c19971bc03b1102942bae8dc764247c0986032d

COCOAPODS: 1.4.0
COCOAPODS: 1.5.3
32 changes: 26 additions & 6 deletions Example/Tests/JJCircleViewSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,36 @@ import Quick

class JJCircleViewSpec: QuickSpec {
override func spec() {
describe("JJCircleView loaded from xib") {
describe("JJCircleView") {
var circleView: JJCircleView?

beforeEach {
let bundle = Bundle(for: type(of: self))
circleView = bundle.loadNibNamed("JJCircleView", owner: nil)?.first as? JJCircleView
context("loaded from xib") {
beforeEach {
let bundle = Bundle(for: type(of: self))
circleView = bundle.loadNibNamed("JJCircleView", owner: nil, options: nil)?.first as? JJCircleView
}

it("exists") {
expect(circleView).toNot(beNil())
}

it("looks correct") {
expect(circleView) == snapshot()
}
}

it("looks correct") {
expect(circleView) == snapshot()
context("created programatically") {
beforeEach {
circleView = JJCircleView(frame: CGRect(x: 0, y: 0, width: 50, height: 50))
}

it("exists") {
expect(circleView).toNot(beNil())
}

it("looks correct") {
expect(circleView) == snapshot()
}
}
}
}
Expand Down
Binary file added ...es/JJCircleViewSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ...es/JJCircleViewSpec/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 24 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
Expand All @@ -12,12 +12,12 @@ GEM
atomos (0.1.2)
claide (1.0.2)
clamp (0.6.5)
cocoapods (1.4.0)
cocoapods (1.5.3)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.4.0)
cocoapods-core (= 1.5.3)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.1.3, < 2.0)
cocoapods-downloader (>= 1.2.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
Expand All @@ -27,17 +27,17 @@ GEM
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.6.4)
molinillo (~> 0.6.5)
nap (~> 1.0)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.4, < 2.0)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-clean (0.0.1)
cocoapods-core (1.4.0)
cocoapods-core (1.5.3)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.1.3)
cocoapods-downloader (1.2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
Expand All @@ -50,15 +50,15 @@ GEM
colorize (0.8.1)
concurrent-ruby (1.0.5)
escape (0.0.4)
faraday (0.14.0)
faraday (0.15.2)
multipart-post (>= 1.2, < 3)
faraday-http-cache (2.0.0)
faraday (~> 0.8)
ffi (1.9.23)
fileutils (1.0.2)
ffi (1.9.25)
fileutils (1.1.0)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.2)
gh_inspector (1.1.3)
github_changelog_generator (1.14.3)
activesupport
faraday-http-cache
Expand All @@ -69,7 +69,7 @@ GEM
retriable (~> 2.1)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.9.1)
jazzy (0.9.3)
cocoapods (~> 1.0)
mustache (~> 0.99)
open4
Expand All @@ -80,27 +80,27 @@ GEM
xcinvoke (~> 0.3.0)
liferaft (0.0.6)
minitest (5.11.3)
molinillo (0.6.4)
molinillo (0.6.5)
multi_json (1.13.1)
multipart-post (2.0.0)
mustache (0.99.8)
nanaimo (0.2.3)
nanaimo (0.2.5)
nap (1.1.0)
netrc (0.11.0)
octokit (4.8.0)
octokit (4.9.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (3.0.2)
rainbow (3.0.0)
rake (12.3.0)
rb-fsevent (0.10.2)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
retriable (2.1.0)
rouge (2.0.7)
ruby-macho (1.1.0)
sass (3.5.5)
ruby-macho (1.2.0)
sass (3.5.6)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -118,12 +118,12 @@ GEM
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.5.6)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.9)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.5)
xcpretty (0.2.8)
rouge (~> 2.0.7)

Expand All @@ -143,4 +143,4 @@ DEPENDENCIES
xcpretty!

BUNDLED WITH
1.16.1
1.16.2
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Floating Action Button for iOS

Until reaching milestone 1.0.0 there might be breaking changes in minor versions!

----

<p align="center">
<img src="https://img.shields.io/badge/Swift-4.0-orange.svg" alt="Swift 4.0" />
<a href="https://cocoapods.org/pods/JJFloatingActionButton"><img src="https://img.shields.io/cocoapods/v/JJFloatingActionButton.svg?style=flat" alt="Version" /></a>
Expand Down
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def xcodebuild_test(destination)
" -sdk iphonesimulator" \
" -destination \"#{destination}\"" \
" -enableCodeCoverage YES" \
" CODE_SIGNING_REQUIRED=NO" \
" CODE_SIGN_IDENTITY=" \
" PROVISIONING_PROFILE=" \
" | xcpretty --report junit && exit ${PIPESTATUS[0]}"
Expand Down
8 changes: 4 additions & 4 deletions Sources/AnimationConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ import Foundation
var index: Int = 0
for item in items {
let angle = JJItemAnimationConfiguration.angleForItem(at: index, numberOfItems: numberOfItems, actionButton: actionButton)
let dx = radius * cos(angle)
let dy = radius * sin(angle)
let horizontalDistance = radius * cos(angle)
let verticalDistance = radius * sin(angle)

item.circleView.centerXAnchor.constraint(equalTo: actionButton.centerXAnchor, constant: dx).isActive = true
item.circleView.centerYAnchor.constraint(equalTo: actionButton.centerYAnchor, constant: dy).isActive = true
item.circleView.centerXAnchor.constraint(equalTo: actionButton.centerXAnchor, constant: horizontalDistance).isActive = true
item.circleView.centerYAnchor.constraint(equalTo: actionButton.centerYAnchor, constant: verticalDistance).isActive = true

index += 1
}
Expand Down
11 changes: 8 additions & 3 deletions Sources/JJFloatingActionButton+Placement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ import UIKit
///
/// - Remark: On iOS prior to iOS 11 `safeAreaInset` is ignored.
///
func display(inView superview: UIView, bottomInset: CGFloat = 16, trailingInset: CGFloat = 16, safeAreaInset: CGFloat = 0) {
func display(inView superview: UIView,
bottomInset: CGFloat = 16,
trailingInset: CGFloat = 16,
safeAreaInset: CGFloat = 0) {
superview.addSubview(self)
translatesAutoresizingMaskIntoConstraints = false

Expand Down Expand Up @@ -94,9 +97,11 @@ import UIKit
///
/// - Remark: On iOS prior to iOS 11 `safeAreaInset` is ignored.
///
func display(inViewController viewController: UIViewController, bottomInset: CGFloat = 16, trailingInset: CGFloat = 16, safeAreaInset: CGFloat = 0) {
func display(inViewController viewController: UIViewController,
bottomInset: CGFloat = 16,
trailingInset: CGFloat = 16,
safeAreaInset: CGFloat = 0) {
if let superview = viewController.view {

display(inView: superview, bottomInset: bottomInset, trailingInset: trailingInset, safeAreaInset: safeAreaInset)
var bottom: NSLayoutConstraint

Expand Down

0 comments on commit db9c187

Please sign in to comment.