diff --git a/CountlyContentBuilder.h b/CountlyContentBuilder.h index 088d58be..e1b4441f 100644 --- a/CountlyContentBuilder.h +++ b/CountlyContentBuilder.h @@ -7,8 +7,11 @@ #import #if (TARGET_OS_IOS) +#import +#endif NS_ASSUME_NONNULL_BEGIN @interface CountlyContentBuilder: NSObject +#if (TARGET_OS_IOS) + (instancetype)sharedInstance; /** @@ -23,9 +26,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)exitContentZone; +#endif NS_ASSUME_NONNULL_END @end -#else -@interface CountlyContentBuilder: NSObject -@end -#endif diff --git a/CountlyContentBuilder.m b/CountlyContentBuilder.m index 9e2f45e4..6a456cea 100644 --- a/CountlyContentBuilder.m +++ b/CountlyContentBuilder.m @@ -3,12 +3,13 @@ // This code is provided under the MIT License. // // Please visit www.count.ly for more information. -#if (TARGET_OS_IOS) + #import "CountlyContentBuilder.h" #import "CountlyContentBuilderInternal.h" #import "CountlyCommon.h" @implementation CountlyContentBuilder +#if (TARGET_OS_IOS) + (instancetype)sharedInstance { if (!CountlyCommon.sharedInstance.hasStarted) @@ -45,9 +46,5 @@ - (void)changeContent:(NSArray *)tags [CountlyContentBuilder.sharedInstance changeContent:tags]; } -@end -#else -#import "CountlyContentBuilder.h" -@implementation CountlyContentBuilder -@end #endif +@end diff --git a/CountlyContentBuilderInternal.h b/CountlyContentBuilderInternal.h index cef5ce2a..be18530d 100644 --- a/CountlyContentBuilderInternal.h +++ b/CountlyContentBuilderInternal.h @@ -5,10 +5,13 @@ // Please visit www.count.ly for more information. #import -#import "CountlyCommon.h" #if (TARGET_OS_IOS) +#import +#endif +#import "CountlyCommon.h" NS_ASSUME_NONNULL_BEGIN @interface CountlyContentBuilderInternal: NSObject +#if (TARGET_OS_IOS) @property (nonatomic, strong) NSArray *currentTags; @property (nonatomic, assign) NSTimeInterval requestInterval; @property (nonatomic) ContentCallback contentCallback; @@ -19,9 +22,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)exitContentZone; - (void)changeContent:(NSArray *)tags; +#endif NS_ASSUME_NONNULL_END @end -#else -@interface CountlyContentBuilderInternal: NSObject -@end -#endif + diff --git a/CountlyContentBuilderInternal.m b/CountlyContentBuilderInternal.m index 3b43554e..4a0ef01b 100644 --- a/CountlyContentBuilderInternal.m +++ b/CountlyContentBuilderInternal.m @@ -3,9 +3,7 @@ // This code is provided under the MIT License. // // Please visit www.count.ly for more information. - #import "CountlyContentBuilderInternal.h" -#if (TARGET_OS_IOS) #import "CountlyWebViewManager.h" //TODO: improve logging, check edge cases @@ -17,6 +15,7 @@ @implementation CountlyContentBuilderInternal { NSTimer *_requestTimer; NSTimer *_minuteTimer; } +#if (TARGET_OS_IOS) + (instancetype)sharedInstance { static CountlyContentBuilderInternal *instance = nil; static dispatch_once_t onceToken; @@ -206,8 +205,5 @@ - (void)showContentWithHtmlPath:(NSString *)pathToHtml placementCoordinates:(NSD }]; }); } -@end -#else -@implementation CountlyContentBuilderInternal -@end #endif +@end diff --git a/CountlyWebViewManager.h b/CountlyWebViewManager.h index 2b496eb8..7354aa7b 100644 --- a/CountlyWebViewManager.h +++ b/CountlyWebViewManager.h @@ -7,8 +7,11 @@ #if (TARGET_OS_IOS) #import #import +#endif +#import "CountlyCommon.h" NS_ASSUME_NONNULL_BEGIN +#if (TARGET_OS_IOS) typedef NS_ENUM(NSUInteger, AnimationType) { AnimationTypeSlideInFromBottom, AnimationTypeSlideInFromTop, @@ -18,6 +21,8 @@ typedef NS_ENUM(NSUInteger, AnimationType) { AnimationTypeIncreaseHeightFromBottom }; + + @interface CountlyWebViewManager : NSObject - (void)createWebViewWithURL:(NSURL *)url @@ -26,10 +31,7 @@ typedef NS_ENUM(NSUInteger, AnimationType) { dismissBlock:(void(^ __nullable)(void))dismissBlock; -NS_ASSUME_NONNULL_END -@end -#else -#import -@interface CountlyWebViewManager : NSObject + @end #endif +NS_ASSUME_NONNULL_END diff --git a/CountlyWebViewManager.m b/CountlyWebViewManager.m index d20d53d0..ace4249f 100644 --- a/CountlyWebViewManager.m +++ b/CountlyWebViewManager.m @@ -1,15 +1,18 @@ -#if (TARGET_OS_IOS) + #import "CountlyWebViewManager.h" #import "PassThroughBackgroundView.h" #import "CountlyCommon.h" //TODO: improve logging, check edge cases +#if (TARGET_OS_IOS) @interface CountlyWebViewManager() + @property (nonatomic, strong) PassThroughBackgroundView *backgroundView; @property (nonatomic, copy) void (^dismissBlock)(void); @end @implementation CountlyWebViewManager +#if (TARGET_OS_IOS) - (void)createWebViewWithURL:(NSURL *)url frame:(CGRect)frame appearBlock:(void(^ __nullable)(void))appearBlock @@ -241,9 +244,6 @@ - (void)closeWebView { [self.backgroundView removeFromSuperview]; }); } -@end -#else -#import "CountlyWebViewManager.h" -@implementation CountlyWebViewManager +#endif @end #endif diff --git a/PassThroughBackgroundView.h b/PassThroughBackgroundView.h index 04df7fbc..c0b9b79f 100644 --- a/PassThroughBackgroundView.h +++ b/PassThroughBackgroundView.h @@ -4,15 +4,24 @@ // // Please visit www.count.ly for more information. + #if (TARGET_OS_IOS) #import #import +#endif + #import "CountlyCommon.h" + NS_ASSUME_NONNULL_BEGIN +#if (TARGET_OS_IOS) @interface PassThroughBackgroundView : UIView + + @property (nonatomic, strong) WKWebView *webView; @property (nonatomic, strong) CLYButton *dismissButton; -NS_ASSUME_NONNULL_END + + @end #endif +NS_ASSUME_NONNULL_END diff --git a/PassThroughBackgroundView.m b/PassThroughBackgroundView.m index d7c43e09..d6bd8328 100644 --- a/PassThroughBackgroundView.m +++ b/PassThroughBackgroundView.m @@ -3,14 +3,16 @@ // This code is provided under the MIT License. // // Please visit www.count.ly for more information. -#if (TARGET_OS_IOS) + #import "PassThroughBackgroundView.h" +#if (TARGET_OS_IOS) @implementation PassThroughBackgroundView @synthesize webView; - (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; if (self) { } @@ -28,5 +30,7 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { return NO; } + + @end #endif