简体   繁体   English

刷新基于页面的应用程序

[英]Refresh Page-Based Application

I'm parsing data over Parse.com, but I'm having trouble setting views dynamically and refreshing it over time. 我正在通过Parse.com解析数据,但是无法动态设置视图并随时间刷新。 Example: When I set 3 views it works fine. 示例:当我设置3个视图时,它可以正常工作。 If I need to set more 2 views, I don't know how to do it. 如果需要设置更多2个视图,我不知道该怎么做。

There's a way to refresh it like a pull to refresh (in table view scope) or something? 有一种方法可以像拉动刷新(在表视图范围内)一样进行刷新吗?

I hope you did understand and thank you. 希望您理解并感谢您。

This should help you out. 这应该可以帮助您。 Add this code in your TableViewController 将此代码添加到TableViewController中

var refresher: UIRefreshControl!

override func viewDidLoad() {
    super.viewDidLoad()

    refresher = UIRefreshControl()
    refresher.attributedTitle = NSAttributedString(string: "Pull To Refresh")
    refresher.addTarget(self, action: "refresh", forControlEvents: UIControlEvents.ValueChanged)

    self.resultsTable.addSubview(refresher)
}


func refresh(){
    //add code
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WatchKit基于页面的导航 - WatchKit Page-based navigation 基于动态页面的Apple Watch应用程序 - Dynamic page-based Apple Watch app 使用WatchKit(Watch)的基于页面的界面中的页码? - Page number in Page-Based Interface with WatchKit (Watch)? WatchOS 上的 SwiftUI 应用程序中是否可以进行基于页面的导航? - Is page-based navigation possible in a SwiftUI app on WatchOS? WatchOS 2基于文本/表格的基于页面的点 - WatchOS 2 page-based dots over text/table 创建基于页面的界面时找不到接口控制器 - Interface controller not found while creating a page-based interface 如何在代码中向基于页面的导航Apple Watch添加新页面 - How to add a New Page in code to Page-Based Navigation Apple Watch 是否可以在当前基于页面的视图中未显示的另一个WKInterfaceController上更改文本? - Is it possible to change text on another WKInterfaceController that is not currently displayed in page-based view? Apple Watch 上的内置锻炼应用程序如何从主表格行导航到一组基于页面的控制器? - How does the inbuilt Workout app on Apple Watch navigate from main table row to a set of page-based controllers? 刷新基于NSFetchedResultsControllerDelegate的tableview - Refresh tableview based on NSFetchedResultsControllerDelegate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM