mukeshthawani / faqview Goto Github PK
View Code? Open in Web Editor NEWAn easy to use FAQ view for iOS written in Swift
License: MIT License
An easy to use FAQ view for iOS written in Swift
License: MIT License
It would be nice to have an option to open the links using SafariViewController (instead of taking the user to Safari) when user taps on the detected link.
No matter what font you set always appear very small in table
Hi,
For iOS and macOS projets it's will be great to make your component Carthage compatible
Take a look at these articles:
On your README.md
add on top and add section for the installation with Carthage.
Hi ,
I just tried the Demo project
and I get issues with constraints when I clicked on cell (after it expand)
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000272dea0 V:|-(10)-[UILabel:0x7fa285e0a030'What is reddit?'] (active, names: '|':UITableViewCellContentView:0x7fa285e04f20 )>",
"<NSLayoutConstraint:0x60000272ddb0 V:[UILabel:0x7fa285e0a030'What is reddit?']-(10)-[UITextView:0x7fa287007600'reddit is a source for wh...'] (active)>",
"<NSLayoutConstraint:0x60000272dd60 V:[UITextView:0x7fa287007600'reddit is a source for wh...']-(20)-| (active, names: '|':UITableViewCellContentView:0x7fa285e04f20 )>",
"<NSLayoutConstraint:0x60000272db30 UIView:0x7fa285e04ba0.height == UILabel:0x7fa285e0a030'What is reddit?'.height (active)>",
"<NSLayoutConstraint:0x60000277c690 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fa285e04f20.height == 38 (active)>"
)Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000272ddb0 V:[UILabel:0x7fa285e0a030'What is reddit?']-(10)-[UITextView:0x7fa287007600'reddit is a source for wh...'] (active)>Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
โ2020-02-11 14:16:27.754909+0300 Demo-iOS[11611:178060] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600002767b10 V:|-(10)-[UILabel:0x7fa288070790'How is a submission's sco...'] (active, names: '|':UITableViewCellContentView:0x7fa285c29cb0 )>",
"<NSLayoutConstraint:0x600002767c00 V:[UILabel:0x7fa288070790'How is a submission's sco...']-(10)-[UITextView:0x7fa28083a400'A submission's score is s...'] (active)>",
"<NSLayoutConstraint:0x600002767c50 V:[UITextView:0x7fa28083a400'A submission's score is s...']-(20)-| (active, names: '|':UITableViewCellContentView:0x7fa285c29cb0 )>",
"<NSLayoutConstraint:0x600002767e80 UIView:0x7fa285c29710.height == UILabel:0x7fa288070790'How is a submission's sco...'.height (active)>",
"<NSLayoutConstraint:0x60000272eee0 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fa285c29cb0.height == 38 (active)>"
)Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002767c00 V:[UILabel:0x7fa288070790'How is a submission's sco...']-(10)-[UITextView:0x7fa28083a400'A submission's score is s...'] (active)>Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Currently, the down arrow image cannot be tapped to open/close the answer. I think many users will instinctively tap on the arrows. To make them respond to taps, the following code can be added to the tableView:cellForRowAt function.
Before the return cell
add these four lines:
cell.indicatorImageView.tag = indexPath.section
let gestureRecogForImage = UITapGestureRecognizer(target: self, action: #selector(FAQView.handleQuestionLabelTap(_:)))
cell.indicatorImageView.addGestureRecognizer(gestureRecogForImage)
cell.indicatorImageView.isUserInteractionEnabled = true
Here is a template to help you to improve your readme: iOS-readme-template
If an expanded cell scrolls off the screen, when it scrolls back on, it is no longer expanded. However, the section number is still in the expandedCells array. Because of this, when you tap on the cell to expand the cell, it won't expand. You must tap it a second time to get it to expand.
I have tried to think of a way to fix this, but there are a couple of different ways to make FAQView behave. One would be to change it so as cells scroll back onto the screen, if they were previously, expanded, show them as expanded.
Or, if leaving them unexpanded is desirable, then somehow the section number must be removed from the expandedCells array when a cell scrolls off.
If there are a bunch of expanded FAQ Items and they go off the screen and I try to scroll down to the last one I can never scroll all the way to the bottom.
This is an odd issue with the scrollview I think.
Please let me know if there is an easy solution.
Thanks
When adding pod to the podfile and running pod install it doesn't seem to add the pod to the pod target properly. It generates a folder in Pods directory but not connecting it up. I ended up including FaqView.swift directly for now. I have a bunch of other cocoapods in the project, and all other installations work fine.. am I missing something? Also, the example project doesn't compile for the same reason i think, can't find the module. I'm on Xcode 9.3. Thanks!
FAQView 0.6.0 (installed via CocoaPods)
...
Is there a way to change the color of the indicatorImageView (tint), without altering the FAQView.swift?
Currently, when changing configuration properties of the title label, it stores them in the configuration, but fails to apply the values to the label itself. The setters should modify the appropriate properties of the title label as shown below.
public var titleLabelColor: UIColor! {
get {
return configuration.titleTextColor
}
set(value) {
configuration.titleTextColor = value
titleLabel.textColor = value // Added this line
}
}
public var titleLabelFont: UIFont! {
get {
return configuration.titleTextFont
}
set(value) {
configuration.titleTextFont = value
titleLabel.font = value // Added this line
}
}
public var viewBackgroundColor: UIColor! {
get {
return configuration.viewBackgroundColor
}
set(value) {
configuration.viewBackgroundColor = value
titleLabel.backgroundColor = value // Added this line
}
}
If anyone is interested, I have created a fork with the following enhancements:
I needed these features for my app. If there is interest in merging these changes into this project, let me know. Otherwise, just close this issue and I'll maintain my own fork.
Hello Team,
Thank your for this great library.
Just wondering if you are planning on migrating to swift 4 ?
I install via Cocoapods, copy / paste the code in the readme, run project and the arrows don't appear.
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
faqView()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func faqView() {
let items = [FAQItem(question: "What is reddit?", answer: "reddit is a source for what's new and popular on the web."),
FAQItem(question: "How is a submission's score determined?", answer: "A submission's score is simply the number of upvotes minus the number of downvotes.")]
let faqListView = FAQView(frame: view.frame, items: items)
view.addSubview(faqListView)
}
When installing via cocoapods, the Up/down arrow doesn't show up. Upon investigation, it appears that the Assets are not in the project. In looking at your podspec I see that you didn't include them.
This stack overflow answer shows how to do it.
http://stackoverflow.com/a/38286446/2584110
Maybe this needs to be in the podspec:
s.resources = "FAQView/Assets/*.xcassets"
I am new in SwiftUI, I want to creat FAQ view means( question answer view). In this view populate number of question and answer. When I click on anyone question, only the answer of that question is visible and not the other question. And the answer of all the questions should be hidden/Collapse.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.