Custom viewcontroller container (similar to UIPageViewController), but with no scrolling bounce - ios

Using UIPageViewController as container is pretty straightforward, however, it is extremely hacky to disable its bounce effect. I need help on creating a custom container ViewController (similar to UIPageVC) using UIScrollView and ViewController containment API. Is there any existing repo on github?
thx

I think you can use UICollectionView. You can set up it without bouncing. You can do it with setting alwaysBounceVertical and alwaysBounceHorisontal properties. Read here and here about it. Also UICollectionView is very easy to use and customize. I don't think you need use some external libs or repos.

Related

UIPageViewController custom PageControl

For a project I am working on I would like to modify the looks of the UIPageControl I found out that I could change some things with the appearance method on UIPageControl.
However I would like to change the dot size and spacing. Looking on the internet I came across FXPageControl. Which supports this.
Currently I am loading my UIPageViewController from StoryBoard. And it thus loads a "normal" UIPageControl. How can I make the FXPageControl be loaded instead?
You can't.
You can only don't show default UIPageControl and show & handle FXPageControl manually by yourself in code / xib

Custom Scroll view in cocos2d without using uikit

I currently need to create a custom scroll view without using UIKit's scrollview in cocos2d.
The best way, I think, is to create a separate layer and then add all my sprites to that layer. But I'm not sure how to receive touch events for all of the sprites. Is there a best way to do this? Thanks!
Have you seen CCScrollLayer? It might not be suitable for you but maybe you can copy the way that it is picking up touches.
https://github.com/cocos2d/cocos2d-iphone-extensions/tree/develop/Extensions/CCScrollLayer
http://www.cocos2d-iphone.org/forum/topic/17118
There's another one here as well, not sure if it's a fork or an independent one:
https://github.com/jerrodputman/CCKit
But I didn't have much success with any of these. The bounce and other parts of the experience never feel right, so I go back to using UIScrollView to handle the touches.
I've been facing the same issue and I found the SWScrollView here:
https://github.com/saim80/Cocos2D-Extensions
met my needs better than CCScrollView. It acts more like the UIScrollView where as CCScrollView is more for paging from what I've seen.
There is a nice framework called CMMSimpleFramework.
http://www.cocos2d-iphone.org/forum/topic/39018
http://www.cocos2d-iphone.org/forum/topic/60354
There are some sample videos, and the link to the repo is on those pages.
One of the classes is a scrolling layer that might do what you need.
To get the sample project to run, I had to comment out some game center authentication handler code that has changed, but after I did that the demo worked fine.

Create custom UIButton with multiple images and shift Label and maybe add properties

for an iPad application in ios5.0 and arc, I need to create a button that has an image covering the entire button, and needs to have another transparent image at the bottom half of this button image OR have the button text label covering the bottom half of this button image.
In posts on this site I've read that using button subclass to just change the appearance of the UiButton should not be done. However, if I don't subclass, can I add these transparent image/and shift the button label? if so, how?
In case I need to add properties to the button, what is the best way to go about it.
If subclassing is the only option, can you also pls give pointers on what are the methods that i must absolutely override and any other such memory/performance considerations that I must keep in mind
Pointers to Any tutorials or third party libraries would be most appreciated.. Thanks in advance for all your help
I don't agree on "subclassing UIButton is not good". That's exactly why inheritance and subclassing mechanisms exist. In all platforms, the framework provides a base foundation for general needs, and you do extend them in the case standard stuff does not satisfy your needs. And you do it by subclassing.
As long as you know what you do, and what you do works for you and solves your problem, you're fine.
When you subclass UIButton, depending on what you actually want to achieve, you may want to override init:, initWithRect:, layoutSubviews:, awakeFromNib: methods.
Inspecting some subclasses would also help:
https://github.com/ardalahmet/SSCheckBoxView
https://github.com/ardalahmet/CopyableCell
For UIButton, you can inspect this component. Source code may help a lot.

How to rotate visible iOS keyboard with no UIViewController

I have a UIWindow with a hard-coded UIView inside. I'd prefer to keep it that way, is there a nice way to rotate an already visible keyboard? This question asks the same thing, so I guess I'm really asking if the API used by UIViewController to rotate the keyboard is private API. I'm not going to use it if it is, but I'd still be interested in what it is. And how you found out. Thanks!
UIViewController handles the rotation for your, you really should use one. Don't try to reinvent the wheel, stick to the best practices and you will avoid a lot of unnecessary work.
https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/AppArchitecture/AppArchitecture.html#//apple_ref/doc/uid/TP40007072-CH3-SW18
The UIViewController class is the base class for all view controller
objects. It provides default functionality for loading views,
presenting them, rotating them in response to device rotations, and
several other standard system behaviors

Using UIScrollview to display .xib as different pages?

I think im missing something fundamental here because everyone seems to be able to do this simple task. Im trying to create an app that is very similar in presentation to the iPhone home screen (paging). I plan to have several pages that each have their own unique content. My understanding is that I can use UIScrollview to display and animate these pages/xib's but I have tried what seems like everything and am frustrated by the lack of instructions for newbs like me.
What I understand so far:
Declare IBOutlet UIScrollView *scroller
Set options in .m or in scrollview object via IB
connect fileowner of main .xib to *scroller
connect fileowner of main .xib to delegate
then somehow call in the other xib to load as the pages for the scrollview.
One thing i have found is that most of the tutorials and source codes i get are outdated or look different. Im using xcode 4.2. ANY HELP is greatly appreciated. Thanks!
I'm also a newbie so may be I don't understand your problem exactly but if you want to represent your scroll view in pages you should enable paging for it:
yourCoolScrollView.pagingEnabled = YES;

Resources