开源软件名称(OpenSource Name):Ramotion/paper-onboarding开源软件地址(OpenSource Url):https://github.com/Ramotion/paper-onboarding开源编程语言(OpenSource Language):Swift 98.1%开源软件介绍(OpenSource Introduction):PAPER ONBOARDINGiOS library Paper Onboarding is a material design UI slider written on Swift.We specialize in the designing and coding of custom UI for Mobile Apps and Websites.Stay tuned for the latest updates:Get Free Mockup For your project →Requirements
InstallationJust add the Source folder to your project. or use CocoaPods with Podfile: pod 'paper-onboarding' or Carthage users can simply add to their
or Swift Package Manager by adding:
to UsageStoryboard
or Codeoverride func viewDidLoad() {
super.viewDidLoad()
let onboarding = PaperOnboarding()
onboarding.dataSource = self
onboarding.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(onboarding)
// add constraints
for attribute: NSLayoutAttribute in [.Left, .Right, .Top, .Bottom] {
let constraint = NSLayoutConstraint(item: onboarding,
attribute: attribute,
relatedBy: .Equal,
toItem: view,
attribute: attribute,
multiplier: 1,
constant: 0)
view.addConstraint(constraint)
}
} For adding content use dataSource methods: func onboardingItem(at index: Int) -> OnboardingItemInfo {
return [
OnboardingItemInfo(informationImage: IMAGE,
title: "title",
description: "description",
pageIcon: IMAGE,
color: UIColor.RANDOM,
titleColor: UIColor.RANDOM,
descriptionColor: UIColor.RANDOM,
titleFont: UIFont.FONT,
descriptionFont: UIFont.FONT),
OnboardingItemInfo(informationImage: IMAGE,
title: "title",
description: "description",
pageIcon: IMAGE,
color: UIColor.RANDOM,
titleColor: UIColor.RANDOM,
descriptionColor: UIColor.RANDOM,
titleFont: UIFont.FONT,
descriptionFont: UIFont.FONT),
OnboardingItemInfo(informationImage: IMAGE,
title: "title",
description: "description",
pageIcon: IMAGE,
color: UIColor.RANDOM,
titleColor: UIColor.RANDOM,
descriptionColor: UIColor.RANDOM,
titleFont: UIFont.FONT,
descriptionFont: UIFont.FONT)
][index]
}
func onboardingItemsCount() -> Int {
return 3
}
configuring content item:func onboardingConfigurationItem(item: OnboardingContentViewItem, index: Int) {
// item.titleLabel?.backgroundColor = .redColor()
// item.descriptionLabel?.backgroundColor = .redColor()
// item.imageView = ...
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论