Skip to content

Commit 5eeaa00

Browse files
committed
Adding PageCard implementation in Example app
1 parent c0e8d68 commit 5eeaa00

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

Examples/BeaconstacExample/BeaconstacExample.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
7D4A2C931BFEE9C5003BBBC0 /* soundcloud.html in Resources */ = {isa = PBXBuildFile; fileRef = 7D4A2C921BFEE9C5003BBBC0 /* soundcloud.html */; };
1414
7D4A2C951BFEEBDF003BBBC0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D4A2C941BFEEBDF003BBBC0 /* QuartzCore.framework */; };
1515
7D4A2C971BFEEC07003BBBC0 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D4A2C961BFEEC07003BBBC0 /* Accelerate.framework */; };
16+
7D788D231C57530800A321BA /* PageCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D788D211C57530800A321BA /* PageCardView.m */; };
17+
7D788D241C57530800A321BA /* PageCardView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D788D221C57530800A321BA /* PageCardView.xib */; };
1618
7D911A691C4CCAAB0019E427 /* Assets.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 7D911A681C4CCAAB0019E427 /* Assets.bundle */; };
1719
7D911A7B1C4E4F450019E427 /* SummaryCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D911A791C4E4F450019E427 /* SummaryCardView.m */; };
1820
7D911A7C1C4E4F450019E427 /* SummaryCardView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D911A7A1C4E4F450019E427 /* SummaryCardView.xib */; };
@@ -41,6 +43,9 @@
4143
7D4A2C921BFEE9C5003BBBC0 /* soundcloud.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = soundcloud.html; path = BeaconstacExample/soundcloud.html; sourceTree = SOURCE_ROOT; };
4244
7D4A2C941BFEEBDF003BBBC0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
4345
7D4A2C961BFEEC07003BBBC0 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
46+
7D788D201C57530800A321BA /* PageCardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageCardView.h; sourceTree = "<group>"; };
47+
7D788D211C57530800A321BA /* PageCardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageCardView.m; sourceTree = "<group>"; };
48+
7D788D221C57530800A321BA /* PageCardView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PageCardView.xib; sourceTree = "<group>"; };
4449
7D911A681C4CCAAB0019E427 /* Assets.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Assets.bundle; path = BeaconstacExample/Assets.bundle; sourceTree = SOURCE_ROOT; };
4550
7D911A781C4E4F450019E427 /* SummaryCardView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SummaryCardView.h; sourceTree = "<group>"; };
4651
7D911A791C4E4F450019E427 /* SummaryCardView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SummaryCardView.m; sourceTree = "<group>"; };
@@ -146,6 +151,9 @@
146151
7D911A811C4E7DC60019E427 /* PhotoCardView.h */,
147152
7D911A821C4E7DC60019E427 /* PhotoCardView.m */,
148153
7D911A831C4E7DC60019E427 /* PhotoCardView.xib */,
154+
7D788D201C57530800A321BA /* PageCardView.h */,
155+
7D788D211C57530800A321BA /* PageCardView.m */,
156+
7D788D221C57530800A321BA /* PageCardView.xib */,
149157
7DDF9EA61B2EE5D0001C142B /* Main.storyboard */,
150158
7DE6C1DD1BE878D3006783B2 /* VideoPlayer */,
151159
7DDF9EA91B2EE5D0001C142B /* Images.xcassets */,
@@ -259,6 +267,7 @@
259267
7D4A2C931BFEE9C5003BBBC0 /* soundcloud.html in Resources */,
260268
7DE6C1E41BE87F8D006783B2 /* vimeo.html in Resources */,
261269
7DDF9EA81B2EE5D0001C142B /* Main.storyboard in Resources */,
270+
7D788D241C57530800A321BA /* PageCardView.xib in Resources */,
262271
7D911A7C1C4E4F450019E427 /* SummaryCardView.xib in Resources */,
263272
7DDF9EAD1B2EE5D0001C142B /* LaunchScreen.xib in Resources */,
264273
7DE6C1DC1BE877EB006783B2 /* MusicCardView.xib in Resources */,
@@ -325,6 +334,7 @@
325334
7DDF9EA51B2EE5D0001C142B /* ViewController.m in Sources */,
326335
7DDF9ED81B2EF190001C142B /* WebViewController.m in Sources */,
327336
7DDF9EA21B2EE5D0001C142B /* AppDelegate.m in Sources */,
337+
7D788D231C57530800A321BA /* PageCardView.m in Sources */,
328338
7D911A7B1C4E4F450019E427 /* SummaryCardView.m in Sources */,
329339
7DE6C1DB1BE877EB006783B2 /* MusicCardView.m in Sources */,
330340
7DDF9E9F1B2EE5D0001C142B /* main.m in Sources */,

Examples/BeaconstacExample/BeaconstacExample/ViewController.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ - (void)beaconstac:(Beaconstac *)beaconstac triggeredRuleWithRuleName:(NSString
208208
}
209209
}
210210

211+
#pragma mark - Webhook delegate
212+
211213
- (BOOL)webhookShouldExecute:(MSWebhook *)webhook
212214
{
213215
return YES;
@@ -223,6 +225,7 @@ - (void)webhook:(MSWebhook *)webhook executedWithResponse:(NSURLResponse *)respo
223225
}
224226

225227
#pragma mark - Music Card delegate
228+
226229
- (void)mediaCardButtonClickedAtIndex:(int)index
227230
{
228231
switch (index) {
@@ -252,6 +255,8 @@ - (void)mediaCardButtonClickedAtIndex:(int)index
252255
}
253256
}
254257

258+
#pragma mark - Summary Card delegate
259+
255260
- (void)summaryButtonClickedAtIndex:(int)index
256261
{
257262
switch (index) {
@@ -280,6 +285,8 @@ - (void)summaryButtonClickedAtIndex:(int)index
280285
}
281286
}
282287

288+
#pragma mark - Photo Card delegate
289+
283290
- (void)photoCardButtonClickedAtIndex:(int)index
284291
{
285292
switch (index)
@@ -309,6 +316,8 @@ - (void)photoCardButtonClickedAtIndex:(int)index
309316
}
310317
}
311318

319+
#pragma mark - Page Card delegate
320+
312321
- (void)pageButtonClickedAtIndex:(int)index
313322
{
314323
switch (index) {
@@ -317,7 +326,9 @@ - (void)pageButtonClickedAtIndex:(int)index
317326
[UIView animateWithDuration:0.35 animations:^{
318327
self.visibleCardView.frame = CGRectMake(0, self.visibleCardView.frame.size.height, self.visibleCardView.frame.size.width, self.visibleCardView.frame.size.height);
319328
} completion:^(BOOL finished) {
329+
[pageCardView removeFromSuperview];
320330
self.visibleCardView = nil;
331+
self.navigationController.navigationBarHidden = NO;
321332
}];
322333
}
323334
break;
@@ -457,7 +468,6 @@ - (void)showCard:(MSCard*)card
457468
if (!self.visibleCardView) {
458469
[self.view addSubview:pageCardView];
459470
pageCardView.frame = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height);
460-
pageCardView.layer.masksToBounds = YES;
461471
pageCardView.delegate = self;
462472
pageCardView.titleLabel.text = visibleCard.title;
463473
pageCardView.summaryView.text = visibleCard.body;

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Run `pod install` in the project directory
2424
##### Manually:
2525

2626
1. Download or clone this repo on your system.
27-
2. Drag and drop the Beaconstac.framework file into your Xcode project. Make sure that **Copy Items to Destination's Group Folder** is checked.
28-
![Framework drop](https://raw.githubusercontent.com/Beaconstac/iOS-SDK/master/images/frameworkdrop.png)
27+
2. Drag and drop the Beaconstac.framework file into your Xcode project. Make sure that "Copy Items to Destination's Group Folder" is checked.
28+
<img src="images/frameworkdrop.png" alt="Build Phases" width="600">
2929

30-
3. Navigate to Beaconstac.framework/Resources folder in Finder and drop the Beaconstac.bundle into Project navigator area. Make sure that **Copy Items to Destination's Group Folder** checked.
31-
![Bundle drop](https://raw.githubusercontent.com/Beaconstac/iOS-SDK/master/images/bundledrop.png)
30+
3. Navigate to Beaconstac.framework/Resources folder in Finder and drop the Beaconstac.bundle into Project navigator area. Make sure that "Copy Items to Destination's Group Folder" checked.
31+
<img src="images/bundledrop.png" alt="Build Phases" width="600">
3232

3333
4. In Build Phases under Target, add the following frameworks in “Link Binary With Libraries” section:
3434
- CoreData.framework
@@ -39,7 +39,7 @@ Run `pod install` in the project directory
3939
## Configure your project
4040

4141
1. In Info.plist, add a new field, NSLocationAlwaysUsageDescription with relevant value that you want to show to the user. This is mandatory for iOS 8 and above.
42-
![Build phases](https://raw.githubusercontent.com/Beaconstac/iOS-SDK/master/images/usagedescription.png)
42+
<img src="images/usagedescription.png" alt="Build Phases" width="600">
4343

4444
2. Import the framework header in your class and make sure the class conforms to BeaconstacDelegate protocol
4545

0 commit comments

Comments
 (0)