forked from asuc-octo/berkeley-mobile-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResourceDetailProvider.swift
38 lines (31 loc) · 1.23 KB
/
ResourceDetailProvider.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Foundation
import UIKit
/**
* Protocol for `UIViewController` subclasses passed into `ResourceContainerController`.
*
* Conforming modules must provide all visual elements including:
* - Title and subtexts for `InfoPanel`
* - Banner image
* - Buttons for the right side of the `Toolbar`
*
* It can also optionally implement `UIScrollViewDelegate` methods,
* which will be called after the containing module has handled it first.
*/
protocol ResourceDetailProvider: class, DelegatesScroll
{
static func newInstance() -> ResourceDetailProvider
var resource: Resource { get set }
var viewController: UIViewController { get }
var text1: String? { get }
var text2: String? { get }
var imageURL: URL? { get }
var image: UIImage? { get set}
var buttons: [UIButton] { get }
/// Whether the receiving container should reset content offset when content size is changed.
var resetOffsetOnSizeChanged: Bool { get }
/**
* Handler to be called by implementing module when underlying `contentSize` changes.
* Whoever is receiving the event will determine the new scroll size and offset.
*/
var contentSizeChangeHandler: ((ResourceDetailProvider) -> Void)? { get set }
}