Giter VIP home page Giter VIP logo

myblurintroductionview's Introduction

MYBlurIntroductionView

#####NOTICE: As of February 4th, Apple has begun to ban new app submissions using the common blurring method (UIToolbar hack) found in MYBlurIntroductionView. We will work toward a new solution, but unfortunately this library has removed the blurring functionality until a solution is found. Cheers.

Intro

A Controller Built With You In Mind

It's time for one introduction/tutorial view to end them all! MYBlurIntroductionView is a powerful platform to build introductions for your iPhone apps. Built on the MYIntroductionView core, MYBlurIntroductionView takes the first time user experience to the next level by providing a host of new features for building highly customized introductions.

Features Include

  • Brand new stock panels built for iOS 7
  • Optional overlay on background images
  • Add custom panels straight from .xib files
  • Subclass MYIntroductionPanel (the stock panel) for custom panels with access to new methods like
    • panelDidAppear
    • panelDidDisappear
    • enable/disable
  • Delegates methods for panel change and introduction finishing events
  • iOS 6 and 7 compatible for iPhone (iPad coming soon)
  • Localized Skip Button
  • Right-to-Left Language Support

What to Include

Manual Installation

MYBlurIntroductionView is dependent on the following files and frameworks

  • MYBlurIntroductionView.{h,m}
  • MYIntroductionPanel.{h,m}
  • Uses the QuartzCore framework
  • Requires ARC

CocoaPods

MYBlurIntroductionView is also available for installation through cocoapods by using the following command.

pod 'MYBlurIntroductionView'

For help setting up and maintaining dependencies using CocoaPods check out this link: http://cocoapods.org/

The Process

Creating an introduction view can basically be boiled down to these steps

  1. Create panels
  2. Create and MYIntroductionView
  3. Add MYIntroductionPanels to MYIntroductionView
  4. Show View

Creating Panels

Stock Panels

One goal for MYBlurIntroductionView is to make the creation of stock (or "non-custom") panels just as easy as with MYIntroductionView. That's why the basic interface hasn't changed one bit. All content is optional and rearranges nicely for you. bl

The main panel class is MYIntroductionPanel.{h,m}. It has many different custom init methods for rapid creation of stock panels. Here are a few samples, the first with a header, and the second without.

//Create stock panel with header
UIView *headerView = [[NSBundle mainBundle] loadNibNamed:@"TestHeader" owner:nil options:nil][0];

MYIntroductionPanel *panel1 = [[MYIntroductionPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) title:@"Welcome to MYBlurIntroductionView" description:@"MYBlurIntroductionView is a powerful platform for building app introductions and tutorials. Built on the MYIntroductionView core, this revamped version has been reengineered for beauty and greater developer control." image:[UIImage imageNamed:@"HeaderImage.png"] header:headerView];
    
//Create stock panel with image
MYIntroductionPanel *panel2 = [[MYIntroductionPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) title:@"Automated Stock Panels" description:@"Need a quick-and-dirty solution for your app introduction? MYBlurIntroductionView comes with customizable stock panels that make writing an introduction a walk in the park. Stock panels come with optional overlay on background images. A full panel is just one method away!" image:[UIImage imageNamed:@"ForkImage.png"]];

And here are the end results

Panel1 Panel2

Custom Panels from .xib Files

One of the great things about MYBlurIntroductionView is that you can create the panels for your introduction directly from xib files. These are great for static layouts that do not need any interaction (think text and images).

Creating a custom panel is as easy as using the initWithFrame:nibNamed: for MYIntroductionPanel.

//Create Panel From Nib
MYIntroductionPanel *panel3 = [[MYIntroductionPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) nibNamed:@"TestPanel3"];

This will attach the xib file to a MYIntroductionPanel so it may be used in the introduction view. If you would like to use the stock title/description/header/image and their animations, simply set the desired additional attributes after the instantiation of a panel, and run the buildPanelWithFrame: method. An example can be seen below.

//Instantiate panel
MYIntroductionPanel *panel3 = [[MYIntroductionPanel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) nibNamed:@"TestPanel3"];

//Add custom attributes
panel3.PanelTitle = @"Test Title";
panel3.PanelDescription = @"This is a test panel description to test out the new animations on a custom nib";

//Rebuild panel with new attributes
[panel3 buildPanelWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];

Tip Make sure your autoresize properties are set to scale correctly (everything selected worked best for me). If you don't there may be some problems when you design for 4" screens, but deploy on 3.5".

Custom Panels via Subclassing

If you really want to unleash the full power of MYBlurIntroductionView, you will want to subclass an MYIntroductionPanel. If you do, you gain access to many new methods for creating event driven panels in your introduction.

Event Handling

Perhaps you would like to trigger certain actions to occur on a panel when the introduction reaches it. Now that is fully possible by overriding the panelDidAppear and panelDidDisappear methods. Using these methods you can create dynamic panels that reset when the panel disappears.

Stopping

Say, for intstance, you want to make SURE a user knows how to do something in your app. With your subclass, you may now disable the introduction view until they have completed whatever task you like. Once they have done that task, they may go to the next panel. An example of this can be found using the command [self.parentIntroductionView setEnabled:NO]; in the MYCustomPanel class in the sample application. Here, a button press enables movement to the next panel.

DisabledPanel EnabledPanel

Creating a MYIntroductionView and Adding Panels

Assuming you have made a few panels, creating an instance of MYIntroductionView and adding panels can be done in just a few lines of code.

//Create the introduction view and set its delegate
MYBlurIntroductionView *introductionView = [[MYBlurIntroductionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    introductionView.delegate = self;
    introductionView.BackgroundImageView.image = [UIImage imageNamed:@"Toronto, ON.jpg"];
    //introductionView.LanguageDirection = MYLanguageDirectionRightToLeft;

//Feel free to customize your introduction view here
    
//Add panels to an array
NSArray *panels = @[panel1, panel2, panel3, panel4];
    
//Build the introduction with desired panels
[introductionView buildIntroductionWithPanels:panels];

The buildIntroductionWithPanels method is where all the magic happens. After calling this method, the introduction view is ready to display. To finally show it, simply add it as a subview.

//Add the introduction to your view
[self.view addSubview:introductionView];

To see all this in action, head over to the sample project! It creates an introduction view that uses all types of panels so you can understand all that MYBlurIntroductionView has to offer.

Delegation

MYBlurIntroductionView comes with two delegate methods for interacting with the introduction view.

  • introduction:didChangeToPanel:withIndex:
    • This method will hit every time you change panels. Use this to perhaps change background images or blur color.
  • introduction:didFinishWithType:
    • This method triggers when the introduction view has finished. The type of finish is also provided.

About the Author

Matt York is an iOS, Android and C# developer with the Center for Advanced Public Safety (Github Link). CAPS works to develop cutting edge mobile technology for law enforcement in the state of Alabama. Matt is also the founder of the Intercede social network, available in the app store.

myblurintroductionview's People

Contributors

frankwu100 avatar matthewyork avatar misterwell avatar tspinelli avatar ugort avatar weichnn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

myblurintroductionview's Issues

UIVisualEffectView

I saw your note on Apple rejecting due to using toolbar implementation. UIVisualEffectView with BlurEffect is the trick.

  • Create UIVisualEffectView
  • Set Frame
  • Add as subview

No deal Landscpe

View location and size not right on Landscpe?Better use layout?

Say "Done" or equivalent on last panel

The last panel still has "Skip" which is not really correct, can it be made so on the last panel custom text for "Done" or something can be used to indicate they have reached the end.

display blank image in ios 8.3

i have tried various way to check weather my app is getting UIImage or not, But there is some issue with ios 8.3 only, other version its running fine. kindly guide me

thank in advance.

Unrecognized selector sent to instance

Hi,
thanks for the great pod.
I'm using this in a Swift project, built on Xcode 6.2 beta.
But I'm having this error
[UIView setIsCustomPanel:]: unrecognized selector sent to instance 0x7fdfba507250
when trying to display the view.
My controller code:

class TourViewController: UIViewController, MYIntroductionDelegate {

    override func viewDidLoad() {     
        super.viewDidLoad()
        let frame = CGRectMake(0, 0, view.frame.size.width, view.frame.size.height),
        introductionPanels = [
            MYIntroductionPanel(frame: frame, nibNamed: "WelcomeTour1"),
            MYIntroductionPanel(frame: frame, nibNamed: "WelcomeTour2"),
            MYIntroductionPanel(frame: frame, nibNamed: "WelcomeTour3"),
            MYIntroductionPanel(frame: frame, nibNamed: "WelcomeTour4")
        ],
        introductionView = MYBlurIntroductionView(frame: frame)
        introductionView.buildIntroductionWithPanels(introductionPanels)
        introductionView.delegate = self
        view.addSubview(introductionView)
    }

}

What could be the problem?

Make margin variables

You should transform :
const static CGFloat kTopPadding = 30;
const static CGFloat kLeftRightMargins = 20;
const static CGFloat kBottomPadding = 48;
const static CGFloat kHeaderTitlePadding = 20;
const static CGFloat kTitleDescriptionPadding = 20;
const static CGFloat kDescriptionImagePadding = 20;

in public properties initialized with default values.

Delegate being set to nil?

I'm reasonably-but-not-completely positive I'm not doing anything wrong here, but forgive me if I am.

I have a class which I use to manage the presentation of the introduction, which is an NSObject.

It retains a strong property of type MYBlurIntroductionView, self.introductionView.

After initializing the introduction view, I set self.introductionView.delegate = self.

Examining self.introductionView immediately after calling buildIntroductionWithPanels, the delegate is indeed set to my object instance. However, no delegate methods ever get called, and I found that by adding a breakpoint prior to the calls to delegate methods in the MYBlurIntroductionView class, I'm seeing that its delegate property is now nil.

Has anyone else seen this?

Fast swipe bug [bug]

If i swipe super fast i can't leave introduction view. In your example you it works well. Maybe it's appear because i add MYBlurIntroView to "window" in app delegate?

MYBlurIntroductionView *introductionView = [[MYBlurIntroductionView alloc] initWithFrame:self.window.bounds];
[self.window addSubview:introductionView];

See video
https://www.dropbox.com/s/dkkeczdzcl9c28o/blurbug.mov?dl=0

Allow moving to a specific panel

The following method is defined but not implemented:

-(void)changeToPanelAtIndex:(NSInteger)index

Providing this would give users of the library a way to throw a user back to a specific panel if there is some error condition preventing them from continuing.

MyBlurIntroductionView Rotation

Hello,

Thanks a lot for your great work.

I've a problem with your plugin when I rotate my phone.
I initialize the view with the controller frame and add it with "addSubView" method but when I pass from Portrait to Landscape, the IntroductionView size doesn't update.

How I can do that?

Thanks in advance,

Best regards.

P.S: Some methods are deprecated in iOS7.

crashes when swiping from last panel

Hi,
First of all, I have to say I'm really digging this library! :)
When I'm on the last panel, and I try to swipe to the next one, the app crashes with the error: index 3 beyond bounds [0 .. 2].
Any way of fixing this? Thanks!

Not iOS6 compatible

The description of this github mentions its iOS6 compatible for iPhone. However there are a few things not compatible:

  • use of NSString boundingRectWithSize:options:attributes:context is iOS7, and not available in iOS6. iOS6 still uses NSString sizeWithFont:ContrainedToSize.
  • xib's cannot be compiled because it needs a later version of the SDK.

I propose the xib's be used in a seperate IB based example. Since a lot of developers prefer building their interface completely in code anyway.

`sizeWithFont:constrainedToSize:lineBreakMode: is deprecated.

`sizeWithFont:constrainedToSize:lineBreakMode: is deprecated.

skipStringWidth = [skipString sizeWithFont:kSkipButtonFont constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT) lineBreakMode:NSLineBreakByWordWrapping].width;

Use boundingRectWithSize:options:attributes:context:

Any ideas? I'm new to coding. Thank you!

introductionView setBackgroundColor

Hi, thanks for sharing!

Trying to set colour for the first screen and it seems to be impossible.
[introductionView setBackgroundColor:[UIColor colorWithRed:0.300 green:0.171 blue:0.686 alpha:1.000]];

Delegate works only after switching screens, so it's not possible to do this either.

MYBlurIntroductionView <--> MYIntroductionPanel retain cycle!

I noticed that images contained in panels were not deallocated causing memory warning, there is a retain cycle between the container view (MyBlurIntroductionView) and children (MYIntorductionPanel) because the latter have a strong reference with this one. The property should be changed to assign (MyIntorductionPanel.h, line 27).

App rejection due to use of AMBlurView

Apple has just started rejecting apps that use AMBlurView or MDBlurView.

I have a paid version of my app already approved and it uses this project, but the "lite" version was just reviewed and rejected. When I did a quick search, there are others complaining of the same thing during the last 6 days.

As a quick fix, I just removed the use of AMBlurView from my project.

How to disable skip

Is there a simple way to disable the skip button? For instance, if I want to enforce all panels to be viewed?

I could do it with hard code in your class, but was wondering if there was a better way of doing it from my subclass so I don't have to worry about future updates/changes to the code.

Changing Text Atrributes

This is a great control. I have different background images on each panel. Is there a way to set text attributes for individual panels? Thanks!!

Available on iPad yet?

I have attempted to use this in my iPad app and the only problem seems to be that the view's frame does not properly fit the screen.

Dismiss button?

Hi there,

Is there some sort of dismiss function which I can add to a button?

Also, how can I let this popup only at the first time someone opens the app?

Thank you for your answers.

Love your work btw :)

Using custom fonts doesn't work

Here's my code:

let pane1:MYIntroductionPanel = MYIntroductionPanel.init(
            frame: CGRectMake(0, 0, self.pagerContainer.frame.size.width, self.pagerContainer.frame.size.height),
            title: "Bla bla bla",
            description: "Bli Bla Bloo")
        panel1.PanelSeparatorLine.backgroundColor = UIColor.clearColor()
        panel1.PanelTitleLabel.font = UIFont(name: "MyCustomFont", size: 21)

//init more panels....

self.panels = [panel1, panel2, panel3, panel4, panel5, panel6]
        self.introductionView = MYBlurIntroductionView.init(frame: CGRectMake(0, 0, self.pagerContainer.frame.size.width, self.pagerContainer.frame.size.height))
        self.introductionView?.delegate = self
        self.introductionView?.RightSkipButton.hidden = true
        self.introductionView?.BackgroundImageView.image = nil
        self.introductionView?.backgroundColor = UIColor.clearColor()

        self.introductionView?.buildIntroductionWithPanels(self.panels)

        pagerContainer.addSubview(introductionView!)

The font in the panels seems wrong (both font and size)...
Is there any way to do this correctly?
Same question for both the titles and the descriptions....

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.