Skip to content

Commit

Permalink
code lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Zawadsky committed Feb 18, 2020
1 parent 34dd1fa commit 0f99e80
Show file tree
Hide file tree
Showing 76 changed files with 687 additions and 652 deletions.
6 changes: 5 additions & 1 deletion PDFReadIt.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
E6B1EC5C23FA9A6300892634 /* InkSettingsToolsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6B1EC5A23FA9A6300892634 /* InkSettingsToolsCell.xib */; };
E6B1EC6023FA9BB000892634 /* InkSettingsToolCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6B1EC5E23FA9BB000892634 /* InkSettingsToolCollectionCell.swift */; };
E6B1EC6123FA9BB000892634 /* InkSettingsToolCollectionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6B1EC5F23FA9BB000892634 /* InkSettingsToolCollectionCell.xib */; };
E6FBF4CF23FC6B7A00AF3758 /* PDFReaderViewController+Delegates.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6FBF4CE23FC6B7A00AF3758 /* PDFReaderViewController+Delegates.swift */; };
E7C9FA3222350A55003FBCB6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E7C9FA3122350A55003FBCB6 /* Assets.xcassets */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -149,6 +150,7 @@
E6B1EC5A23FA9A6300892634 /* InkSettingsToolsCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InkSettingsToolsCell.xib; sourceTree = "<group>"; };
E6B1EC5E23FA9BB000892634 /* InkSettingsToolCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InkSettingsToolCollectionCell.swift; sourceTree = "<group>"; };
E6B1EC5F23FA9BB000892634 /* InkSettingsToolCollectionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InkSettingsToolCollectionCell.xib; sourceTree = "<group>"; };
E6FBF4CE23FC6B7A00AF3758 /* PDFReaderViewController+Delegates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PDFReaderViewController+Delegates.swift"; sourceTree = "<group>"; };
E7C9FA3122350A55003FBCB6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -219,6 +221,7 @@
48AB3AC423E86A170064A89F /* ThumbnailGrid */,
48AB3AC523E86A200064A89F /* Outline */,
14155C7F1F0A425F00A53380 /* PDFReaderViewController.swift */,
E6FBF4CE23FC6B7A00AF3758 /* PDFReaderViewController+Delegates.swift */,
140E24F61F0A675900298665 /* PDFBookmarkViewController.swift */,
);
path = PDFViewControllers;
Expand Down Expand Up @@ -365,11 +368,11 @@
E6650E2123F5B34600F311D4 /* Extensions */ = {
isa = PBXGroup;
children = (
E6B1EC4923FA94BE00892634 /* Drawing */,
E6B0B77023F6F2750018327E /* ColorPicker */,
E6650E2223F5B35C00F311D4 /* UIViewController+Extensions.swift */,
E6650E2423F5CEBA00F311D4 /* UIView+Extensions.swift */,
E6B0B75223F6B5DF0018327E /* PDFPageChangePanGestureRecognizer.swift */,
E6B1EC4923FA94BE00892634 /* Drawing */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -631,6 +634,7 @@
E6B1EC5523FA94BF00892634 /* PDFPage+Selection.swift in Sources */,
E6B0B76423F6DA930018327E /* InkSettingsFillColorCell.swift in Sources */,
140E25141F0AB67C00298665 /* ActionMenuViewController.swift in Sources */,
E6FBF4CF23FC6B7A00AF3758 /* PDFReaderViewController+Delegates.swift in Sources */,
48C91EAC23E9A1EA0014DF44 /* PagesSelectionTableViewCell.swift in Sources */,
48C91EB223E9AC4F0014DF44 /* PagesRangeSelectionTableViewCell.swift in Sources */,
48AB3AC323E8665F0064A89F /* PDFViewGestureRecognizer.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion PDFReadIt/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

let url = Bundle.main.url(forResource: "Sample", withExtension: "pdf")
let document = PDFDocument(url: url!)!
Expand Down
16 changes: 8 additions & 8 deletions PDFReadIt/Classes/Extensions/ColorPicker/ChromaAddButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@

import UIKit

open class ChromaAddButton: UIButton {
open var color = UIColor.gray {
class ChromaAddButton: UIButton {
var color = UIColor.gray {
didSet {
if let layer = circleLayer {
layer.fillColor = color.cgColor
layer.strokeColor = color.darkerColor(0.075).cgColor
}
}
}
override open var frame: CGRect { //update on frame change
override var frame: CGRect { //update on frame change
didSet {
self.layoutCircleLayer()
self.layoutPlusIconLayer()
}
}
open var circleLayer: CAShapeLayer?
open var plusIconLayer: CAShapeLayer?
var circleLayer: CAShapeLayer?
var plusIconLayer: CAShapeLayer?

override public init(frame: CGRect) {
super.init(frame: frame)
Expand All @@ -51,7 +51,7 @@ open class ChromaAddButton: UIButton {
self.createGraphics()
}

open func createGraphics() {
func createGraphics() {
circleLayer = CAShapeLayer()
self.layoutCircleLayer()
circleLayer!.fillColor = color.cgColor
Expand All @@ -70,14 +70,14 @@ open class ChromaAddButton: UIButton {
self.layer.addSublayer(plusIconLayer!)
}

open func layoutCircleLayer() {
func layoutCircleLayer() {
if let layer = circleLayer {
layer.path = UIBezierPath(ovalIn: self.bounds).cgPath
layer.lineWidth = frame.width * 0.04 //4 for size (100,100)
}
}

open func layoutPlusIconLayer() {
func layoutPlusIconLayer() {
if let layer = plusIconLayer {
let plusPath = UIBezierPath()
plusPath.move(to: CGPoint(x: self.bounds.width/2 - self.bounds.width/8, y: self.bounds.height/2))
Expand Down

0 comments on commit 0f99e80

Please sign in to comment.