Skip to content

Commit

Permalink
Fixed all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
shaps80 committed Nov 25, 2019
1 parent 7fe32cb commit f2faa02
Show file tree
Hide file tree
Showing 35 changed files with 149 additions and 147 deletions.
@@ -1,5 +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/>
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
1 change: 0 additions & 1 deletion Example/Podfile
@@ -1,6 +1,5 @@
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
inhibit_all_warnings!

target 'NotTwitter' do
platform :ios, '9.0'
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
@@ -1,5 +1,5 @@
PODS:
- Peek (5.2.0)
- Peek (5.3.0)

DEPENDENCIES:
- Peek (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
Peek: 77f6362167c00aab3f1147d92d51bdf80d259d45
Peek: 4209f7aa72d00244616f6b4804739c04cae2e457

PODFILE CHECKSUM: 4d57fa80cb864c914f11f3558540be5ea5eba94c
PODFILE CHECKSUM: c29c492fe40889a0ba9734d1c078df79ffe7b766

COCOAPODS: 1.8.4
16 changes: 10 additions & 6 deletions Example/Pods/Local Podspecs/Peek.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 48 additions & 48 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/Peek/Peek-Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/Peek/Peek.xcconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Peek.podspec
Expand Up @@ -3,10 +3,10 @@ Pod::Spec.new do |s|
s.version = "5.3.0"
s.swift_versions = ['5.1']
s.summary = "All new design. Inspect your iOS application at runtime."
s.homepage = "https://shaps.me/peek"
s.screenshots = "https://github.com/shaps80/Peek/raw/master/shot.jpg"
s.homepage = "https://152percent.com/peek"
s.screenshots = "https://images.squarespace-cdn.com/content/v1/58d1c3c1b3db2b27db51464f/1521730411276-S3UCD05HTDG34PWBGM4N/ke17ZwdGBToddI8pDm48kEWP3-hvREnweJ050wvhyvB7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1UdrULnJwJtUwRUNy9fIMUJZw9x8WqpJ4rfPF_qYxQ1vxK19DM50qGfsFZg32uC5Iyw/Peek+Promo+%E2%80%93+No+Logo.jpg?format=2500w"
s.license = 'MIT'
s.author = { "Shaps Mohsenin" => "shapsuk@me.com" }
s.author = { "Shaps Benkau" => "shapsuk@me.com" }
s.source = { :git => "https://github.com/shaps80/Peek.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/shaps'
s.platform = :ios, '9.0'
Expand Down
1 change: 0 additions & 1 deletion Pod/Classes/Accessory Views/ColorAccessoryView.swift
Expand Up @@ -47,7 +47,6 @@ final class ColorAccessoryView: UIView, PeekAccessoryProviding {
override func draw(_ rect: CGRect) {
super.draw(rect)

let stroke = UIColor(white: 1, alpha: 0.1)
let rect = CGRect(x: 8, y: 0, width: size.width, height: size.height).insetBy(dx: 1, dy: 1)
let path = UIBezierPath(roundedRect: rect, cornerRadius: size.height / 2)

Expand Down
2 changes: 0 additions & 2 deletions Pod/Classes/Controllers & Views/Overlays/PeekButton.swift
Expand Up @@ -105,8 +105,6 @@ internal final class PeekButton: UIControl {
super.layoutSubviews()

let size = bounds.height / 2
let rect = CGRect(x: 0, y: 0, width: size, height: size)
let path = UIBezierPath(roundedRect: rect, cornerRadius: size / 2)

visualEffectView.layer.cornerRadius = size
visualEffectView.layer.masksToBounds = true
Expand Down
Expand Up @@ -185,7 +185,7 @@ internal class PeekOverlayView: UIView {

internal func updateHighlights(animated: Bool) {
let primaryFrame = rectForPrimaryView()
var secondaryFrame = rectForSecondaryView()
let secondaryFrame = rectForSecondaryView()

if animated {
UIView.animate(withDuration: 0.2, delay: 0, usingSpringWithDamping: 0.9, initialSpringVelocity: 1.1, options: .beginFromCurrentState, animations: {
Expand Down
20 changes: 5 additions & 15 deletions Pod/Classes/Controllers & Views/PeekInspectorViewController.swift
Expand Up @@ -11,6 +11,7 @@ import UIKit
internal final class PeekInspectorViewController: PeekSectionedViewController, UISearchResultsUpdating {

deinit {
guard let observer = observer else { return }
NotificationCenter.default.removeObserver(observer)
}

Expand Down Expand Up @@ -218,7 +219,6 @@ internal final class PeekInspectorViewController: PeekSectionedViewController, U
if let value = value as? NSObjectProtocol {
var text: String?
var accessoryView: UIView?
var editingAccessoryView: UIView?

switch value {
case let value as UIViewController:
Expand Down Expand Up @@ -309,12 +309,12 @@ extension PeekInspectorViewController {

if #available(iOS 11.0, *) {
navigationController?.navigationBar.largeTitleTextAttributes = [
.foregroundColor: peek.options.theme.titleTextColor(isEditing: tableView.isEditing)
.foregroundColor: peek.options.theme.titleTextColor(isEditing: tableView.isEditing) ?? .black
]
}

navigationController?.navigationBar.titleTextAttributes = [
.foregroundColor: peek.options.theme.titleTextColor(isEditing: tableView.isEditing),
.foregroundColor: peek.options.theme.titleTextColor(isEditing: tableView.isEditing) ?? .black,
.font: UIFont.systemFont(ofSize: 17, weight: .regular)
]

Expand Down Expand Up @@ -364,16 +364,6 @@ extension PeekInspectorViewController {
navigationItem.leftItemsSupplementBackButton = true
navigationItem.setHidesBackButton(false, animated: animated)

let image = ImageRenderer(size: CGSize(width: 44, height: 20)).image { context in
var rect = context.format.bounds
rect.origin.y = 4
rect.size.height = 4
let path = UIBezierPath(roundedRect: rect, cornerRadius: 2)

UIColor(white: 1, alpha: 0.7).setFill()
path.fill()
}

UIView.animate(withDuration: animated ? 0.25 : 0) {
self.navigationController?.navigationBar.backgroundColor = self.peek.options.theme.backgroundColor
self.navigationController?.navigationBar.tintColor = self.peek.options.theme.tintColor
Expand All @@ -398,7 +388,7 @@ extension PeekInspectorViewController {

let sections: [Report.Section] = sectionIndexes.map { index in
let title = activeDataSource.sections[index].group.title
let items = reportingIndexPaths.filter { $0.key.section == index }.flatMap { $0.value }
let items = reportingIndexPaths.filter { $0.key.section == index }.compactMap { $0.value }
return Report.Section(title: title, items: items)
}

Expand Down Expand Up @@ -552,7 +542,7 @@ extension PeekInspectorViewController {
attribute.alternateValues.map {
UIAlertAction(title: $0, style: .default) { action in
let note = action.title ?? ""
let item = Report.Item(keyPath: attribute.keyPath, displayTitle: attribute.title, displayValue: cell?.detailTextLabel?.text ?? "", reportersNote: note ?? "")
let item = Report.Item(keyPath: attribute.keyPath, displayTitle: attribute.title, displayValue: cell?.detailTextLabel?.text ?? "", reportersNote: note)
self?.reportingIndexPaths[indexPath] = item
self?.invalidateSendButton()
self?.indicateSection(for: indexPath)
Expand Down
Expand Up @@ -129,7 +129,7 @@ internal final class PeekPresentationController: UIPresentationController, UIVie

@objc private func dismiss() {
if let nav = presentedViewController as? UINavigationController {
let inspectors = nav.viewControllers.flatMap { $0 as? PeekInspectorViewController }
let inspectors = nav.viewControllers.compactMap { $0 as? PeekInspectorViewController }
if (inspectors.filter { $0.tableView.isEditing }).count > 0 { return }
}

Expand Down
5 changes: 3 additions & 2 deletions Pod/Classes/Controllers & Views/PeekViewController.swift
Expand Up @@ -25,6 +25,7 @@ import UIKit
final class PeekViewController: UIViewController, UIViewControllerTransitioningDelegate {

deinit {
guard let observer = observer else { return }
NotificationCenter.default.removeObserver(observer)
}

Expand Down Expand Up @@ -125,8 +126,8 @@ final class PeekViewController: UIViewController, UIViewControllerTransitioningD
}

@objc private func showInspectors() {
guard let index = peekView.indexesForSelectedItems.last, let model = models[index] as? UIView else { return }
presentInspectorsForModel(model)
guard let index = peekView.indexesForSelectedItems.last else { return }
presentInspectorsForModel(models[index])
}

fileprivate func presentInspectorsForModel(_ model: Peekable) {
Expand Down
2 changes: 1 addition & 1 deletion Pod/Classes/Controllers & Views/Reporting/Report.swift
Expand Up @@ -152,7 +152,7 @@ extension Report {
let reportersNote: String

internal func encode(to encoder: Encoder) throws {
var container = try encoder.container(keyedBy: CodingKeys.self)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(keyPath, forKey: .keyPath)
try container.encode(displayTitle, forKey: .displayTitle)
try container.encode(displayValue, forKey: .displayValue)
Expand Down

0 comments on commit f2faa02

Please sign in to comment.