Display a Tweet in a TweetView using the Tweet's id.
- Using Xcode 11+ go to File > Swift Packages > Add Package Dependency
- Paste the project URL: https://github.com/estampworld/tweetview-ios
- Click on next and select the project target
TweetView.prepare()
let width = view.frame.width - 32.0
let tweetView = TweetView(id:"1345021162959503360")
tweetView.frame = CGRect(x: 16, y: 16, width: width, height: width)
tweetView.delegate = self
self.view.addSubview(tweetView)
tweetView.load()
extension ...: TweetViewDelegate {
func tweetView(_ tweetView: TweetView, didUpdatedHeight height: CGFloat) {
tweetView.frame.size = CGSize(width: tweetView.frame.width, height: height)
}
func tweetView(_ tweetView: TweetView, shouldOpenURL url: URL) {
}
}
https://blog.twitter.com/developer/en_us/topics/tips/2019/displaying-tweets-in-ios-apps.html
Eduardo Irias, creator.
- Fork it ( https://github.com/estampworld/tweetview-ios/fork )
- Create your feature branch (git checkout -b feature/[my-new-feature])
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin feature/[my-new-feature])
- Create a new Pull Request
Toast Alert Views is available under the MIT license. See the LICENSE file for more info.