All Projects β†’ cats-oss β†’ Degu

cats-oss / Degu

Licence: MIT license
🐭 Degu is debug utility for iOS, tvOS and macOS.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Degu

Opencombine
Open source implementation of Apple's Combine framework for processing values over time.
Stars: ✭ 2,040 (+8400%)
Mutual labels:  tvos, swift-package-manager
SwiftSimctl
Swift client-server tool to call xcrun simctl from your simulator. Automate push notification testing!
Stars: ✭ 50 (+108.33%)
Mutual labels:  tvos, swift-package-manager
Ducttape
πŸ“¦ KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (+475%)
Mutual labels:  tvos, swift-package-manager
Id3tageditor
🎡🎸A Swift library to read and write ID3 Tag of any mp3 file. Supported ID3 tag version: 2.2, 2.3 and 2.4. Supported platform: iOS, macOS, tvOS, watchOS, Linux Ubuntu. 🎡🎸
Stars: ✭ 101 (+320.83%)
Mutual labels:  tvos, swift-package-manager
Mechanica
A cross-platform library of Swift utils to ease your iOS | macOS | watchOS | tvOS and Linux development.
Stars: ✭ 27 (+12.5%)
Mutual labels:  tvos, swift-package-manager
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+44508.33%)
Mutual labels:  tvos, swift-package-manager
Bugsnag Cocoa
Bugsnag crash reporting for iOS, macOS and tvOS apps
Stars: ✭ 167 (+595.83%)
Mutual labels:  tvos, debugging-tool
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+3983.33%)
Mutual labels:  tvos, swift-package-manager
xxHash-Swift
xxHash framework in Swift.
Stars: ✭ 22 (-8.33%)
Mutual labels:  tvos, swift-package-manager
Amplitude Ios
Native iOS/tvOS/macOS SDK
Stars: ✭ 216 (+800%)
Mutual labels:  tvos, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+4966.67%)
Mutual labels:  tvos, swift-package-manager
tracelog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.
Stars: ✭ 52 (+116.67%)
Mutual labels:  tvos, swift-package-manager
Waterfallgrid
A waterfall grid layout view for SwiftUI.
Stars: ✭ 1,086 (+4425%)
Mutual labels:  tvos, swift-package-manager
Surmagic
πŸš€ The better way to deal with Binary Frameworks on iOS, Mac Catalyst, tvOS, macOS, and watchOS. Create XCFrameworks with ease.
Stars: ✭ 119 (+395.83%)
Mutual labels:  tvos, swift-package-manager
Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+4066.67%)
Mutual labels:  tvos, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+558.33%)
Mutual labels:  tvos, swift-package-manager
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (+2570.83%)
Mutual labels:  tvos, swift-package-manager
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+3916.67%)
Mutual labels:  tvos, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+637.5%)
Mutual labels:  tvos, swift-package-manager
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (+1091.67%)
Mutual labels:  tvos, swift-package-manager

DEGU

platforms Swift4.1 License
Carthage SwiftPM Version

If you want to get all events of an application, you can get events from UIApplication.sendEvent(_:). But, following implementations are needed to get events from it.

/* MyApplication.swift */

class MyApplication: UIApplication {
    override sendEvent(_ event: UIEvent) {
        super.sendEvent(event)
        print(event)
    }
}
/* main.swift */

private let applicationClassName: String = {
    #if DEBUG
        return NSStringFromClass(MyApplication.self)
    #else
        return NSStringFromClass(UIApplication.self)
    #endif
}()

UIApplicationMain(
    CommandLine.argc,
    UnsafeMutableRawPointer(CommandLine.unsafeArgv)
        .bindMemory(
            to: UnsafeMutablePointer<Int8>.self,
            capacity: Int(CommandLine.argc)),
    applicationClassName,
    NSStringFromClass(AppDelegate.self)
)
/* AppDelegate.swift */

// @UIApplicationMain <- comment out
class AppDelegate: UIResponder, UIApplicationDelegate {
    ...
}

Degu makes them easy!!

Usage

1. ApplicationProxy

This is an example. There are only 2 implementations what you have to.

  • set a delegate to ApplicationProxy.shared.delegate
  • implement ApplicationProxyDelegate
import Degu

class AppDelegate: UIResponder, ApplicationDelegate {
    ...

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        #if DEBUG
        ApplicationProxy.shared.delegate = self
        #endif

        ...

        return true
    }

    ...
}

extension AppDelegate: ApplicationProxyDelegate {
    func applicationProxy(_ proxy: ApplicationProxy, didSendEvent event: UIEvent) {
        print(event)
    }
}

In addition, you can get lifecycle method call of all ViewControllers.

func applicationProxy(_ proxy: ApplicationProxy, didCallLifeCycle lifeCycle: ViewControllerLifeCycle, ofViewController viewController: UIViewController) {
    print("ViewController = \(viewController)")
    print("LifeCycle = \(lifeCycle)")
}

2. Override load or initialize method

+(void)load and +(void)initialize are not permitted by Swift.

You can override +(void)load and +(void)initialize in Extension of RuntimeHandler.

extension RuntimeHandler {
    open override class func handleLoad() {
        // do something
    }

    open override class func handleInitialize() {
        // do something
    }
}

⚠️ handleLoad and handleInitialize are not called Subclass of RuntimeHandler. It only works in Extension of RuntimeHandler.

Installation

Carthage

If you’re using Carthage, simply add Degu to your Cartfile:

github "cats-oss/Degu"

CocoaPods

Degu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Degu'

Swift Package Manager

If you’re using Swift Package Manager, simply add Degu to your Package.swift:

dependencies: [
    .package(url: "https://github.com/cats-oss/Degu", from: "0.2.0")
]

Requirements

  • Xcode 11.1
  • Swift 5.1

License

Degu is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].