Skip to content

Commit 39ed409

Browse files
author
Andreas Wulf
committed
Continuing to create example and adapt to be more generic
1 parent a0053f0 commit 39ed409

6 files changed

Lines changed: 200 additions & 49 deletions

File tree

Example/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use_frameworks!
33
target 'iStatusView_Example' do
44
pod 'iStatusView', :path => '../'
55
pod 'SVProgressHUD'
6+
pod 'SnapKit'
67

78
target 'iStatusView_Tests' do
89
inherit! :search_paths

Example/Podfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PODS:
1212
- FBSnapshotTestCase (~> 2.0)
1313
- Nimble (~> 7.0)
1414
- Quick (1.2.0)
15+
- SnapKit (4.0.0)
1516
- SVProgressHUD (2.2.5)
1617

1718
DEPENDENCIES:
@@ -20,6 +21,7 @@ DEPENDENCIES:
2021
- Nimble (~> 7.0.2)
2122
- Nimble-Snapshots (~> 6.3.0)
2223
- Quick (~> 1.2.0)
24+
- SnapKit
2325
- SVProgressHUD
2426

2527
EXTERNAL SOURCES:
@@ -32,8 +34,9 @@ SPEC CHECKSUMS:
3234
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
3335
Nimble-Snapshots: f5459b5b091678dc942d03ec4741cacb58ba4a52
3436
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
37+
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
3538
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
3639

37-
PODFILE CHECKSUM: 0616d4833330d26fd5de48a3a99ca58993d64eea
40+
PODFILE CHECKSUM: 8bd0d7f41a3de3822c59388a6836b9ce9afa4d73
3841

3942
COCOAPODS: 1.4.0

Example/iStatusView.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,13 @@
329329
inputPaths = (
330330
"${SRCROOT}/Pods/Target Support Files/Pods-iStatusView_Example/Pods-iStatusView_Example-frameworks.sh",
331331
"${BUILT_PRODUCTS_DIR}/SVProgressHUD/SVProgressHUD.framework",
332+
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
332333
"${BUILT_PRODUCTS_DIR}/iStatusView/iStatusView.framework",
333334
);
334335
name = "[CP] Embed Pods Frameworks";
335336
outputPaths = (
336337
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SVProgressHUD.framework",
338+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
337339
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/iStatusView.framework",
338340
);
339341
runOnlyForDeploymentPostprocessing = 0;

Example/iStatusView/Base.lproj/LaunchScreen.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1818
<subviews>
19-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
19+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2018 NextFaze. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
2020
<rect key="frame" x="20" y="439" width="441" height="21"/>
2121
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2222
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>

Example/iStatusView/ViewController.swift

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import UIKit
1010
import SVProgressHUD
1111
import iStatusView
12+
import SnapKit
1213

1314
class ViewController: UIViewController {
1415

@@ -18,15 +19,29 @@ class ViewController: UIViewController {
1819

1920

2021
// Force to render correctly
21-
let radius = self.loadingView.radius
22-
self.loadingView.radius = 0
23-
self.loadingView.radius = radius
24-
}
25-
26-
override func didReceiveMemoryWarning() {
27-
super.didReceiveMemoryWarning()
28-
// Dispose of any resources that can be recreated.
22+
try? self.statusView.changeTo(state: .loading,
23+
title: NSLocalizedString("Preparing App", comment: ""),
24+
message: NSLocalizedString("More details here", comment: ""),
25+
statusImage: nil,
26+
buttonImage: nil,
27+
animate: false)
28+
2929
}
30-
30+
31+
lazy var statusView: StatusView = {
32+
let loadingView = SVProgressAnimatedView(frame: CGRect(x: 0, y: 0, width: 60.0, height: 60.0))
33+
loadingView.radius = 0
34+
loadingView.radius = 50
35+
loadingView.snp.makeConstraints({ (make) in
36+
make.width.height.equalTo(60.0)
37+
})
38+
39+
let statusView = StatusView.create(with: loadingView, addTo: self.view)
40+
self.view.addSubview(statusView)
41+
statusView.snp.makeConstraints { (make) in
42+
make.edges.equalToSuperview()
43+
}
44+
return statusView
45+
}()
3146
}
3247

0 commit comments

Comments
 (0)