reednj / tdsemimodal Goto Github PK
View Code? Open in Web Editor NEWSemi-modal view & DatePicker for IOS
License: MIT License
Semi-modal view & DatePicker for IOS
License: MIT License
in -(void)viewDidLoad
self.coverView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
Static analyzer complains about a potential leak. It may be solved with:
self.coverView = [[[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame] autorelease];
in dealloc it must be like this?
- (void)dealloc {
//self.coverView = nil;
[coverView release];
[super dealloc];
}
If modal view transparency is alpha 0.5 and red or similar, there is a 20 points hole at the top.
I just came across your library while trying to find a framework for implementing modals. However, I don't see a screenshot, animated gif, or video of what your library does. Can you please add a screenshot so that I can see if it will be something that I want to integrate?
Is there a way for the view controller presented by this to receive event calls like willRotateToInterfaceOrientation, didRotateFromInterfaceOrientation?
In -[TDSemiModalViewController viewDidLoad]
self.coverView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
I am currently using KIF for automated UI testing. My app uses TDSemiModal for displaying a date picker.
However, when my KIF tests presents and removes a TDSemiModal, the KIF test hangs and eventually times out with a failure. Digging into the KIF code, I learned that KIF only tolerates animations that last for 0.5 seconds [1].
The problem is that when dismissing the semi modal view controller, the animation delay is set to 0.7 seconds [2]. To work around this issue, I added the following code to UIViewController+TDSemiModalExtension.m:
-(void) dismissSemiModalViewController:(TDSemiModalViewController*)vc {
double animationDelay = 0.7;
#if RUN_KIF_TESTS
animationDelay = 0.3;
#endif
// ...
}
I have opened an issue with KIF about modifying the animation delay, but that does not solve the current problem for the dismissSemiModalViewController method.
I believe that the best solution to this issue is for KIF to fix its code, and users of both codebases to adopt the workaround I noted above. However, adding the above code to the TDSemiModal code is trivial and harmless thanks to the RUN_KIF_TESTS flag.
[1] See KIF / Classes / KIFTestStep.m:282
[2] See UIViewController+TDSemiModalExtension.m
There are plans to continue his development?
When importing this to an ARC-enabled project, it throws errors. Perhaps worth branching to fix?
Hi,
currently the date picker locale is set to US (in the TDDatePickerController.xib file). It must be more correct to use the current device locale.
It can be accomplished in the .xib file or setting to nil the locale property of the Date picker.
I think everyone will appreciate it.
Thank you
Hello,
Thanks for a great library.
I am having only one problem. It takes about 1-2 seconds to open the modal.
Is there a way to speed it up?
I think it will save a lot of code here and make it more readable.
Steps to reproduce the bug
Click on the UI which Activate
[self presentSemiModalViewController:datePickerView];
The normal TDPicker will show up
Click on cancel button which calls
[self dismissSemiModalViewController:datePickerView];
While the UI is dismissing(fading) quickly click on the UI which Activate the Picker again. the picker won't show if pressed before the fading process is completed
Note: I share the same Picker instance
I’ve recently added TDSemiModal to the CocoaPods package manager repo.
CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.
However, TDSemiModal doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.
Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.
In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:
$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags
Modal view and root view is placed on top of the rootview . In some application like mine where the root view moves sometimes outside the window . The picker view produces some weird results.
UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
[mainWindow addSubview:coverView];
[mainWindow addSubview:modalView];
adding that in - (void) presentSemiModalViewController:(TDSemiModalViewController*)vc ;
Solves this problem because the modal view is always shown on top of the window.
Hello,
How can I use it for UIPickerView?
Just as title says, when you press home button and enter again on the app, when showing the controller coverview fade does not works, but only first time. if you launch it again then is ok.
This happens both in real device and in simulator
;)
Regards,
I found that using the code below for determining the orientation works better. In our app we force landscape mode - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation inside a normal modal view and limiting with. With the previous way, the TDSemiModal thought it was still in portrait.
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.