Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/mspvirajpatel/SwiftyBase:
  Adding buddybuild SDK
  Update README.md

-Carthage compatibility added
  • Loading branch information
mspvirajpatel committed Sep 1, 2017
2 parents a39a079 + b79c1f4 commit adbe7d5
Show file tree
Hide file tree
Showing 7 changed files with 241 additions and 8 deletions.
1 change: 1 addition & 0 deletions Example/Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#import <BuddyBuildSDK/BuddyBuildSDK.h>
Binary file added Example/BuddyBuildSDK.framework/BuddyBuildSDK
Binary file not shown.
180 changes: 180 additions & 0 deletions Example/BuddyBuildSDK.framework/Headers/BuddyBuildSDK.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
// Copyright (c) 2015 Doe Pics Hit, Inc. All rights reserved.

#import <Foundation/Foundation.h>
#import <UIKit/UIApplication.h>

typedef NSString*(^BBReturnNSStringCallback)(void);
typedef BOOL (^BBReturnBooleanCallback)(void);
typedef void (^BBCallback)(void);

@interface BuddyBuildSDK : NSObject

// Deprecated
+ (void)setup:(id<UIApplicationDelegate>)bbAppDelegate;

/**
* Initialize the SDK
*
* This should be called at (or near) the start of the appdelegate
*/
+ (void)setup;

/*
* Associate arbitrary key/value pairs with your crash reports and user feedback
* which will be visible from the buddybuild dashboard
*/
+ (void)setMetadataObject:(id)object forKey:(NSString*)key;

/*
* Programatically trigger the screenshot feedback UI without pressing the screenshot buttons
* If you have screenshot feedback disabled through the buddybuild setting,
* you can still trigger it by calling this method
*/

+ (void)takeScreenshotAndShowFeedbackScreen;

/*
* If you distribute a build to someone with their email address, buddybuild can
* figure out who they are and attach their info to feedback and crash reports.
*
* However, if you send out a build to a mailing list, or through TestFlight or
* the App Store we are unable to infer who they are. If you see 'Unknown User'
* this is likely the cause.
* Often you'll know the identity of your user, for example, after they've
* logged in. You can provide buddybuild a callback to identify the current user.
*/

+ (void)setUserDisplayNameCallback:(BBReturnNSStringCallback)bbCallback;

/*
* You might have API keys and other secrets that your app needs to consume.
* However, you may not want to check these secrets into the source code.
*
* You can provide your secrets to buddybuild. Buddybuild can then expose them
* to you at build time through environment variables. These secrets can also be
* configured to be included into built app. We obfuscate the device keys to
* prevent unauthorized access.
*/
+ (NSString*)valueForDeviceKey:(NSString*)bbKey;

/*
* To temporarily disable screenshot interception you can provide a callback
* here.
*
* When screenshotting is turned on through a buddybuild setting, and no
* callback is provided then screenshotting is by default on.
*
* If screenshotting is disabled through the buddybuild setting, then this
* callback has no effect
*
*/
+ (void)setScreenshotAllowedCallback:(BBReturnBooleanCallback)bbCallback;

/*
* Once a piece of feedback is sent this callback will be called
* so you can take additional actions if necessary
*/
+ (void)setScreenshotFeedbackSentCallback:(BBCallback)bbCallback;

/*
* Once a crash report is sent this callback will be called
* so you can take additional actions if necessary
*/
+ (void)setCrashReportSentCallback:(BBCallback)bbCallback;

/*
* Buddybuild Build Number
*/
+ (NSString*)buildNumber;

/*
* Scheme
*/
+ (NSString*)scheme;

/*
* App ID
*/
+ (NSString*)appID;

/*
* Build ID
*/
+ (NSString*)buildID;

/*
* Build Configuration
*/

+ (NSString*)buildConfiguration;

/*
* Branch name for this build
*/

+ (NSString*)branchName;

/*
* Returns the user's email or more specifically, the email that was used to download and deploy the build.
* Returns "Unknown User" in cases where buddybuild is unable to identify the user.
* This is the same email seen in crash instances and feedbacks in the dashboard
* NOTE: To be called after [BuddyBuildSDK setup]
* this is different than the one returned in the user display name callback.
*/
+ (NSString*)userEmail;

/* Manually invoke the screenshot tutorial
* If you don't want it to appear on app launch, disable it in the
* dashboard by going to settings -> buddybuildSDK -> Feature Settings and turning off the screenshot tutorial
* You will be able to show it at any time from anywhere in your app
*/
+ (void)showScreenshotTutorial;


+ (void)crash;

/*
* Logs to the console only while the debugger is attached (when running in Xcode)
* They can be downloaded in crash instances and feedbacks in the dashboard
*/
+ (void)log:(NSString *)message;

/*
* Starts recording video when running a UI test case.
* Should be called after each "[[[XCUIApplication alloc] init] launch];" in your UI tests codebase.
* Only run in buddybuild while the UI tests run. It will not run locally, on real iOS devices or on TestFlight and App Store installs.
*/
+ (void)startUITests;

/*
* Stops recording video at the end of a UI test case.
* Should be called before each "[super tearDown];" in your UI tests codebase.
* Only run in buddybuild while the UI tests run. It will not run locally, on real iOS devices or on TestFlight and App Store installs.
*/
+ (void)stopUITests;

/*
* Should be called in your app delegate in -[UIApplication application:didReceiveRemoteNotification:fetchCompletionHandler].
* Only run in buddybuild while the UI tests run. It will not run locally, on real iOS devices or on TestFlight and App Store installs.
*/
+ (void)uiTestsDidReceiveRemoteNotification:(NSDictionary *)userInfo;

/*
* DEPRECATED IN SDK 1.0.16+, use setMetadataObject:forKey:
*/
+ (void)setCrashMetadataObject:(id)object forKey:(NSString*)key __deprecated_msg("Use setMetadataObject:forKey: instead");


@end

@interface UIView (BuddyBuildSDK)

// Certain features of buddybuild involve capturing the screen (either through a static screenshot, or as a video for instant replays in crash reporting or video feedback.
// Your app may contain certain sensitive customer information that you do not want to be included in the video.
// If you set this property to be true, this view will be redacted from the screen capture and blacked out

@property (nonatomic, assign) BOOL buddybuildViewIsPrivate;

@end
1 change: 1 addition & 0 deletions Example/BuddyBuildSDK.framework/build.num
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b61f88d
48 changes: 48 additions & 0 deletions Example/SwiftyBase.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
1DF0CC89A961AA9C48A0F420 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A36C08C1F5E62ACD5F4E5729 /* CoreText.framework */; };
4FEDCC33E759805A7027D65E /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B76FC6B466B7BCDA17B31215 /* CoreVideo.framework */; };
5749274C440C3B6D1B995809 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCF3220699FFEFF48EAD7BB7 /* QuartzCore.framework */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
Expand All @@ -15,8 +18,14 @@
7E962F1F1F56C5F7007F8D82 /* ListController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E962F1E1F56C5F7007F8D82 /* ListController.swift */; };
7E962F211F56C607007F8D82 /* ListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E962F201F56C607007F8D82 /* ListView.swift */; };
7E962F441F56CFA1007F8D82 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E962F431F56CFA1007F8D82 /* Constants.swift */; };
82AA8A00C8F5197170AFE5DE /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80A859A2FFA3BB430AB074B4 /* AVFoundation.framework */; };
96A099F3A31C327EF1A51C05 /* BuddyBuildSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1C4C987C99326C3E5D8A0D1 /* BuddyBuildSDK.framework */; };
A01FF32CAF9EABBFE6F1D1D6 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD022CDE21F0A05509B857A3 /* AssetsLibrary.framework */; };
AD8876B5921DB1D811584587 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51D3B0BC6D027466784B684B /* SystemConfiguration.framework */; };
D0B7D737CEC6C9FCE519528C /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEF8BD230C635C11BED7B51D /* CoreMedia.framework */; };
F00782C12DCB40CE5AD34069 /* Pods_SwiftyBase_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD02102CD6E92101E69AE9D4 /* Pods_SwiftyBase_Example.framework */; };
F270544515935304A8EFB94E /* Pods_SwiftyBase_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99709215DA490B3471B192F8 /* Pods_SwiftyBase_Tests.framework */; };
FC39ECC586539BF49E96BDDE /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E17024FB6B5AF10BF831E7DF /* CoreTelephony.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -34,6 +43,7 @@
164CC79B4DB1FB49A767C6F0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
1FF6DB37AC87FFC2B4CA04DA /* SwiftyBase.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwiftyBase.podspec; path = ../SwiftyBase.podspec; sourceTree = "<group>"; };
392634DB980F2221D76833D8 /* Pods-SwiftyBase_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftyBase_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftyBase_Example/Pods-SwiftyBase_Example.release.xcconfig"; sourceTree = "<group>"; };
51D3B0BC6D027466784B684B /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
607FACD01AFB9204008FA782 /* SwiftyBase_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftyBase_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -47,10 +57,19 @@
7E962F1E1F56C5F7007F8D82 /* ListController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListController.swift; sourceTree = "<group>"; };
7E962F201F56C607007F8D82 /* ListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListView.swift; sourceTree = "<group>"; };
7E962F431F56CFA1007F8D82 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
80A859A2FFA3BB430AB074B4 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
973E5198C101E605490AAB32 /* Pods-SwiftyBase_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftyBase_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftyBase_Tests/Pods-SwiftyBase_Tests.debug.xcconfig"; sourceTree = "<group>"; };
99709215DA490B3471B192F8 /* Pods_SwiftyBase_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftyBase_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A36C08C1F5E62ACD5F4E5729 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
AD022CDE21F0A05509B857A3 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; };
B76FC6B466B7BCDA17B31215 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
C1707C896B5FCB472FCB2708 /* Bridging-Header.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
C1C4C987C99326C3E5D8A0D1 /* BuddyBuildSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BuddyBuildSDK.framework; path = BuddyBuildSDK.framework; sourceTree = "<group>"; };
CC17ED9DFE2B8B5D4B77BAC7 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
DCF3220699FFEFF48EAD7BB7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
DD02102CD6E92101E69AE9D4 /* Pods_SwiftyBase_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftyBase_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E17024FB6B5AF10BF831E7DF /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
EEF8BD230C635C11BED7B51D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -59,6 +78,15 @@
buildActionMask = 2147483647;
files = (
F00782C12DCB40CE5AD34069 /* Pods_SwiftyBase_Example.framework in Frameworks */,
96A099F3A31C327EF1A51C05 /* BuddyBuildSDK.framework in Frameworks */,
A01FF32CAF9EABBFE6F1D1D6 /* AssetsLibrary.framework in Frameworks */,
1DF0CC89A961AA9C48A0F420 /* CoreText.framework in Frameworks */,
FC39ECC586539BF49E96BDDE /* CoreTelephony.framework in Frameworks */,
AD8876B5921DB1D811584587 /* SystemConfiguration.framework in Frameworks */,
5749274C440C3B6D1B995809 /* QuartzCore.framework in Frameworks */,
82AA8A00C8F5197170AFE5DE /* AVFoundation.framework in Frameworks */,
D0B7D737CEC6C9FCE519528C /* CoreMedia.framework in Frameworks */,
4FEDCC33E759805A7027D65E /* CoreVideo.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -78,6 +106,15 @@
children = (
DD02102CD6E92101E69AE9D4 /* Pods_SwiftyBase_Example.framework */,
99709215DA490B3471B192F8 /* Pods_SwiftyBase_Tests.framework */,
C1C4C987C99326C3E5D8A0D1 /* BuddyBuildSDK.framework */,
AD022CDE21F0A05509B857A3 /* AssetsLibrary.framework */,
A36C08C1F5E62ACD5F4E5729 /* CoreText.framework */,
E17024FB6B5AF10BF831E7DF /* CoreTelephony.framework */,
51D3B0BC6D027466784B684B /* SystemConfiguration.framework */,
DCF3220699FFEFF48EAD7BB7 /* QuartzCore.framework */,
80A859A2FFA3BB430AB074B4 /* AVFoundation.framework */,
EEF8BD230C635C11BED7B51D /* CoreMedia.framework */,
B76FC6B466B7BCDA17B31215 /* CoreVideo.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -91,6 +128,7 @@
607FACD11AFB9204008FA782 /* Products */,
72315F7A2DF3A1A8269D2201 /* Pods */,
37C2DFF7BA4A6E6B7311D589 /* Frameworks */,
C1707C896B5FCB472FCB2708 /* Bridging-Header.h */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -520,11 +558,16 @@
baseConfigurationReference = 113CA744FA3D253110F1FADB /* Pods-SwiftyBase_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = SwiftyBase/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h";
SWIFT_VERSION = 3.0;
};
name = Debug;
Expand All @@ -534,11 +577,16 @@
baseConfigurationReference = 392634DB980F2221D76833D8 /* Pods-SwiftyBase_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INFOPLIST_FILE = SwiftyBase/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h";
SWIFT_VERSION = 3.0;
};
name = Release;
Expand Down
2 changes: 2 additions & 0 deletions Example/SwiftyBase/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
BuddyBuildSDK.setup()

// Override point for customization after application launch.

// ClearAllTheCachedImages
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,24 @@ In Base Project included :

Utilities :

-AppConstants
-AppInterFaceUtility
-AppLocationManager
-AppTimer
-AppAlert
1. AppConstants
2. AppInterFaceUtility
3. AppLocationManager
4. AppTimer
5. AppAlert

Controls :

-BaseImageView - with set Url image with catch support & Clear Catch
-BaseButton - Multiple Button with single class access
-Full screen Image Viewer (ImageViewer)
1. BaseImageView - with set Url image with catch support & Clear Catch
2. BaseButton - Multiple Button with single class access
3. Full screen Image Viewer (ImageViewer)


## In Progress

- Description after some time added.(In Progress)

- In software development we all know that we have to reuse code as per as requirement so we have to utilise our code with less efort i ll show you one demo on that first make one viewcontroller of baseviewcontroller then make one view of base view initialize this view in controller we can use this view in another controller too ...thats the main purpose of baseview In storyboard or in one viewcontroller have its own view ..we all know that if we have work in own's view,then it will not use for another controller so we can implement on baseview & use it another times with simple initialize.

## Author

Expand Down

0 comments on commit adbe7d5

Please sign in to comment.