Skip to content

A collection of helper function / class to reuse in different projects while building iOS / macOS application.

Notifications You must be signed in to change notification settings

ainopara/Ainoaibo

Repository files navigation

Ainoaibo

A collection of helper function / class to reuse in different projects while building iOS / macOS application.

Aibo is 相棒 in Japanese which means buddy. Aibo will always company with you, no matter which project you are working on.

Structure

Ainoaibo is maintained by ainopara and not supposed to fit everyone's need.

Even though this repo is generally a collection of codes which have many third party dependencies, I tried my best to devide them into different components.

Components

Each component is represented in podspec as subspec. You can import component for your needs.

LoggingProtocol

A shared defination which is used to help Applications / other frameworks create their own Logging helper function to meet the need of OSLogger.

OSLogger

A CocoaLumberjack logger which can utilize information extracted from objects conforming to LoggingProtocol.

let dependency = ["Ainoaibo/LoggingProtocol", "CocoaLumberjack"]

Logging

An internal component which offer helper function for logging which is supposed to be used by other components in this repo.

let dependency = ["Ainoaibo/LoggingProtocol", "CocoaLumberjack"]

DefaultsBasedSettings

A NSUserDefaults backed Settings base class which offer methods to bind key stored in NSUserDefaults to MutableProprty.

let dependency = ["Ainoaibo/Logging", "ReactiveSwift"]

SwiftExtension

A collection of helper function and extension about types in Swift Standard Library.

let dependency = []

InMemoryLogger

Save logs in memory and can be accessed inside application.

let dependency = ["CocoaLumberjack"]

InMemoryLogViewer

Used to inspect logs inside application. It is specially useful when your application encouter a bug that hard to reproduce while debugger is not attaching to the process.

let dependency = ["Ainoaibo/InMemoryLogger", "SnapKit"]

Usage

InMemoryLogViewController is expected to be embedded in a UINavigationController.

let debugTab = UINavigationController(rootViewController:
    InMemoryLogViewController()
)

let tabBarController = UITabBarController(nibName: nil, bundle: nil)
tabBarController.viewControllers = [
    debugTab
]

or

self.navigationController?.pushViewController(InMemoryLogViewController(), animated: true)

Formatters

DateLogFormatter: Insert timestamp at the beginning of every log message.

DispatchQueueLogFormatter: Insert dispatch queue at the beginning of every log message.

ErrorLevelLogFormatter: Insert error level of the message at the beginning of every log message.

let dependency = ["CocoaLumberjack"]

License

BSD

About

A collection of helper function / class to reuse in different projects while building iOS / macOS application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published