Skip to content

Commit

Permalink
add feature of overriding default location of GodEye button
Browse files Browse the repository at this point in the history
  • Loading branch information
zixun committed Mar 30, 2017
1 parent 3dee095 commit fd28a72
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
4 changes: 0 additions & 4 deletions GodEye.xcodeproj/project.pbxproj
Expand Up @@ -38,7 +38,6 @@
9EC3B6201E8CD29C0052EC57 /* ANRRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5DE1E8CD29C0052EC57 /* ANRRecordModel+ORM.swift */; };
9EC3B6211E8CD29C0052EC57 /* CommandRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5DF1E8CD29C0052EC57 /* CommandRecordModel+ORM.swift */; };
9EC3B6221E8CD29C0052EC57 /* CrashRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5E01E8CD29C0052EC57 /* CrashRecordModel+ORM.swift */; };
9EC3B6231E8CD29C0052EC57 /* GodDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5E11E8CD29C0052EC57 /* GodDB.swift */; };
9EC3B6241E8CD29C0052EC57 /* LeakRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5E21E8CD29C0052EC57 /* LeakRecordModel+ORM.swift */; };
9EC3B6251E8CD29C0052EC57 /* LogRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5E31E8CD29C0052EC57 /* LogRecordModel+ORM.swift */; };
9EC3B6261E8CD29C0052EC57 /* NetworkRecordModel+ORM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC3B5E41E8CD29C0052EC57 /* NetworkRecordModel+ORM.swift */; };
Expand Down Expand Up @@ -134,7 +133,6 @@
9EC3B5DE1E8CD29C0052EC57 /* ANRRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ANRRecordModel+ORM.swift"; sourceTree = "<group>"; };
9EC3B5DF1E8CD29C0052EC57 /* CommandRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CommandRecordModel+ORM.swift"; sourceTree = "<group>"; };
9EC3B5E01E8CD29C0052EC57 /* CrashRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CrashRecordModel+ORM.swift"; sourceTree = "<group>"; };
9EC3B5E11E8CD29C0052EC57 /* GodDB.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GodDB.swift; sourceTree = "<group>"; };
9EC3B5E21E8CD29C0052EC57 /* LeakRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "LeakRecordModel+ORM.swift"; sourceTree = "<group>"; };
9EC3B5E31E8CD29C0052EC57 /* LogRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "LogRecordModel+ORM.swift"; sourceTree = "<group>"; };
9EC3B5E41E8CD29C0052EC57 /* NetworkRecordModel+ORM.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NetworkRecordModel+ORM.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -384,7 +382,6 @@
9EC3B5DE1E8CD29C0052EC57 /* ANRRecordModel+ORM.swift */,
9EC3B5DF1E8CD29C0052EC57 /* CommandRecordModel+ORM.swift */,
9EC3B5E01E8CD29C0052EC57 /* CrashRecordModel+ORM.swift */,
9EC3B5E11E8CD29C0052EC57 /* GodDB.swift */,
9EC3B5E21E8CD29C0052EC57 /* LeakRecordModel+ORM.swift */,
9EC3B5E31E8CD29C0052EC57 /* LogRecordModel+ORM.swift */,
9EC3B5E41E8CD29C0052EC57 /* NetworkRecordModel+ORM.swift */,
Expand Down Expand Up @@ -666,7 +663,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9EC3B6231E8CD29C0052EC57 /* GodDB.swift in Sources */,
9EC3B62D1E8CD29C0052EC57 /* Thread.swift in Sources */,
9EC3B6321E8CD29C0052EC57 /* UIScreen+GodEye.swift in Sources */,
9EC3B63D1E8CD29C0052EC57 /* LeakRecordViewModel.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion GodEye/Classes/Configuration/ControlConfiguration.swift
Expand Up @@ -33,7 +33,8 @@ open class ControlConfiguration: NSObject {
/// allowed share to show under the device, default is false
open var shakeShowForDevice = false

// open var location: CGPoint?
/// the origin of GodEye button's Frame
open var location: CGPoint?

//--------------------------------------------------------------------------
// MARK: INTERNAL FUNCTION
Expand Down
28 changes: 0 additions & 28 deletions GodEye/Classes/ORM/GodDB.swift

This file was deleted.

5 changes: 4 additions & 1 deletion GodEye/Classes/UIWindow+GodEye.swift
Expand Up @@ -24,7 +24,10 @@ extension UIWindow {
func makeEye(with configuration:Configuration) {
GodEyeController.shared.configuration = configuration

let rect = CGRect(x: self.frame.size.width - 48, y: self.frame.size.height - 160, width: 48, height: 48)
var rect = CGRect(x: self.frame.size.width - 48, y: self.frame.size.height - 160, width: 48, height: 48)
if let location = configuration.control.location {
rect.origin = location
}

var image = UIImage(named: "GodEye.bundle/eye", in: Bundle(for: GodEyeController.classForCoder()), compatibleWith: nil)
if image == nil {
Expand Down

1 comment on commit fd28a72

@zixun
Copy link
Owner Author

@zixun zixun commented on fd28a72 Mar 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#17

Please sign in to comment.