Skip to content

Commit

Permalink
Add an example of UIRefreshControl
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Mar 30, 2023
1 parent b2d3984 commit 5acb006
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ScrollEdgeControl-Demo/Book.swift
Expand Up @@ -71,4 +71,10 @@ let book = Book(title: "MyBook") {
}

}

BookNavigationLink(title: "UIRefreshControl") {
BookPush(title: "Vertical") {
DemoUIRefreshViewController()
}
}
}
46 changes: 46 additions & 0 deletions ScrollEdgeControl-Demo/DemoUIRefreshViewController.swift
@@ -0,0 +1,46 @@
import Foundation
import UIKit
import MondrianLayout
import StorybookUI
import StackScrollView
import ScrollEdgeControl

final class DemoUIRefreshViewController: UIViewController {

private let scrollView = StackScrollView()

init() {

super.init(nibName: nil, bundle: nil)

}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()
let scrollView = self.scrollView

view.backgroundColor = .white

view.mondrian.buildSubviews {
HStackBlock {
scrollView
}
}

let cells = (0..<(20)).map { _ in
Components.makeDemoCell()
}

scrollView.append(views: cells)

let control = UIRefreshControl()

scrollView.addSubview(control)

}

}
6 changes: 6 additions & 0 deletions ScrollEdgeControl.xcodeproj/project.pbxproj
Expand Up @@ -34,6 +34,7 @@
4BC42850275158F80047A850 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = 4BC4284F275158F80047A850 /* RxCocoa */; };
4BC42852275158F80047A850 /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = 4BC42851275158F80047A850 /* RxRelay */; };
4BC42854275158F80047A850 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 4BC42853275158F80047A850 /* RxSwift */; };
4BD5536329D5D51400A1EBF3 /* DemoUIRefreshViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BD5536229D5D51400A1EBF3 /* DemoUIRefreshViewController.swift */; };
C400406E29C1A0F1004A834D /* UIControl+Closure.swift in Sources */ = {isa = PBXBuildFile; fileRef = C400406D29C1A0F1004A834D /* UIControl+Closure.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -80,6 +81,7 @@
4BC42843275158250047A850 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4BC42846275158250047A850 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4BC42848275158250047A850 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4BD5536229D5D51400A1EBF3 /* DemoUIRefreshViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoUIRefreshViewController.swift; sourceTree = "<group>"; };
C400406D29C1A0F1004A834D /* UIControl+Closure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIControl+Closure.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -181,6 +183,7 @@
4BC42845275158250047A850 /* LaunchScreen.storyboard */,
4BC42848275158250047A850 /* Info.plist */,
4B39D05627528ACD00D013F4 /* Components.swift */,
4BD5536229D5D51400A1EBF3 /* DemoUIRefreshViewController.swift */,
);
path = "ScrollEdgeControl-Demo";
sourceTree = "<group>";
Expand Down Expand Up @@ -338,6 +341,7 @@
4B39D05727528ACD00D013F4 /* Components.swift in Sources */,
C400406E29C1A0F1004A834D /* UIControl+Closure.swift in Sources */,
4B39D0512752745C00D013F4 /* DemoHorizontalViewController.swift in Sources */,
4BD5536329D5D51400A1EBF3 /* DemoUIRefreshViewController.swift in Sources */,
4B39D05527528A1900D013F4 /* DebuggingRefreshIndicatorView.swift in Sources */,
4B98480B27F33CB000ED3FA9 /* DemoVerticalStickyHeaderViewController.swift in Sources */,
);
Expand Down Expand Up @@ -548,6 +552,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JX92XL88RZ;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "ScrollEdgeControl-Demo/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down Expand Up @@ -575,6 +580,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = JX92XL88RZ;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "ScrollEdgeControl-Demo/Info.plist";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
Expand Down

0 comments on commit 5acb006

Please sign in to comment.