52inc / swiftygiphy Goto Github PK
View Code? Open in Web Editor NEWA UI and API layer for Giphy discovery and integration.
License: MIT License
A UI and API layer for Giphy discovery and integration.
License: MIT License
In didFinishLaunchingWithOptions
, i put my API Key:
SwiftyGiphyAPI.shared.apiKey = "Gv0dsQKgUCWJCZLEzTXmlD7EnVZpKjjZ"
but SwiftyGiphyAPI.share.apiKey
prints out as an optional, which causes every function in SwiftyGiphyAPI.swift to read apiKey as nil. So, I keep getting the "You need to set your Giphy API key before using SwiftyGiphy." message.
I've tried optional unwrapping and force unwrapping to no avail. Any idea how to fix this?
Thanks in advance for your help!
It seems ironic to use still images here....
great library, would be nice to have swift 4.2 support too
Hi, I am trying out this library with swift 4.2. It works fine so far except that giphyControllerDidCancel doesn't get called. giphyControllerDidSelectGif works fine though.
Here's my code.
class DPChatController: UIViewController, SwiftyGiphyViewControllerDelegate{
func giphyControllerDidSelectGif(controller: SwiftyGiphyViewController, item: GiphyItem) {
if let gifDownSized = item.downsizedImage {
//detailImageView.sd_setImage(with: gifDownSized.url)
}
// close gif selection controller via delegate. This doesn't work!
print("Am in Did Select gif")
//controller.dismiss(animated: true)
self.navigationController?.popViewController(animated: true)
self.inputBar.isHidden = false
}
func giphyControllerDidCancel(controller: SwiftyGiphyViewController) {
print("Am in Did Cancel")
self.navigationController?.popViewController(animated: true)
self.inputBar.isHidden = false
}
@IBAction func chooseProfileActions(_ sender: Any) {
messageTxt.resignFirstResponder()
inputBar.isHidden = true
let profileOptions = UIAlertController(title: "Choose options", message: "", preferredStyle: .actionSheet)
profileOptions.addAction(UIAlertAction(title: "Library", style: .default, handler: { (UIAlertAction) in
self.openPhotoLibrary(isPhoto: false)
}))
profileOptions.addAction(UIAlertAction(title: "Camera", style: .default, handler: { (UIAlertAction) in
self.openPhotoLibrary(isPhoto: true)
}))
profileOptions.addAction(UIAlertAction(title: "GIF", style: .default, handler: { (UIAlertAction) in
self.giphy.navigationController?.delegate = self
self.giphy.delegate = self
self.navigationController?.pushViewController(self.giphy, animated: true)
}))
profileOptions.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { (UIAlertAction) in
print("User selected Cancel option")
self.inputBar.isHidden = false
})
}
If the pushing view controller has its Navigation Bar Hidden.
The moment you:
let giphy = SwiftyGiphyViewController()
self.navigationController?.pushViewController(giphy, animated: true)
The SwiftyGiphyViewController will inherent the hidden Navigation Bar setting and it will not show the required "Powered by Giphy" Navigation Bar.
This issue happens whenever you are not working with Storyboard, or your views are programatic.
Can we get an update here?
With sub-dependencies update please.
SwiftyGiphy
which depends on SDWebImage/GIF was resolved to 4.4.7,
which depends on SDWebImage/Core (= 4.4.7)
The very old dependencies are blocking our other libraries. Which are breaking under iOS.
Hello, any plans on adding swift 5 support?
From looking at the code-base I think the only thing that needs to be updated is the podspec.
Any plan to support objective c calls into this library? It seems none of the functions are decorated with @objc so you cannot use this library in objective c.
There are 2 issues with the 1.3.1 release that dont allow for the project to be compiled.
SwiftGiphyViewController.swift L:217
Value of type 'UITraitCollection' has no member 'hasDifferentColorAppearance'
SwiftGiphyCollectionViewCell.swift L:86
Value of type 'FLAnimatedImageView' has no member 'sd_cacheFLAnimatedImage'
hey! βοΈ
love this little library, you folks did a nice job. would be awesome to have it in Swift 4 too.
I read the code and saw the loadView() function which changes the navigation title, etc. But it seems that small part isn't being called. Also, the controller.dismiss
function doesn't actually dismiss swiftgiphyviewcontroller.
class DetailViewController: UIViewController, UITextFieldDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, SwiftyGiphyViewControllerDelegate {
func giphyControllerDidSelectGif(controller: SwiftyGiphyViewController, item: GiphyItem) {
if let gifDownSized = item.downsizedImage {
detailImageView.sd_setImage(with: gifDownSized.url)
}
// close gif selection controller via delegate. This doesn't work!
controller.dismiss(animated: true)
}
func giphyControllerDidCancel(controller: SwiftyGiphyViewController) {
print("hello")
}
var timerModel: TimerModel!
// Bottom toolbar button on the detailviewcontroller page
@IBAction func useGiphy(_ sender: UIBarButtonItem) {
// Open the giphy search menu
// A viewcontroller inside the storyboard with a segue from detailviewcontroller to a viewcontroller of type swiftygiphycontroller
performSegue(withIdentifier: "gifSelectorSegue", sender: self)
}
}
My DetailViewController does inherit UINavigationDelegate and SwiftyGiphyDelegate
Showing Recent Messages
Build system information
error: /Users/iraniya/Downloads/SwiftyGiphy-master/Pods/Target Support Files/Pods-SwiftyGiphySample/Pods-SwiftyGiphySample.debug.xcconfig: unable to open file (in target "SwiftyGiphySample" in project "SwiftyGiphy") (in target 'SwiftyGiphySample')
I have tried pod install pod update but stuck at
"Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.6.1) is higher than the version of the current executable (1.5.3). Incompatibility issues may arise.
Fetching podspec for SwiftyGiphy
from ../SwiftyGiphy
[!] No podspec found for SwiftyGiphy
in ../SwiftyGiphy
"
Thanks in advance :-)
Is there a way to access the array of images? Don't see them under GiphyItem or GiphyImageSet.
First of all, thanks for developing such an awesome repoβI've been using the pod like crazy and appreciate all the work you guys have done with this.
Unfortunately, I've been having a lot of memory issues with using this. 1) as I scroll down further and further, my memory increase is unbounded. 2) that wouldn't be a problem except this memory is never freed when I pop/dismiss the SwiftyGiphyViewController. All the mallocs and CGImageData are saved in memory and none of the objects are ever released.
I've spent 50-60 hours tracing through the code line by line and trying to figure out how to fix the issue but I haven't been able to find it. At first, I thought it was something simple with the collection view objects not being correctly dereferenced, then I tried looking deeper into each of the components that make up each cell (all the subviews, etc). I tried deinit-ing latestTrendingResponse and latestSearchResponse and even every individual element inside (as well as pretty much any other place I could find saved gifs). I've tried keeping track of other things such as how many CornerRoundingViews were kept in memory at different points in time. I've spent many frustrating hours in Instruments to no avail.
It would be beyond awesome to be able to use this repo in production. If you guys have some time, would you be able to look into fixing the memory issues? Perhaps you guys might be able to fix it more quickly than I'd be able to since you guys are the ones who actually wrote the code.
Thanks so much!
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.