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
...Repositorynaming convention - there is a single
rootViewControllerassigned (doesn't matter in which file) - there is a
ContainerBuilder.swiftfile withregisterRepositoryLayerfunction
INSTALLATION
If you have some version of pip, either pip install ios-debug or pip3 install 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,
Containerregistration are generated, overriding the origin registration. - Registration functions are added to
registerRepositoryLayerfunction inContainerBuilder. MockManagerandShakeableNavigationControllerare generated.MockManagerenables user to choose different mock function implementations at runtime.ShakeableNavigationControlleris used asrootViewController. It responds to shake gesterus by showing theMockManager.
rootViewControlleris 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. MockManagerandShakeableNavigationControllerare removed andShakeableNavigationControlleris 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
File details
Details for the file ios-debug-0.1.6.tar.gz.
File metadata
- Download URL: ios-debug-0.1.6.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
399e579c75d4ad1cb6f6fce976918d4499600e2ea1b937c82a11c2fceb8bce25
|
|
| MD5 |
1d929859440cfe0295a1ca1683af33b2
|
|
| BLAKE2b-256 |
106b359968dfdffb5d5fd63450237f7e91d51c5494f5165a27b4570591687126
|