ealeksandrov / eaintroview Goto Github PK
View Code? Open in Web Editor NEWHighly customizable drop-in solution for introduction views.
License: MIT License
Highly customizable drop-in solution for introduction views.
License: MIT License
Currently, it is not possible to use EAIntroView under iOS 5.0. The following lines causes an exception:
self.pageControl.translatesAutoresizingMaskIntoConstraints = NO;
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.pageControl attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]];
[self addConstraint:[NSLayoutConstraint constraintWithItem:self.pageControl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.skipButton attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
at buildFooterView
.
In EAIntroView.m, line 185 in buildUI method the background color should not be black. Set it to clearColor or make it customizable
self.backgroundColor = [UIColor clearColor];
It's a step forward to achieve this: #71
add the ability to set/change the view alpha in order to create transparent overlays over the user interface.
EAIntroPage *page1;
page.alpha = 0.5f;
Hello,
I have added two buttons inside all pages of the intro view :
[self.intro hideWithFadeOutDuration:0.2 ];
and show the container view of the intro view which id a login view that have a uinavigationcontroller[self.intro hideWithFadeOutDuration:0.2 ];
and push the sign up view using the uinavigationcontrollerThe problem is : hitting the back button causes the introview to show up again instead of just back to the login view that pushes the sign up view, here is an animated GIF that shows the problem :
Link : https://f.cloud.github.com/assets/4885143/1316238/abd5fa70-3292-11e3-9282-2cdf674a419c.gif
Image :
here is the actions of the two buttons :
-(void)loginClicked:(UIButton *)sender
{
[self.intro hideWithFadeOutDuration:0.2 ];
self.navigationController.navigationBarHidden = NO ;
}
- (IBAction)SignUpClicked:(UIButton *)sender
{
[self.intro hideWithFadeOutDuration:0.2 ];
self.navigationController.navigationBarHidden = NO ;
SignupViewController *signUp = [[SignupViewController alloc] initWithNibName:@"SignupViewController" bundle:nil];
[self.navigationController pushViewController:signUp animated:YES];
}
Setting the pageControlY value doesn't seem to do anything in iOS 8. Is anyone else having this issue?
Downloaded zip need password? Can anyone else confirm this issue?
if the view is dealloced while still scrolling it will crash with:
EXC_BAD_ACCESS
on:
[UIScrollView(UIScrollViewInternal) _delegateScrollViewAnimationEnded]
I've came across these kind of exceptions before in other controls and even in UICollectionView (just gooogle: _delegateScrollViewAnimationEnded).
This issue can be fixed easily by setting the scrollView.delegate to nil on dealloc:
-(void)dealloc {
self.scrollView.delegate = nil;
}
I use showIntroWithCustomViewFromNib method and try to add UIButton(signup) on nib. And then link button to an action. And the error happen:
reason: '-[EAIntroPage show:]: unrecognized selector sent to instance
so is it possible to add UIButton without edit EAIntroView source code?
thanks a lot.
There are any plans to support layout constraints for all UI elements (e.g title and description)? For example, in an iPad could be useful to have a full support for portrait/landscape.
Hi,
somehow, the pageControlY
value is not working on iOS8.
This is a screenshot from iOS7, with pageControlY = 140.0f;
:
This is a screenshot from iOS8, the code is exactly the same:
As you can see, the PageControl is all the way up at the top of the screen.
It seems, that on iOS8, pageControlY
does not do anything at all, because no matter what value i set, the pageControl is always at the top of the screen.
Please is possible implement the view for iPad?
If the view rotating don't rotating the interface.
Thz.
Great work.
;)
It might me nice to have some method that allows you to either reload the visible / current page or all the pages:
[introView reloadCurrentPagewithPage:page];
[intoView reloadPages:pages];
There is custom code in - (void)buildScrollView; to call pageAppeared for page 0:
if ([(id)self.delegate respondsToSelector:@selector(intro:pageAppeared:withIndex:)]) {
[self.delegate intro:self pageAppeared:_pages[0] withIndex:0];
}
But the problem is that buildScrollView is called from the init. When creating EAIntroView, you initialize and then set the delegate. Since the delegate is set after, pageAppeared won't be called on the first page 0. If you page to page 1 and then back to page 0, it will be called.
Hello,
1/ I want to add buttons in all pages, the same buttons just like Wunderlist app you can see it in action in this screen shot
after adding them how can I handle their actions, in other word, if the user is viewing for example the second page and then he clicked on the "sign up" button how to handle that
2/ I want to avoid the "Intro callback", I just want to implement for example 4 pages, when the user reach the last page he is stack there he only can back to previous views or click the buttons implemented in "1/"
Hi! I need to call the IntroView from differents View Controllers in a differents moments and I want redirect to the correct destination in both cases when the tutorial finished. How can implement this in a introDidFinish without using segues? It's possible?
Hi,
I'm probably doing something wrong (or failed to find the correct documentation) but the library doesn't look to work properly in Landscape on iOS7. It does present the view properly in term of dimension but the scroll (and the pages) will stay as the app is in portrait.
Any idea what am I doing wrong?
Issue #19 is a closed issue that discusses orientation.
The demo app does not implement the orientation fixes.
Hi fellows,
Testing on iOS 6.0, description still disappears randomly. In this case, its width is 0.
Philippe
If you want to make the skipButton like this GIF,
first you need to add one boolean type variable.
I named this penguinSkip.
And in EAIntroView.m 449line, there are if
syntax about skipButton.
I little modified there like this.
#pragma mark FadingSkipButton
if(self.skipButton) {
if (self.penguinSkip == YES) {
if(!self.showSkipButtonOnlyOnLastPage) {
[self.skipButton setAlpha:1.0];
} else if(page < (long)[self.pages count] - 2) {
[self.skipButton setAlpha:0.0];
} else if(page == [self.pages count] - 1) {
[self.skipButton setEnabled:NO];
[UIView animateWithDuration:1.24f delay:0.84f options:UIViewAnimationOptionTransitionNone animations:^{
[self.skipButton setAlpha:1.0f];
[self.skipButton setEnabled:YES];
} completion:^(BOOL finished) {
if (finished) {
self.penguinSkip = NO;
}
}];
} else {
}
} else {
if(!self.showSkipButtonOnlyOnLastPage) {
[self.skipButton setAlpha:1.0];
} else if(page < (long)[self.pages count] - 2) {
[self.skipButton setAlpha:0.0];
} else if(page == [self.pages count] - 1) {
[self.skipButton setAlpha:(1 - alphaValue)];
} else {
[self.skipButton setAlpha:alphaValue];
}
}
}
}
and in 560 line just add this code like this.
- (void)setSkipButton:(UIButton *)skipButton {
[_skipButton removeFromSuperview];
if (self.penguinSkip) {
[skipButton setAlpha:0.0f];
[skipButton setEnabled:NO];
} _skipButton = skipButton;
[_skipButton addTarget:self action:@selector(skipIntroduction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_skipButton];
}
That's it!
Now you can use it with [introView setPenguinSkip:YES]
And you control skipButton's delay and animation time in [UIView animateWithDuration:1.24f delay:0.84f options:UIViewAnimationOptionTransitionNone animations:
If you have any question, then comment here. Thanks.
Here is my situation.
I managed to display my button in the titleView. But somehow the button is not fired when I click on it.
The titleView is created by my custom view from an xib file. I even tried it with a callback method but no luck
How to fix this issue?
Do I have to create a custom button just to set the title from "Skip" to "Skip now" ? Because
introView.skipButton.titleLabel?.text = "Skip now"
is not working.
EAIntroView/EAIntroView.m:155:146: sizeWithFont:constrainedToSize:lineBreakMode:
is deprecated: first deprecated in iOS 7.0 - Use -boundingRectWithSize:options:attributes:context:
Hi.
The method showInView: animateDuration generates automatically bad access
In my viewdidload i wrote this
EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds];
[intro setPages:@[page1,page2,page3,page4,page5]];
[intro setDelegate:self];
intro.skipButton.hidden = TRUE;
intro.titleViewY = 10;
[intro showInView:self.view animateDuration:0.0];
It's possibile to hide or disable the SKIP command?
Or to activate it only on the last page?
I'm using your EAIntroView control, it works amazing, it is just what I needed but I have a few problems right now.
Which size should be a background image to show properly on iPhone 3GS/4? I have a 640x920 image but it doesn't show all of it. It gets cut about an 80% of height.
I tried resizing the image to taller and shorter values but shows exactly the same portion of image.
Do I need to change any property of the intro view / page ?
On the iPad if you Rotate it to Landscape the Title and Description labels disappear.
Any ideas?
When I add the line: pod 'EAIntroView', '~> 2.2.0' to my podfile I get the following error.
Pod::DSLError - Invalid EAIntroView.podspec
file: undefined method `social_media_url=' for #<Pod::Specification name="EAIntroView">
s.social_media_url = 'https://twitter.com/ealeksandrov'
-------------------------------------------
/Users/XXXXX/.cocoapods/repos/master/EAIntroView/2.2.0/EAIntroView.
Hello guys, have use with SMPageControl? or play with EAIntroView example?
I find a bug, and I will show solution.
Have you ever seen this View?
Yeah. It's a EAIntroView example.
But, this example has BUG.
Do you see skipButton? This skipButton is too big, like something is hidden.
So, I will kill this skipButton.
Oh deer. What is it? We have two pageControl??
And this pageControl not works. So it's just a waste.
This waste is remained, when we arrange with SMPageControl.
So,, how can we get this waste out?
It's simple.
go to EAIntroView.m
then you can find - (void)applyDefaultsToSelfDuringInitializationWithframe:(CGRect)frame pages:(NSArray *)pagesArray
function.
Find it? Then modify this line
self.pageControlY = 60.0f;
to
self.pageControlY = 0.0f;
or You can make a function.
i make a function like this.
- (void)hidePageControl {
self.pageControlY = 0.0f;
}
then you just a call it. It's clear.
One of the very recent release broke one my apps which uses a UISplitViewController:
Not sure what changes broke it in EAIntroView, but last pull was from a few weeks ago and there was no issue then (and my app code has not changed in that area).
I'll send a sample project by email.
The build currently places all subtext on the first view in iOS 8 (devs only) - will this be fixed before the rollout in the fall? :) Thanks!
Is there a way to tell EAIntroView that you're going to be on a 3.5" screen (iPhone 4S) so that it won't squash the background and title images?
Index out of bounds exception is thrown when:
Solution is adding the following on line 666 of EAIntroView.m:
_currentPageIndex = currentPageIndex;
Hi, I want to use your rather awesome library, but I need a fadeout transition in between background images rather than a cross dissolve, will that be possible.
Do you have any ideas?
Thanks.
Would I be able to add two buttons in a XIB file โ where tapping on a button could perform custom actions โ such as sign up for account?
In your example, your XIB file has a UISwitch, is it possible to trigger action when user toggles the switch?
Pages created using EAIntroPage:pageWithCustomView: don't respond to their skip button.
Gestures work though.
Thanks for making a really useful library! I really like it!
I thought it would be cool if users can go to the next page just by tapping screens, since I found some people don't figure out how to swipe and just leave apps or tap the Skip button right away.
I have some crash reports with the following:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A constraint cannot be made between a leading/trailing attribute and a right/left attribute. Use leading/trailing for both or neither.'
All reports came from devices running iOS8. The problems lies in (EAIntroView.m:354)
EAIntroView can cause a crash in iOS8 that is hard to debug. It is due to some constraints in buildFooterView. Commenting them out makes it work. Not submitting a PR because I want to see how it works without constraints, but wanted to leave a note to avoid other people going through this process:
//[self addConstraint:[NSLayoutConstraint constraintWithItem:self.pageControl attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]];
//[self addConstraint:[NSLayoutConstraint constraintWithItem:self.pageControl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.skipButton attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]];
self.skipButton.translatesAutoresizingMaskIntoConstraints = NO;
//[self addConstraint:[NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1 constant:-30]];
//[self addConstraint:[NSLayoutConstraint constraintWithItem:self.skipButton attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeBottom multiplier:1 constant:-20]];
And the error:
'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A constraint cannot be made between a leading/trailing attribute and a right/left attribute. Use leading/trailing for both or neither.'
*** First throw call stack:
(0x182a44be4 0x1924841ac 0x182a44b24 0x183a2cfd4 0x1838ba180 0x1002af18c 0x1002aca1c 0x1002ab7ec 0x1002ab5f8 0x1000fee68 0x1000db5e4 0x1000db510 0x1000dac04 0x100243f74 0x100243a3c 0x10026ed5c 0x192ad5b20 0x192ad5ae0 0x192ad977c 0x1829fc688 0x1829fa730 0x182928bd4 0x18b86b60c 0x18707aa0c 0x1000fe9ac 0x192afaa08)
libc++abi.dylib: terminating with uncaught exception of type NSException
Is it possible to have an init from Storyboard? So you could place the introView in the storybard and then in the viewcontroller's viewdidload make a call to set the pages?
I guess this falls into the reload pages bit? I'm finding that by adding the introview in code it does not follow the autolayout setup in the storyboard?
so for example if starting in landscape the images appear ok but when rotating to portrait the introview remains in portrait...
Feature to be able to set the page index would be nice.
I can't get the intro view to run when using Swift. Just to make sure, I wrote the same code in Objective-C and it worked.
The error I'm getting is
2014-07-24 20:31:21.973 introview[5381:532663] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
Below is the code I have in viewDidLoad
var page1 = EAIntroPage()
page1.title = "Title 1"
page1.desc = "Page 1 description"
var page2 = EAIntroPage()
page2.title = "Title 2"
page2.desc = "Page 2 description"
var introView = EAIntroView(frame: self.view.frame, andPages: [page1, page2])
introView.showInView(self.view, animateDuration: 0.3)
Hello, is there a support for iOS 6? Swipe is working in iOS 7, but not in iOS 6.
I downloaded this class of zip, And I established 4 classes to Xcode project.
When I build my project, it became fail.
Failed cause is EAIntroPage.h.
I want to download the source that has been modified.
Or, please tell me how do fix this code.
version:
Xcode6.1.1
OS X Yosemite 10.10.1
Is there a way to prevent the intro view from being removed after swiping past the last page?
I would like to use your control on my login screen to provide a slideshow to provide info about my app to encourage people to signup. See attached image. When the user swipes past the last page I want to transition page to the first page. And if someone swipes right on the first page I would like to go to the last page.
Hi
Strange that the icon image view and title view is totally fine in iOS 6/7, but in iOS 6 the description is totally invisible. Not sure it's gone or just position isn't correct. Anyone encountered this before? Thanks.
There is an obvious bug that - (void)setCurrentPageIndex:(NSInteger)currentPageIndex animated:(BOOL)animated forgot to set new value, i.e.
_currentPageIndex = currentPageIndex; //forgot to write this
The behaviour of the swipe gesture is quite erratic. Sometimes I swipe a couple of views and stop to response in one direction, of during some seconds. Perhaps it's due to a wrong config from my side. Anybody with this issue?. By the way I'm using the storyboard integrated view
Hi, can i do something like this ?
I have 4 pages, but on page 3 i want user press a button for go to the last page, blocking if they try to swipe.
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.