Skip to content

Create app tutorial view using UICollectionView and a lot of Customization !!!

License

Notifications You must be signed in to change notification settings

nil-biribiri/NilTutorial

Repository files navigation

NilTutorial

CI Status Version License Platform

Create app tutorial view using UICollectionView and a lot of Customization (Including auto scroll)!!!

Preview

Requirements

iOS 8.0+

Xcode 8.3+

Swift 3.0+

Installation

NilTutorial is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NilTutorial'

Usages

Local images set

  let tutorialVC = NilTutorialViewController(imagesSet: []) {
            // Add action afer skip button pressed here
          
        }

Load images set from url (async)

let tutorialVC = NilTutorialViewController(imageURLSet: []) {
            // Add action afer skip button pressed here
           
        }

In AppDelegate

import NilTutorial

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
       
        let tutorialVC = NilTutorialViewController(imagesSet: []) {
            // Add action afer skip button pressed here
            let mainVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "ViewController") as! ViewController
            self.window?.rootViewController = mainVC
        }
        self.window?.rootViewController = tutorialVC
        
        return true
    }

Present new TutorialVC

Preview

import NilTutorial

let appTutorialVC = NilTutorialViewController(imagesSet: []) {
            // Add skip button action here
}
        self.present(appTutorialVC, animated: true, completion: nil)

Add TutorialVC into SubView

Preview

let tutorialVC = NilTutorialViewController(imagesSet: []) {
            // Add action afer skip button pressed here
            print("Skip Button Pressed!!!")
            
            // Remove all child VC
            self.removeAllChildViewController()
            self.subView.removeAllSubViews()
        }
        
        self.configureChildViewController(childController: tutorialVC, onView: self.subView, withFadeAnimate: true)      

Customization

        // Enable auto scrolling 
        turorialVC.enableAutoScroll() 
        
        
        // Set scrolling time interval
        tutorialVC.setAutoScrollTime(seconds: )
        
        
        // Set Skip button title
        tutorialVC.setSkipButtonTitle(title: )


        // Hide Skip button
        tutorialVC.hideSkipButton()


        // Show skip button only last page
        tutorialVC.showSkipButtonLastPage()
        
        
        // Set skip button CGRect
        tutorialVC.setSkipButtonCGRect(cgRect: )
        
        
        // Set image aspect 
        tutorialVC.setImageAspect(imageAspect: )
        
        
        // You can freely set skipButton property 
        DispatchQueue.main.async {
                tutorialVC.skipButton.backgroundColor = UIColor.black
        }

Author

NilNilNil, nilc.nolan@gmail.com

License

NilTutorial is available under the MIT license. See the LICENSE file for more info.

About

Create app tutorial view using UICollectionView and a lot of Customization !!!

Resources

License

Stars

Watchers

Forks

Packages

No packages published