Toshiro Sugii

3pods
Call setDraggingEnabled:
to make a UIView draggable.
You can restrict the dragging area throught setDraggingEdgeInsets:
.
As Apple API docs said:
Positive values cause the frame to be inset (or shrunk) by the specified amount. Negative values cause the frame to be outset (or expanded) by the specified amount.
So, if you want to make UIView draggable to the left, restricting top and bottom, you can set your UIEdgeInsets as:
``` [self.myview setDraggingEdgeInsets:UIEdgeInsetsMake(0.f, -self.myview.frame.size.width, 0.f, 0.f)];
```
``` - (void)setDraggingEnabled:(BOOL)draggingEnabled; - (BOOL)isDraggingEnabled;
TXDragAndDrop is available through CocoaPods. To install it, simply add the following line to your Podfile:
ruby
pod "TXDragAndDrop"
Copyright (c) 2015 Toshiro Sugii
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License: MIT
+ (void)swizzleSelector:(SEL)originalSelector to:(SEL)newSelector;
We can exchange [NSString uppercaseString] with [NSString lowercaseString] calling:
[NSString swizzleSelector:@selector(uppercaseString) to:@selector(lowercaseString)];
TXSwizzling is available through CocoaPods. To install it, simply add the following line to your Podfile:
ruby
pod "TXSwizzling"
Copyright (c) 2015 Toshiro Sugii
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License: MIT
It automatically resizes you UIView when keyboard appears.
It can be used with any kind of UIViews.
If your view extends a UIScrollView, you need to adjust your UIScrollView.contentSize.
First, choose the UIView that is going to be resized when keyboards appears.
Then, you need to check your Autolayout configuration or Autoresize values.
Here, i am going to use Autoresize as it is a little bit easier in that case.
With autoresize configured, when UIView resizes, our UITextField is positioned automaticaly.
Now we can call startKeyboardResizerObserver(WithDelegate:) inside our UIViewController:
``` - (void)viewDidLoad { [super viewDidLoad];
[self.scrollView startKeyboardResizerObserverWithDelegate:self]; } ``` We must remember stop observing when we are done with keyboard:
``` - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated];
[self.scrollView stopKeyboardResizerObserver]; } ```
And then, you can adjust your view per need:
- (void)viewWillResize:(UIView *)view;
- (void)viewDidResize:(UIView *)view;
- (void)viewDidTap:(UIView *)view;
We can close the keyboard, for example:
- (void)viewDidTap:(UIView *)view
{
for (UIView *subview in self.scrollView.subviews)
{
if ([subview isMemberOfClass:[UITextField class]])
[((UITextField *)subview) resignFirstResponder];
}
}
iOS 6.+
TXViewKeyboardResizer is available through CocoaPods. To install it, simply add the following line to your Podfile:
ruby
pod "TXViewKeyboardResizer"
TXViewKeyboardResizer is available under the MIT license. See the LICENSE file for more info.
License: MIT