Comments (9)
It is better to do a runtime check and not a compile time check
from armchair.
For now you can force debug mode by doing this
let manager = Manager.defaultManager
let ivar: Ivar = class_getInstanceVariable(manager.dynamicType, "debugEnabled")
let fieldOffset = ivar_getOffset(ivar)
let pointerToInstance = unsafeAddressOf(manager)
UnsafeMutablePointer<Bool?>(pointerToInstance + fieldOffset).memory = true
from armchair.
Sorry, I am not familiar with Carthage so I don't have an exact answer, but you need to find a way to pass the compiler flags to whatever project is actually building the framework and pass the -DDebug
flag there.
Please post back here for the benefit of others if you figure out how.
from armchair.
My first idea was to add this flag on the Armchair project. I am not familiar with Carthage too!
from armchair.
I think that the framework must not check "Debug" flag, but let the caller do the job
It's more a main project issue to know the mode, the configuration bool is sufficient for the framework
in my code I prefer to use my own flag (name) put only in debug scheme, not in release
#if DEBUG // or TEST or TESTARMCHAIR
Armchair.debugEnabled(true)
#endif
With dependencies manager like cocoapod or carthage it's seems not straightforward to add a compil flag automatically
Even If we find a way, the flag will be put for debug and release and no more check will be done (even in release) except if there is config for each scheme...
- sample for cocoapod (maybe there is more short code): https://github.com/OAuthSwift/OAuthSwift/wiki/Work-with-application-extension
- carthage : I make some google search without result yet
I know that we could be disagree because have each time a prompt for rate in a release app will be a big annoyance and maybe many people then will give a lower rate because of that
But I have trust in developpers, maybe I am wrong!!!
Other idea, keep the current code and add an other method not documented in README
for instance unsafeDebugEnabled(..Bool)
maybe a tag to make a warn when compiling
There is another issue that can fix this issue, debugEnabled is used for two things :
- activate debug log
- show always prompt
2 variables will be better or 1 variable for logging and one piece of code to show always prompt with preprocessor macro
from armchair.
I disagree. This way automatically prevents log spam on production builds, even if the developer accidentally left in a debug line.
from armchair.
Doing this will solve the carthage issue. Otherwise you have to specify "carthage build -configuration Debug". I think it creates more confusion that the benefit it brings.
from armchair.
Well, my opinion is that it is still better the current way, but because the Carthage and Cocoapods frameworks don't seem to have easy support for adding compiler flags yet, I am open to changing it until they do.
Please feel free to send over a pull request removing the DEBUG flag behavior, and an updated README to reflect the changes.
from armchair.
To enable the debug mode of Armchair, you have to add --configuration Debug
to your carthage build command
from armchair.
Related Issues (20)
- rateApp() not working, "Write Review" page in AppStore cannot be opened. HOT 3
- Cant figure it out HOT 1
- Multiple Prompts at once HOT 1
- Armchair & UIAlertView HOT 1
- Can't get this working in Debug mode HOT 1
- Mac Version doesn't compile HOT 2
- AlertController not showing up with warning: Attempt to present UIAlertController on UINavigationController whose view is not in the window hierarchy! HOT 1
- Release? HOT 1
- SKStoreReviewController keeps showing even though daysBeforeReminding is set to 3 and significantEventsUntilPrompt is set to 40. HOT 1
- Cannot build with Carthage HOT 2
- Prompt is showing , but after pressing Rate now button not showing , juts infinite loading HOT 1
- Import Error and Shared Instance Error
- Swift 4.0 support
- Incorrect calculation in "RemindMeLater" code
- don't show armchair pop up ever in one particular view controller. HOT 1
- I want to hide cancel/No thanks button and give user 2 options (Rate Now, Remind me later) only.
- package.swift is missing HOT 1
- Major bug with app review! HOT 1
- "Rate app-name" link goes to the app's App Store page, not the "write review" page
- All Armchair .lproj files are included with cocoapods "use_frameworks! :linkage => :static"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from armchair.