Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Added Carthage support and updated to iOS 9 #45

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 199 additions & 5 deletions DLAlertView.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E0820CBE1C4FAB07004F5507"
BuildableName = "DLAlertViewFramework.framework"
BlueprintName = "DLAlertViewFramework"
ReferencedContainer = "container:DLAlertView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E0820CBE1C4FAB07004F5507"
BuildableName = "DLAlertViewFramework.framework"
BlueprintName = "DLAlertViewFramework"
ReferencedContainer = "container:DLAlertView.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E0820CBE1C4FAB07004F5507"
BuildableName = "DLAlertViewFramework.framework"
BlueprintName = "DLAlertViewFramework"
ReferencedContainer = "container:DLAlertView.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
16 changes: 4 additions & 12 deletions DLAlertView/Classes/DLAVAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ @implementation DLAVAlertView
#pragma mark - Initialization

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitle, ...{
self = [self initWithFrame:CGRectZero];
self = [self initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];

if (self) {
self.clipsToBounds = NO;
Expand Down Expand Up @@ -280,7 +280,7 @@ - (void)addLabelWithTitle:(NSString *)title {
self.titleLabel = titleLabel;
[self.clippingView addSubview:titleLabel];

UIView *titleBackgroundView = [[UIView alloc] initWithFrame:CGRectZero];
UIView *titleBackgroundView = [[UIView alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
[self.titleBackgroundView removeFromSuperview];
self.titleBackgroundView = titleBackgroundView;
[self.clippingView insertSubview:titleBackgroundView belowSubview:titleLabel];
Expand Down Expand Up @@ -1336,16 +1336,8 @@ + (CGRect)getScreenFrameForCurrentOrientation {
}

+ (CGRect)getScreenFrameForOrientation:(UIInterfaceOrientation)orientation {
UIScreen *screen = [UIScreen mainScreen];
CGRect fullScreenRect = screen.bounds;

BOOL iOS8 = [[UIDevice currentDevice] systemVersion].floatValue >= 8.0;
if (!iOS8 && UIInterfaceOrientationIsLandscape(orientation)) {
CGRect temp = CGRectZero;
temp.size.width = fullScreenRect.size.height;
temp.size.height = fullScreenRect.size.width;
fullScreenRect = temp;
}
// UIScreen *screen = [UIScreen mainScreen];
CGRect fullScreenRect = [UIApplication sharedApplication].keyWindow.bounds;

return fullScreenRect;
}
Expand Down
10 changes: 5 additions & 5 deletions DLAlertView/Classes/DLAVAlertViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ - (id)init {
_alertViews = [NSMutableArray array];

if (!_alertWindow) {
_alertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
_alertWindow = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].keyWindow.bounds];
_alertWindow.windowLevel = UIWindowLevelAlert;
}

_alertWindow.rootViewController = self;

CGRect frame = [self frameForOrientation:self.interfaceOrientation];
CGRect frame = [self frameForOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
self.view.frame = frame;

_tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss:)];
Expand Down Expand Up @@ -172,10 +172,10 @@ - (CGRect)frameForOrientation:(UIInterfaceOrientation)orientation {

BOOL iOS8 = [[UIDevice currentDevice] systemVersion].floatValue >= 8.0;
if (!iOS8 && UIInterfaceOrientationIsLandscape(orientation)) {
CGRect bounds = [UIScreen mainScreen].bounds;
CGRect bounds = [UIApplication sharedApplication].keyWindow.bounds;
frame = CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.height, bounds.size.width);
} else {
frame = [UIScreen mainScreen].bounds;
frame = [UIApplication sharedApplication].keyWindow.bounds;
}

return frame;
Expand Down Expand Up @@ -234,7 +234,7 @@ - (UIStatusBarStyle)preferredStatusBarStyle {
return [UIApplication sharedApplication].statusBarStyle;
}

- (NSUInteger)supportedInterfaceOrientations {
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}

Expand Down
1 change: 1 addition & 0 deletions DLAlertView/Classes/DLAVAlertViewTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

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

typedef struct {
CGFloat top;
Expand Down
2 changes: 1 addition & 1 deletion DLAlertView/DLAlertView-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>definiteloop.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
19 changes: 19 additions & 0 deletions DLAlertViewFramework/DLAlertViewFramework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// DLAlertViewFramework.h
// DLAlertViewFramework
//
// Created by Dillon Hoa on 20/01/2016.
// Copyright © 2016 Definite Loop. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for DLAlertViewFramework.
FOUNDATION_EXPORT double DLAlertViewFrameworkVersionNumber;

//! Project version string for DLAlertViewFramework.
FOUNDATION_EXPORT const unsigned char DLAlertViewFrameworkVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <DLAlertViewFramework/PublicHeader.h>


26 changes: 26 additions & 0 deletions DLAlertViewFramework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion DLAlertViewTests/DLAlertViewTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>definiteloop.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down