Skip to content

Commit

Permalink
Merge pull request #135 from tumblr/paulrehkugler/fix-build
Browse files Browse the repository at this point in the history
Flag UIKit Things Out of macOS Version
  • Loading branch information
Pearapps authored Jun 28, 2017
2 parents 57d0922 + 47321a1 commit c8013d5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TMTumblrSDK/Authentication/TMTumblrAuthenticator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

@import Foundation;

#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#import <UIKit/UIKit.h>
#endif

typedef void (^TMAuthenticationCallback)(NSString *token, NSString *secret, NSError *error);

/**
Expand Down
8 changes: 8 additions & 0 deletions TMTumblrSDK/Authentication/TMTumblrAuthenticator.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
typedef void (^NSURLConnectionCompletionHandler)(NSURLResponse *, NSData *, NSError *);
typedef void (^TMHandleAuthenticationURLCallback)(NSURL *authURL);

#if __IPHONE_OS_VERSION_MIN_REQUIRED
@interface TMTumblrAuthenticator() <TMWebViewControllerDelegate>
#else
@interface TMTumblrAuthenticator()
#endif

@property (nonatomic, copy) TMAuthenticationCallback threeLeggedOAuthCallback;
@property (nonatomic, copy) NSString *threeLeggedOAuthTokenSecret;
Expand Down Expand Up @@ -238,6 +242,8 @@ - (void)xAuth:(NSString *)emailAddress password:(NSString *)password callback:(T
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:handler];
}

#if __IPHONE_OS_VERSION_MIN_REQUIRED

#pragma mark - SFSafariViewControllerDelegate

- (void)safariViewControllerDidFinish:(UIViewController *)controller {
Expand Down Expand Up @@ -266,6 +272,8 @@ - (void)webViewControllerDidFinish:(TMWebViewController *)controller {
}];
}

#endif

#pragma mark - Helpers

+ (void)signRequest:(NSMutableURLRequest *)request
Expand Down
4 changes: 4 additions & 0 deletions TMTumblrSDK/Authentication/TMWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright (c) 2016 Tumblr. All rights reserved.
//

#if __IPHONE_OS_VERSION_MIN_REQUIRED

#import <UIKit/UIKit.h>

@protocol TMWebViewControllerDelegate;
Expand All @@ -28,3 +30,5 @@
- (void)webViewControllerDidFinish:(TMWebViewController *)controller;

@end

#endif
4 changes: 4 additions & 0 deletions TMTumblrSDK/Authentication/TMWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import "TMWebViewController.h"

#if __IPHONE_OS_VERSION_MIN_REQUIRED

@interface TMWebViewController ()

@property (nonatomic) UIWebView *webView;
Expand Down Expand Up @@ -56,3 +58,5 @@ - (void)dismissAction {
}

@end

#endif

0 comments on commit c8013d5

Please sign in to comment.