haneke

Using Haneke to cache then play MP4 files with AVPlayer

不羁的心 提交于 2019-12-21 20:56:01
问题 I'm looking for some help solving what seems like a simple problem, but I just can't seem to figure it out. I'm using Haneke from Cocoapods to cache MP4 files from URL (on my server) and then play the cached version using AVPlayer. I'm setting up an AVPreviewLayer inside a UICOllectionViewCell and running this code. The issue is that the player won't play the video initially, but it will play it again in the future (after i scroll back to that cell in the uicollectionview) let getUrl = NSURL

How to return values from Haneke's async fetch method

為{幸葍}努か 提交于 2019-12-14 02:44:42
问题 I'm trying to parse some data that I cached using Haneke Swift . I've cached the data and have written the parser to accomplish this. This parser is in a separate class called AssembleCalendar() . Using Haneke's example code for fetching, I've tried with complete and utter failure to actually return a value from the closure. My attempt func getScheduledItems() -> [ScheduledItem] { var scheduledItem = [ScheduledItem]() // initialize array let cache = Shared.dataCache cache.fetch(key:

swift: add Haneke.framework to xcode 7.0.1 not work

懵懂的女人 提交于 2019-12-13 03:34:15
问题 I'm beginner in xcode and swift, So I'm try to add Haneke framework to my project. I do these steps: Drag Haneke.xcodeproj to your project in the Project Navigator. Select your project and then your app target. Open the Build Phases panel. Expand the Target Dependencies group, and add Haneke.framework. Click on the + button at the top left of the panel and select New Copy Files Phase. Set Destination to Frameworks, and add Haneke.framework. import Haneke whenever you want to use Haneke . But

Display images in UITableview

送分小仙女□ 提交于 2019-12-12 06:49:15
问题 I'm trying to display images from api in the tableview but I get no images or anything. ImageTableViewCell has the outlet to the image only. import UIKit import Alamofire import SwiftyJSON import Haneke class SlideViewController: UIViewController , UITableViewDelegate , UITableViewDataSource { @IBOutlet weak var tableview : UITableView! var images = [String]() override func viewDidLoad() { super.viewDidLoad() tableview.delegate = self tableview.dataSource = self getJSON() } func

Using Haneke to cache then play MP4 files with AVPlayer

蓝咒 提交于 2019-12-04 16:41:12
I'm looking for some help solving what seems like a simple problem, but I just can't seem to figure it out. I'm using Haneke from Cocoapods to cache MP4 files from URL (on my server) and then play the cached version using AVPlayer. I'm setting up an AVPreviewLayer inside a UICOllectionViewCell and running this code. The issue is that the player won't play the video initially, but it will play it again in the future (after i scroll back to that cell in the uicollectionview) let getUrl = NSURL(string: location) cache.fetch(URL: getUrl!).onSuccess { (data) in // Hacky way of getting cache URL

Swift: load images Async in UITableViewCell

﹥>﹥吖頭↗ 提交于 2019-11-29 06:35:56
I have a tableview that I created with code (without storyboard ): class MSContentVerticalList: MSContent,UITableViewDelegate,UITableViewDataSource { var tblView:UITableView! var dataSource:[MSC_VCItem]=[] init(Frame: CGRect,DataSource:[MSC_VCItem]) { super.init(frame: Frame) self.dataSource = DataSource tblView = UITableView(frame: Frame, style: .Plain) tblView.delegate = self tblView.dataSource = self self.addSubview(tblView) } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return dataSource.count } func tableView(tableView: UITableView,

Swift: load images Async in UITableViewCell

时光毁灭记忆、已成空白 提交于 2019-11-27 17:59:30
问题 I have a tableview that I created with code (without storyboard ): class MSContentVerticalList: MSContent,UITableViewDelegate,UITableViewDataSource { var tblView:UITableView! var dataSource:[MSC_VCItem]=[] init(Frame: CGRect,DataSource:[MSC_VCItem]) { super.init(frame: Frame) self.dataSource = DataSource tblView = UITableView(frame: Frame, style: .Plain) tblView.delegate = self tblView.dataSource = self self.addSubview(tblView) } func tableView(tableView: UITableView, numberOfRowsInSection