Debug mode manager for iOS.
Project description
ios-debug
ios-debug
is a tool for creating and managing mock implementation. It currently creates a mock implementation for each repository protocol within an iOS project.
THREE THINGS...
...that the app is expected to have:
- there are repository protocols conforming to
...Repository
naming convention - there is a single
rootViewController
assigned (doesn't matter in which file) - there is a
ContainerBuilder.swift
file withregisterRepositoryLayer
function
INSTALLATION
If you have some version of pip
, either pip ios-debug
or pip3 ios-debug
should do the job.
USAGE
There is a simple console UI that show when ios-debug
is called. Names of the shown options should be pretty self-explanatory :-)
Each command can be also called by passing it as an argument to ios-debug
, e.g. ios-debug start
or ios-debug stop
.
WHEN IT STARTS
When the debug mode is starting, the following happens:
- Swift files are gathered and read
- Repository protocols are found
- Protocols are parsed and function declarations are extracted
- Repository mock implementation template is processed so there is a mock implementation for each protocol function for each repository. Also,
Container
registration are generated, overriding the origin registration. - Registration functions are added to
registerRepositoryLayer
function inContainerBuilder
. MockManager
andShakeableNavigationController
are generated.MockManager
enables user to choose different mock function implementations at runtime.ShakeableNavigationController
is used asrootViewController
. It responds to shake gesterus by showing theMockManager
.
rootViewController
is reassigned toShakeableNavigationController
.- A Run Script build phase is added in order to sync* mock function variants and protocol functions during build.
WHEN IT STOPS
When the debug mode is stopping, the following happens:
- Swift files are gathered and read.
- All mock repositories are gathered and saved to a binary file.
- Calls to registration function are removed from
ContainerBuilder
. MockManager
andShakeableNavigationController
are removed andShakeableNavigationController
is unassigned asrootViewController
.- The Run Script build phase is removed from the project.
*Syncing is basically just turning the debog mode off and on again. The whole process is designed to be a function of the code's state, so there are minimal side effect expectation during the processing.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ios_debug-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d9abec82c0bd0f8b31f56bf471942567468e6abc34ef0c5f5f43dfee7bf599b |
|
MD5 | 9ab9ea180cba579c92eb9d41eb4d1092 |
|
BLAKE2b-256 | 762a269eeaeb0fff705484f303cdeab6210c3e6b9f536e6920285f6ba0de5285 |