Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
cc9acf2c
Commit
cc9acf2c
authored
Sep 27, 2013
by
Pierre SAGASPE
Committed by
Felix Paul Kühne
Oct 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pull to refresh network
Signed-off-by:
Felix Paul Kühne
<
fkuehne@videolan.org
>
parent
b19870da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
AspenProject/VLCLocalServerListViewController.m
AspenProject/VLCLocalServerListViewController.m
+29
-0
No files found.
AspenProject/VLCLocalServerListViewController.m
View file @
cc9acf2c
...
...
@@ -32,6 +32,8 @@
NSArray
*
_UPNPdevices
;
VLCNetworkLoginViewController
*
_loginViewController
;
UIRefreshControl
*
refreshControl
;
}
@end
...
...
@@ -74,6 +76,14 @@
_netServiceBrowser
=
[[
NSNetServiceBrowser
alloc
]
init
];
_netServiceBrowser
.
delegate
=
self
;
// Active le Pull down to refresh
refreshControl
=
[[
UIRefreshControl
alloc
]
init
];
// call the refresh function
[
refreshControl
addTarget
:
self
action
:
@selector
(
handleRefresh
)
forControlEvents
:
UIControlEventValueChanged
];
[
self
.
tableView
addSubview
:
refreshControl
];
}
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
...
...
@@ -224,6 +234,25 @@
}
}
#pragma mark - Refresh
-
(
void
)
handleRefresh
{
//set the title while refreshing
refreshControl
.
attributedTitle
=
[[
NSAttributedString
alloc
]
initWithString
:
@"Refresh"
];
//set the date and time of refreshing
NSDateFormatter
*
formattedDate
=
[[
NSDateFormatter
alloc
]
init
];
[
formattedDate
setDateFormat
:
@"MMM d, h:mm a"
];
NSString
*
lastupdated
=
[
NSString
stringWithFormat
:
@"Last Updated on %@"
,[
formattedDate
stringFromDate
:[
NSDate
date
]]];
refreshControl
.
attributedTitle
=
[[
NSAttributedString
alloc
]
initWithString
:
lastupdated
];
//end the refreshing
[
refreshControl
endRefreshing
];
[
self
.
tableView
reloadData
];
[
self
performSelectorInBackground
:
@selector
(
_startUPNPDiscovery
)
withObject
:
nil
];
}
#pragma mark - login panel protocol
-
(
void
)
loginToURL
:(
NSURL
*
)
url
confirmedWithUsername
:(
NSString
*
)
username
andPassword
:(
NSString
*
)
password
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment