aromajoin / material-showcase-ios

✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.
https://aromajoin.com/
Other
363 stars 128 forks source link

Secondary text getting cropped after updating to 0.7.1 from 0.6.6 #129

Open amodkanthe opened 4 years ago

amodkanthe commented 4 years ago

Observed secondary title is getting cropped after updating to 0.7.1

Following is my code

` func addCoachMarks() {

let indexPaths = appHomeTableView.indexPathsForVisibleRows
var coachMarks = [MaterialShowcase]()
for index in indexPaths ?? [] {
if let homeCell = appHomeTableView.cellForRow(at: index) as? HomeFlightTableViewCell {
    let showCaseAirportCode = createCoachMarks(primaryText: AppLocalString.COACH_CHANGE_AIRPORT_PRIMARY, secondaryText: AppLocalString.COACH_CHANGE_AIRPORT_SCONDARY)
    showCaseAirportCode.setTargetView(view: homeCell.airportCountryNameLbl)
    showCaseAirportCode.targetHolderRadius = (homeCell.airportNameStackView.frame.width / 2) + (homeCell.airportCodeView.frame.width / 2)
    coachMarks.append(showCaseAirportCode)
    let showCaseTrackFlight = createCoachMarks(primaryText: AppLocalString.COACH_TRACK_FLIGHT_PRIMARY, secondaryText: AppLocalString.COACH_TRACK_FLIGHT_SCONDARY)
    showCaseTrackFlight.setTargetView(view: homeCell.trackFlightStackView)
    showCaseTrackFlight.targetHolderRadius = homeCell.trackFlightBtn.frame.width / 2
    coachMarks.append(showCaseTrackFlight)
}
else if let cellExplore = appHomeTableView.cellForRow(at: index) as? SmallIconsTableViewCell  {
    let showCaseFacilities = createCoachMarks(primaryText: AppLocalString.COACH_EXPLORE_PRIMARY, secondaryText: AppLocalString.COACH_EXPLORE_SCONDARY)
    showCaseFacilities.setTargetView(tableView: appHomeTableView, section: index.section, row: index.row)
    coachMarks.append(showCaseFacilities)
}
}
if tabBarController?.tabBar.items?.count ?? 0 > 1 {
let showcaseTabbar = createCoachMarks(primaryText: AppLocalString.COACH_BOTTOMBAR_PRIMARY, secondaryText: AppLocalString.COACH_BOTTOMBAR_SECONDARY)
showcaseTabbar.setTargetView(tabBar: tabBarController?.tabBar ?? UITabBar(), itemIndex: 1)
coachMarks.append(showcaseTabbar)
}
for coachMark in coachMarks {
coachMark.backgroundPromptColor = UIColor.hexStringToUIColor(hex: AppStrings.accentColor)
sequence.temp(coachMark)
}
sequence.setKey(key: "App_Home_Coach").start()
}`

`
func createCoachMarks(primaryText : String , secondaryText : String) -> MaterialShowcase { let showcase = MaterialShowcase() showcase.delegate = self showcase.primaryText = primaryText showcase.secondaryText = secondaryText showcase.aniRippleColor = .white showcase.targetHolderColor = .none showcase.primaryTextFont = FontStyle.ProximaNovaSemibold(size: 16) showcase.secondaryTextFont = FontStyle.ProximaNovaRegular(size: 14) //showcase.alpha = 0.95 //showcase.backgroundColor = .deam showcase.backgroundPromptColor = UIColor.hexStringToUIColor(hex: AppStrings.accentColor) return showcase }

    func showCaseDidDismiss(showcase: MaterialShowcase, didTapTarget: Bool)
    {
        sequence.showCaseWillDismis()
    }`

Following screen shots for before and after

For 0.6.6

Screenshot 2020-05-13 at 1 24 38 PM

For 0.7.1

Screenshot 2020-05-13 at 1 20 32 PM

For 0.6.6

Screenshot 2020-05-13 at 1 23 25 PM

For 0.7.1

Screenshot 2020-05-13 at 1 21 31 PM
quangctkm9207 commented 4 years ago

I would like to recommend you to set the background to .fullscreen in the case your text is long. How do you think about this? showcase.backgroundViewType = .full // default is .circle

amodkanthe commented 4 years ago

Don't want to switch full screen this looks much better it was working fine in previous version so rolled back to 0.6.6

quangctkm9207 commented 4 years ago

I am sorry for my late support. I don't have much time to keep updating this library recently.

quangctkm9207 commented 4 years ago

Please use the latest version 0.7.2 and adjust the 'showcase.backgroundRadius' to find the best fit for each case.