Skip to content

Commit ed59f49

Browse files
authored
Merge pull request #142 from QuickBlox/development
added progressView
2 parents 615fb19 + f1ca817 commit ed59f49

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

QMChatViewController/QMChatViewController.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
*/
6060
@property (weak, nonatomic, readonly) QMInputToolbar *inputToolbar;
6161

62+
/**
63+
Progress view. Is hiden by default.
64+
*/
65+
@property (weak, nonatomic) IBOutlet FFCircularProgressView *progressView;
66+
6267
/**
6368
* The display name of the current user who is sending messages.
6469
*
@@ -267,6 +272,16 @@
267272
*/
268273
- (void)hideKeyboard:(BOOL)animated;
269274

275+
/**
276+
Make the background layer to spin around its center. This should be called in the main thread.
277+
*/
278+
- (void)startSpinProgress;
279+
280+
/**
281+
Stop the spinning of the background layer. This should be called in the main thread.
282+
*/
283+
- (void)stopSpinProgress;
284+
270285
#pragma mark - Methods requiring super
271286

272287
- (void)viewDidLoad NS_REQUIRES_SUPER;

QMChatViewController/QMChatViewController.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ @interface QMChatViewController ()
3030
UINavigationControllerDelegate, UIActionSheetDelegate, UIScrollViewDelegate,
3131
UIAlertViewDelegate, QMChatDataSourceDelegate>
3232

33+
3334
@property (weak, nonatomic) IBOutlet QMChatCollectionView *collectionView;
3435
@property (weak, nonatomic) IBOutlet QMInputToolbar *inputToolbar;
3536

@@ -80,6 +81,7 @@ - (void)viewDidLoad {
8081
[super viewDidLoad];
8182

8283
[self configureMessagesViewController];
84+
[self configureProgressView];
8385

8486
self.automaticallyAdjustsScrollViewInsets = NO;
8587
//Customize your toolbar buttons
@@ -139,6 +141,24 @@ - (void)didReceiveMemoryWarning {
139141
NSLog(@"MEMORY WARNING: %s", __PRETTY_FUNCTION__);
140142
}
141143

144+
- (void)configureProgressView {
145+
146+
self.progressView.hidden = YES;
147+
self.progressView.hideProgressIcons = YES;
148+
}
149+
150+
- (void)startSpinProgress {
151+
152+
self.progressView.hidden = NO;
153+
[self.progressView startSpinProgressBackgroundLayer];
154+
}
155+
156+
- (void)stopSpinProgress {
157+
158+
self.progressView.hidden = YES;
159+
[self.progressView stopSpinProgressBackgroundLayer];
160+
}
161+
142162
- (void)configureMessagesViewController {
143163

144164
[self registerCells];

QMChatViewController/en.lproj/QMChatViewController.xib

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<connections>
1515
<outlet property="collectionView" destination="l9u-2b-4LK" id="bLP-6g-CkO"/>
1616
<outlet property="inputToolbar" destination="BoD-Az-3DM" id="w74-g9-1qA"/>
17+
<outlet property="progressView" destination="UfM-VL-Z3v" id="9mA-X5-7AZ"/>
1718
<outlet property="toolbarBottomLayoutGuide" destination="rHs-6q-NX4" id="d6h-iu-VMX"/>
1819
<outlet property="view" destination="mUa-cS-ru4" id="nki-T1-RTI"/>
1920
</connections>
@@ -23,6 +24,14 @@
2324
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2425
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2526
<subviews>
27+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UfM-VL-Z3v" customClass="FFCircularProgressView">
28+
<rect key="frame" x="172.5" y="306.5" width="30" height="30"/>
29+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
30+
<constraints>
31+
<constraint firstAttribute="height" constant="30" id="aKI-qg-Vg6"/>
32+
<constraint firstAttribute="width" constant="30" id="rVL-oS-6df"/>
33+
</constraints>
34+
</view>
2635
<collectionView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="l9u-2b-4LK" customClass="QMChatCollectionView">
2736
<rect key="frame" x="0.0" y="20" width="375" height="603"/>
2837
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -39,17 +48,19 @@
3948
</toolbar>
4049
</subviews>
4150
<constraints>
51+
<constraint firstItem="UfM-VL-Z3v" firstAttribute="centerY" secondItem="l9u-2b-4LK" secondAttribute="centerY" id="5sQ-EP-lQi"/>
4252
<constraint firstAttribute="trailing" secondItem="BoD-Az-3DM" secondAttribute="trailing" id="7xc-Ha-asg"/>
4353
<constraint firstItem="l9u-2b-4LK" firstAttribute="leading" secondItem="eLW-iG-nSM" secondAttribute="leading" id="Ao9-tY-M3L"/>
4454
<constraint firstItem="l9u-2b-4LK" firstAttribute="top" secondItem="eLW-iG-nSM" secondAttribute="top" id="GLO-Ke-B4Z"/>
4555
<constraint firstItem="eLW-iG-nSM" firstAttribute="trailing" secondItem="l9u-2b-4LK" secondAttribute="trailing" id="Z1j-5K-vju"/>
56+
<constraint firstItem="UfM-VL-Z3v" firstAttribute="centerX" secondItem="l9u-2b-4LK" secondAttribute="centerX" id="laO-XI-8tb"/>
4657
<constraint firstItem="BoD-Az-3DM" firstAttribute="top" secondItem="l9u-2b-4LK" secondAttribute="bottom" id="qcK-jo-Y2N"/>
4758
<constraint firstAttribute="bottom" secondItem="BoD-Az-3DM" secondAttribute="bottom" id="rHs-6q-NX4"/>
4859
<constraint firstItem="BoD-Az-3DM" firstAttribute="leading" secondItem="mUa-cS-ru4" secondAttribute="leading" id="ts7-8f-0lH"/>
4960
</constraints>
5061
<nil key="simulatedStatusBarMetrics"/>
5162
<viewLayoutGuide key="safeArea" id="eLW-iG-nSM"/>
52-
<point key="canvasLocation" x="146" y="306"/>
63+
<point key="canvasLocation" x="145.5" y="305.5"/>
5364
</view>
5465
</objects>
5566
</document>

0 commit comments

Comments
 (0)