Git Product home page Git Product logo

aromajoin / material-showcase-ios Goto Github PK

View Code? Open in Web Editor NEW
358.0 9.0 126.0 4.82 MB

✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.

Home Page: https://aromajoin.com/

License: Other

Ruby 1.77% Objective-C 1.22% Swift 96.83% Shell 0.17%
ios-showcase material-design material-showcase feature-discovery tutorial-show tap-target-view taptargetview swift objective-c cocoapods

material-showcase-ios's People

Contributors

congnguyen91 avatar danielcardonarojas avatar ezefire avatar f2m2rd avatar florianhidayat avatar gpryan avatar happiehappie avatar husseinhj avatar joshoconnor89 avatar kellyhuberty avatar meninblack007 avatar prscx avatar quangctkm9207 avatar rebe1one avatar rezamagnet avatar vahidvdn avatar vasadulin avatar vv60 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

material-showcase-ios's Issues

Delegate methods not working while View inherit the delegates and no option to set backgroundViewType

no option to set backgroundViewType

showcase.backgroundViewType = .full is not available.

Delegate methods not working while View inherit the delegates.

I have create a new class name as tempViewClass which inherit UIView, In that tempViewClass i have implemented the showcase. i called that tempViewClass in HomeViewController to show particular view. then i called the function to show that showcase. Everything showing perfect. but the delegate method is not working.. i have set showcase.delegate = self and implemented delegate methods in both classes.
Note: For testing purpose i have implemented delegate in both classes. implementing in individual classes also not working. Delegate is not working in your sample project also

Unable to compile on XCode 10

Hello, i am getting errors when compiling material showcase in XCode 10. Can you please update the pod with the support of swift 4.2

SecondaryLabel.frame on ipad

Hi, you have a little bug. Please check place where you calculate frame for secondaryLabel on iPad.
In this place you set radius
if UIDevice.current.userInterfaceIdiom == .pad { radius = 300.0 } else { radius = containerView.frame.width }
and i think you forgot about it there:

secondaryLabel.frame = CGRect(x: xPosition, y: yPosition, width: containerView.frame.width - xPosition, height: LABEL_DEFAULT_HEIGHT)

Is the library published on cocoapods?

Hi,

When I am trying to install this library using pod install it is giving me below error:

[!] Unable to find a specification for `MaterialShowcase`

I did a search on cocoapods, it is not showing any results

Am I missing anything? Can you please guide me on how to install the library

Thanks,
Pranav

barButtonItems must be customView?

setTargetView(barButtonItem: barItem) does not work if the barButtonItem is created with an image or text. There is no "view" attribute to attach as a target.

property 'showcase.backgroundViewType' not found

I want to customise the size of background circle as it going to be done by the property "showcase.backgroundViewType = .full" in documentation. But when I try to access this property I got issue as: Value of type 'MaterialShowcase' has no member 'backgroundViewType'.

Please tell any alternative option to customise the background view size

showcase.setTargetView(tabBar: ...) not working correctly

Trying to get the tutorial to load the tabBar, but for whatever reason it isn't working. Any ideas?

screen shot 2017-11-20 at 9 09 48 pm

func showShowcase() {
let showcase = MaterialShowcase()
showcase.setTargetView(tabBar: self.tabBarController!.tabBar, itemIndex: 1) // always required to set targetView
showcase.primaryText = "Home"
showcase.secondaryText = "Tap here for stats on your overall portfolio performance. All values are based on current prices and the weighted average accounting method."

    // Background
    showcase.backgroundPromptColor = UIColor.fromHex(hexString: "38A0BA")
    showcase.backgroundPromptColorAlpha = 1.0
    // Target
    showcase.targetTintColor = UIColor.black
    showcase.targetHolderRadius = 44
    showcase.targetHolderColor = UIColor.white
    // Text
    showcase.primaryTextColor = UIColor.white
    showcase.secondaryTextColor = UIColor.white
    showcase.primaryTextSize = 28
    showcase.secondaryTextSize = 16
    showcase.primaryTextFont = UIFont.systemFont(ofSize: 28, weight: .heavy)
    showcase.secondaryTextFont = UIFont.systemFont(ofSize: 16, weight: .light)
    // Animation
    showcase.aniComeInDuration = 0.5 // unit: second
    showcase.aniGoOutDuration = 0.5 // unit: second
    showcase.aniRippleScale = 1.5
    showcase.aniRippleColor = UIColor.white
    showcase.aniRippleAlpha = 0.2
    
    showcase.show(completion: {
        // You can save showcase state here
        // Later you can check and do not show it again
    })
}

`

AddTarget method iskind of class not entering

  private func addTarget(at center: CGPoint) {
    targetCopyView = targetView.snapshotView(afterScreenUpdates: true)
    
    if shouldSetTintColor {
      targetCopyView.setTintColor(targetTintColor, recursive: true)
      
      if targetCopyView is UIButton {
        let button = targetView as! UIButton
        let buttonCopy = targetCopyView as! UIButton
        buttonCopy.setImage(button.image(for: .normal)?.withRenderingMode(.alwaysTemplate), for: .normal)
        buttonCopy.setTitleColor(targetTintColor, for: .normal)
        buttonCopy.isEnabled = true
      } else if targetCopyView is UIImageView {
        let imageView = targetView as! UIImageView
        let imageViewCopy = targetCopyView as! UIImageView
        imageViewCopy.image = imageView.image?.withRenderingMode(.alwaysTemplate)
      } else if let imageViewCopy = targetCopyView.subviews.first as? UIImageView,
        let labelCopy = targetCopyView.subviews.last as? UILabel {
        let imageView = targetView.subviews.first as! UIImageView
        imageViewCopy.image = imageView.image?.withRenderingMode(.alwaysTemplate)
        labelCopy.textColor = targetTintColor
      } else if let label = targetCopyView as? UILabel {
        label.textColor = targetTintColor
      }
    }
    
    let width = targetCopyView.frame.width
    let height = targetCopyView.frame.height
    targetCopyView.frame = CGRect(x: 0, y: 0, width: width, height: height)
    targetCopyView.center = center
    targetCopyView.translatesAutoresizingMaskIntoConstraints = true
    
    addSubview(targetCopyView)
  }

targetCopyView = targetView.snapshotView(afterScreenUpdates: true)

targetCopyView returns an UIReplicantView and cannot determine which kind of class should it enter in the if-else statement

Property `targetHolderRadius` not found

Strangely, I can't seem to set the targetHolderRadius value - tells me the property is not found.

targetTintColor and targetHolderColor isn't a problem, but just can't seem to see targetHolderRadius.

Objective C project, and installed material-showcase-ios via cocoapods.

I'll keep seeing what I can find, but pretty odd.

Image button as target

Hey everyone,
I'm trying to use the material showcase library with an image button as the target.
However, when my app starts, the button is replaced with a plain color blue version of it, hiding all the details of the image... I tried to change the color parameters to clear or even comment some of them, but it didn't fix it. The image is still replaced by a plain color version of itself...
Is it the way the library is intended to work?

Thanks for your help!

swift 2.3 support

i have a legacy project in swift 2.3,how do i make this compatible with it?

Delegate callback not working

Hello @quangctkm9207,

Just checked on master repo, delegate callbacks are not working anymore. App is not able to get dismiss callback on the delegates.

extension ViewController: MaterialShowcaseDelegate {
  @objc func showCaseWillDismiss(showcase: MaterialShowcase) {
    print("Showcase \(showcase.primaryText) will dismiss.")
  }
    
  @objc func showCaseDidDismiss(showcase: MaterialShowcase) {
    print("Showcase \(showcase.primaryText) dimissed.")
    print("tutorialStep = \(tutorialStep)")
}

I guess there has bene some breaking changes in last two releases of the library. But seems to working for 0.6.0 & previous.

Not TargetHolderView to be Rectangle for UITableViewCell

Hi @quangctkm9207

Thanks for such an handy library. I tried using this library which works like charm but when I add it to custom tableView, I am not able to get the actual effect of Showcase in Rectangle. (Though its working fine if defined the radius , but then it shows in TargetHolderView in Circle)

Below is the code snippet :

class func showShowcaseForTableSection(tableview : UITableView, viewController : UIViewController,  showcasetype : ShowCaseType, section: Int, row: Int){
        
        let showcase = MaterialShowcase()
        showcase.setTargetView(tableView: tableview, section: section, row: row)
        showcase.primaryText = showcasetype.primaryText
        showcase.secondaryText = ""
//        showcase.targetHolderRadius = 80 // Just need to ignore this, as I was rectangle targetHolder
//        showcase.targetHolderColor = UIColor.white
        showcase.shouldSetTintColor = false // Tried using this as well as
        showcase.backgroundPromptColor = UIColor.darkHotPink
        showcase.isTapRecognizerForTagretView = false
        showcase.delegate = viewController as? MaterialShowcaseDelegate
        showcase.show(completion: { DataManager.sharedInstance.tutorialStepsCounter += 1 })
    }

Can you help me out where I am making the mistake or I doubt, if this gonna work with custom tableViewCells too.

Click event on showcase

Hi,
I have one question How can i check event click for example when showcase show first tab item after user click on it I want to show next tab item as show case. How can I do this?
Another question is how can I change default background color of circle?

Thanks,
vafa

Multiline text goes out of screen

Hey,

great library! :)

I am having troubles with the secondaryText (primaryText might be affected is well). If the string is too long, the text goes off screen instead of line-breaking to a second line.

Cheers

showcase can not find JJFloatingActionButton as a target

i am using JJFloatingActionButton library for my button and i want to set this button as a target of showcase but after running my app showcase target is somewhere else.
this my code

defining button:
actionButton = JJFloatingActionButton()
view.addSubview(actionButton)
actionButton.translatesAutoresizingMaskIntoConstraints = false
actionButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16).isActive = true
actionButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16).isActive = true

and the picture is my app after running, the target should be green button at the right of screen!
2

How can i detect when user tapped right to targetView?

How can i detect when user tapped right to targetView? Just for now, i can handle only when showcase view will or did close by tapping anywhere. It's bad practice, because we force user to do second tap to same place.

showcaseview auto dismiss in 2nd show

Hello. I have 2 time to show showCase, first is ok. when click to dismiss, in showCaseDidDismiss function i take new show case. But it auto dismiss when showed. Can you take a look:

INIT (called on viewdidload)

    func initShowcase() {
        showCase.backgroundPromptColor = .darkGray
        showCase.shouldSetTintColor = false
        showCase.targetHolderColor = UIColor.clear
        showCase.delegate = self
    }

FIRST ( called in get data function)

 @objc func getVideoData() {
        NWUtil.shared.getData(url: "...", params: nil, success: { (response) in
            ...
                if !UserDefaults.standard.bool(forKey: INTRO_MAPVIEW){
                    self.showCase.setTargetView(barButtonItem: self.bttMap)
                    self.showCase.primaryText = "Bản đồ"
                    self.showCase.secondaryText = "Bạn có thể xem tất cả camera trên bản đồ."
                    self.showCase.show(completion: {
                        UserDefaults.standard.set(true, forKey: INTRO_MAPVIEW)
                        UserDefaults.standard.synchronize()
                    })
                }
            }
             ...
        }) { (error) in
       ....
        }
    }

SECOND

func showCaseDidDismiss(showcase: MaterialShowcase, didTapTarget: Bool) {
       print("Showcase \(showcase.primaryText) dimissed.")
       
       if !UserDefaults.standard.bool(forKey: INTRO_GROUPVIEW){
           self.showCase.setTargetView(barButtonItem: self.bttGroup)
           self.showCase.primaryText = "Nhóm camera"
           self.showCase.secondaryText = "Bạn có thể xem tất cả camera theo danh sách nhóm."
           DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
               self.showCase.show(completion: {
                   UserDefaults.standard.set(true, forKey: INTRO_GROUPVIEW)
                   UserDefaults.standard.synchronize()
               })
           }
           
       }
   }

Showcase.show Error

Hey I use swift 4 and iOS 11.4
showcase.show(completion: { _ in // You can save showcase state here })
have problems

Cannot convert value of type '(_) -> ()' to expected argument type '(() -> Void)?'
Who is the Error?

Showcase showing misplaced from assigned target view?

I want to display showcase for button so I code for that but it shows in misplaced from assigned target view.

I have set the target view for '+' symbol button in the following screen shot.
First Screenshot
image-21

But showcase shows in away from target view, I have provide the screenshot for the issue.
Second Screenshot
image-1

And Here I provide the code what I am tried.
`override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
showButtonShowcase(newInspectionBtn)
}

//MARK: - display showcase
func showButtonShowcase(_ sender: UIButton) {
    let showcase = MaterialShowcase()
    showcase.setTargetView(view: sender)
    showcase.backgroundViewType = .circle
    showcase.targetTintColor = UIColor.clear
    showcase.targetHolderColor = UIColor.clear
    showcase.primaryText = "Add Inspection"
    showcase.secondaryText = "Click here to go into details"
    showcase.shouldSetTintColor = false // It should be set to false when button uses image.
    showcase.isTapRecognizerForTagretView = true
    showcase.show(completion: {
        print("==== completion Action 1.1 ====")
        // You can save showcase state here
    })
}`

Please help and find me what wrong I do this code and how to fix the issue.

instructions frame on iPad

Hi,
Thanks for your cool component,
but there is a bug on iPad: the instructions labels (both primary and secondary) are drawn out of the circle.

Autolayout to UIButton not focus properly

Issues :

When I set an auto layout to UIButton, the background image of the UIButton will be displayed on the top left corner of the screen instead of that correct original position.

Please give me suggestion for that

crash: 0 MaterialShowcase 0x10405e0 _T016MaterialShowcaseAAC14layoutSubviewsyyF + 6752

A crash:

library version:0.1.4
iOS 9.3.5

logs:

Crashed: com.apple.main-thread
0 MaterialShowcase 0x10405e0 _T016MaterialShowcaseAAC14layoutSubviewsyyF + 6752
1 MaterialShowcase 0x103ebfc _T016MaterialShowcaseAAC14layoutSubviewsyyF + 124
2 MaterialShowcase 0x104084c _T016MaterialShowcaseAAC14layoutSubviewsyyFTo + 28
3 UIKit 0x26202a73 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 714
4 QuartzCore 0x2429abcd -[CALayer layoutSublayers] + 128
5 QuartzCore 0x24296375 CA::Layer::layout_if_needed(CA::Transaction*) + 348
6 QuartzCore 0x24296209 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
7 QuartzCore 0x242956d1 CA::Context::commit_transaction(CA::Transaction*) + 368
8 QuartzCore 0x242953a5 CA::Transaction::commit() + 520
9 QuartzCore 0x2428eb2b CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 138
10 CoreFoundation 0x21c4d6c9 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 20
11 CoreFoundation 0x21c4b9cd __CFRunLoopDoObservers + 280
12 CoreFoundation 0x21c4bdff __CFRunLoopRun + 958
13 CoreFoundation 0x21b9b229 CFRunLoopRunSpecific + 520
14 CoreFoundation 0x21b9b015 CFRunLoopRunInMode + 108
15 GraphicsServices 0x2318bac9 GSEventRunModal + 160
16 UIKit 0x2626f189 UIApplicationMain + 144
17 PrintOSMobile 0xe78af main (main.m:14)
18 libdispatch.dylib 0x21843873 (Missing)

Custom target view

Hi,

If my target view inside the custom view which is added in the UIViewController's view then it's target view drawn outside the custom view. It's working fine in case of navigation item.

Move the instructionView frame (y position)

Hi,

Is there a way to move the Y position of the instructionView? Now it's fixed whatever the targetHolderRadius is. Which is not practical since the holder circle can overlap the text when its radius is big.

Thanks

Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value at: let center = calculateCenter(at: targetView, to: containerView)

Hey I have a while implementing this pod, and recently this problem starts to show up.
First I think that was a problem of mine, that maybe I delete my variable or image where was attached, at end few times works and rest no.

Always launching an error (Fatal error: Unexpectedly found nil while unwrapping an Optional value) in:

func initViews() {
    let center = calculateCenter(at: targetView, to: containerView)
    
    addTargetRipple(at: center)
    addTargetHolder(at: center)
    addTarget(at: center)
    addInstructionView(at: center)
    instructionView.layoutIfNeeded()
    addBackground()

    // Add gesture recognizer for both container and its subview
    addGestureRecognizer(tapGestureRecoganizer())
    // Disable subview interaction to let users click to general view only
    for subView in subviews {
      subView.isUserInteractionEnabled = false
    }
  }

I can't build second time

I need to clean build for succeed build. But after that i take this error

fatal error: lipo: can't open input file: /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase (No such file or directory)
Merging extracted architectures: arm64
fatal error: lipo: can't open input file: /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase-arm64 (No such file or directory)
rm: /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase-arm64: No such file or directory
Replacing original executable with thinned version
rm: /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase: No such file or directory
mv: rename /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase-merged to /Users/gokmen/Library/Developer/Xcode/DerivedData/DeMarke-foivturhjbqmezgplcmvaycxgbrx/Build/Products/Debug-iphoneos/DeMarke.app/Frameworks/MaterialShowcase.framework/MaterialShowcase: No such file or directory

How to save showcase status here?

I want to display showcase at first time the view was loaded only, after I don't want to Display that how to save the status of showcase and control it for not showing next times in following completion.

showcase.show(completion: { // You can save showcase state here // Later you can check and do not show it again })

overlapping texts

Hi @quangctkm9207

Thanks for such an handy library. I tried using this library which works like charm but i have a problem with it,
this is kinda wierd but sometimes (it doesn't follow a certain pattern)sometimes when the user see's the showcase the text is kinda overlapped check the pic bellow.
i dont know why this happens :
it's like the showcase is showing two of the showcase at the same time but whit diffrent positions
1537784143137

iOS 10 target placement issue

I am seeing this in iOS 10 - It may exist in other versions, but it was just reported by a users. The target placement is placed in the wrong location and button highlighting seems to be incorrect as well.

simulator screen shot - ipad pro 12 9 inch - 2018-05-19 at 09 12 57

targetTintColor not working?

My button bar have white color, after set target tint to red. It not working.

screen shot 2018-08-04 at 15 36 10
screen shot 2018-08-04 at 15 36 18

func initShowcase() {
        showCase.backgroundPromptColor = .darkGray
        showCase.targetTintColor = .red
    }
 self.showCase.setTargetView(barButtonItem: self.bttMap) // always required to set targetView
                self.showCase.primaryText = "Bản đồ"
                self.showCase.secondaryText = "Bạn có thể xem tất cả camera trên bản đồ."
                self.showCase.show(completion: {
                    // You can save showcase state here
                    // Later you can check and do not show it again
                })

Weird line in target

Weird line appear in view
look at image please help .

Code:
let showcaseTrafficBleat = MaterialShowcase() showcaseTrafficBleat.setTargetView(tabBar: tabBar, itemIndex: 1) showcaseTrafficBleat.primaryText = NSLocalizedString("Traffic Bleat", comment: "") showcaseTrafficBleat.secondaryText = NSLocalizedString("Your chance to become an active participant in making our roads a safer place, for all of us.", comment: "") showcaseTrafficBleat.backgroundPromptColor = UIColor.black showcaseTrafficBleat.targetHolderRadius = 50 showcaseTrafficBleat.primaryTextAlignment = .justified showcaseTrafficBleat.secondaryTextAlignment = .justified showcaseTrafficBleat.targetHolderColor = UIColor.clear showcaseTrafficBleat.targetTintColor = UIColor.clear showcaseTrafficBleat.show(completion: nil)

img_0821

ios 11 Problem

I have crash problem in

`/ MARK: - UIView extension utility
extension UIView{

// Create a view's copy
func copyView() -> AnyObject{
    return NSKeyedUnarchiver.unarchiveObject(with: NSKeyedArchiver.archivedData(withRootObject: self))! as AnyObject
}

// Transform a view's shape into circle
func asCircle(){
    self.layer.cornerRadius = self.frame.width / 2;
    self.layer.masksToBounds = true
}

}`

can you help me?

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.