diff --git a/MATSOL/Classes/CreditsViewController.m b/MATSOL/Classes/CreditsViewController.m index 8895aa5..9ef7a9c 100755 --- a/MATSOL/Classes/CreditsViewController.m +++ b/MATSOL/Classes/CreditsViewController.m @@ -9,6 +9,11 @@ #import "CreditsViewController.h" #pragma mark - +@interface CreditsViewController () +@property (weak, nonatomic) IBOutlet UINavigationBar *bar; + +@end + @implementation CreditsViewController @synthesize delegate, versionLabel; @@ -23,7 +28,10 @@ -(void)viewDidLoad{ NSString *status = [dictionary objectForKey:@"GitStatus"]; NSString *branch = [dictionary objectForKey:@"GitBranch"]; NSString *version = [dictionary objectForKey:@"CFBundleShortVersionString"]; - + [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"BrushedMetalBackground"]]]; + UIImageView *logo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"MATSOLLogo"]]; + [logo setFrame:CGRectMake(60, 30, 200, 200)]; + [self.view addSubview:logo]; // If the current branch is master do not output any extra information but // the SHA, else then print SHA@BRANCH_NAME for the info in head NSString *head = [NSString stringWithFormat:@"%@%@", hash, ([branch isEqualToString:@"master"] ? @"" : [NSString stringWithFormat:@"@%@", branch])]; @@ -31,6 +39,19 @@ -(void)viewDidLoad{ // when status is 1 the repository has unstaged changes, therefore append a // star to tipify a non-clean repository, else just print the SHA1 [versionLabel setText:[NSString stringWithFormat:@"Ver. %@ (%@%@)", version,head,([status isEqualToString:@"1"] ? @" *" : @"")]]; + + CGFloat iosVer = [[[UIDevice currentDevice] systemVersion] floatValue]; + if (iosVer >= 7.0) { + CGRect frame = _bar.frame; + frame.size.height += 20; + [_bar setFrame:frame]; + [_bar setTintColor:[UIColor whiteColor]]; + [_bar setBarTintColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"BrushedMetalBackground"]]]; + [_bar setTranslucent:NO]; + } else { + [_bar setBackgroundColor:[UIColor darkGrayColor]]; + } + } -(IBAction)presionaBotonOcultaCreditos:(id)sender{ diff --git a/MATSOL/Classes/InputResistorViewController.m b/MATSOL/Classes/InputResistorViewController.m index 8c01e79..6632931 100755 --- a/MATSOL/Classes/InputResistorViewController.m +++ b/MATSOL/Classes/InputResistorViewController.m @@ -45,6 +45,9 @@ - (void)viewDidLoad { UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(goNext:)]; UIBarButtonItem *spa = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; UIToolbar *tool = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width,30)]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [tool setTintColor:[UIColor whiteColor]]; + } [tool setItems:[NSArray arrayWithObjects:spa,bbi, nil]]; [tool setBarStyle:UIBarStyleBlackTranslucent]; [targetResistance setInputAccessoryView:tool]; @@ -136,10 +139,10 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField{ if (resistorValue>=6800000.0) { //Show an alert view the size is not valid : O GIDAAlertView *sizeAlert=[[GIDAAlertView alloc] initWithTitle:NSLocalizedString(@"Error", @"Error string") - message:NSLocalizedString(@"The resistor value should be less than 6800000.", @"Resistor label for error 68000000") - delegate:self - cancelButtonTitle:@"Ok" - otherButtonTitles:nil]; + message:NSLocalizedString(@"The resistor value should be less than 6800000.", @"Resistor label for error 68000000") + delegate:self + cancelButtonTitle:@"Ok" + otherButtonTitles:nil]; //Display the alert dialog [sizeAlert show]; diff --git a/MATSOL/Classes/MATSOLAppDelegate.m b/MATSOL/Classes/MATSOLAppDelegate.m index d92627b..ca40062 100644 --- a/MATSOL/Classes/MATSOLAppDelegate.m +++ b/MATSOL/Classes/MATSOLAppDelegate.m @@ -30,8 +30,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [homeButton addTarget:self action:@selector(goToRootViewController:) forControlEvents:UIControlEventTouchUpInside]; navigationController=[[UINavigationController alloc] initWithRootViewController:firstViewController]; - [[navigationController navigationBar] setTintColor:[UIColor darkGrayMATSOL]]; - + [navigationController.navigationBar setTranslucent:NO]; + [navigationController.navigationBar setOpaque:YES]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [navigationController.navigationBar setTintColor:[UIColor whiteColor]]; + [navigationController.navigationBar setBarTintColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"BrushedMetalBackground"]]]; + } else { + [[navigationController navigationBar] setTintColor:[UIColor darkGrayMATSOL]]; + } + //The homeButton must be added after the navigationController //in order to make it work //[window addSubview:navigationController.view]; diff --git a/MATSOL/Classes/ScrollViewController.m b/MATSOL/Classes/ScrollViewController.m index c5e9800..22a40a0 100644 --- a/MATSOL/Classes/ScrollViewController.m +++ b/MATSOL/Classes/ScrollViewController.m @@ -20,24 +20,24 @@ - (void)scrollViewDidScroll:(UIScrollView *)sender; @implementation ScrollViewController -@synthesize scrollView; +@synthesize scrollView; @synthesize pageControl; @synthesize viewControllers; @synthesize creditsButton; #pragma mark Initialization - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. +// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization [self setTitle:@"MATSOL"]; - #ifdef DEBUG_INTERFACE +#ifdef DEBUG_INTERFACE [self setTitle:@"MATSOL_MENU"]; - #endif +#endif creditsButton=[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"About", @"About string") style:UIBarButtonItemStyleBordered target:self action:@selector(credits)]; - [[self navigationItem] setLeftBarButtonItem:creditsButton]; + [[self navigationItem] setLeftBarButtonItem:creditsButton]; } return self; } @@ -45,10 +45,13 @@ - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; - + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [self.navigationController.navigationBar setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] }]; + } + //Set some colors - [scrollView setBackgroundColor:[UIColor clearColor]]; - [pageControl setBackgroundColor:[UIColor colorWithRed:.161 green:.161 blue:0.161 alpha:0.6]]; + [scrollView setBackgroundColor:[UIColor clearColor]]; + [pageControl setBackgroundColor:[UIColor colorWithRed:.161 green:.161 blue:0.161 alpha:0.6]]; // view controllers are created lazily // in the meantime, load the array with placeholders which will be replaced on demand @@ -69,13 +72,13 @@ - (void)viewDidLoad { [[self pageControl] setNumberOfPages:kNumberOfPages]; [[self pageControl] setCurrentPage:0]; [[self pageControl] setHidesForSinglePage:YES]; - - + + // pages are created on demand // load the visible page // load the page on either side to avoid flashes when the user starts scrolling [self loadScrollViewWithPage:0]; - [self loadScrollViewWithPage:1]; + [self loadScrollViewWithPage:1]; } diff --git a/MATSOL/Classes/SlaveViewController.m b/MATSOL/Classes/SlaveViewController.m index b1fba9d..a89d23f 100755 --- a/MATSOL/Classes/SlaveViewController.m +++ b/MATSOL/Classes/SlaveViewController.m @@ -25,6 +25,7 @@ - (id)initWithPageNumber:(int)page { // Set the label and background color when the view has finished loading. - (void)viewDidLoad { + [super viewDidLoad]; self.view.backgroundColor = [UIColor clearColor]; [self placeButtonsAndSetBackgroundForIndex:pageNumber]; } @@ -98,17 +99,20 @@ -(void)alertOnClicked:(GIDAAlertView *)alertView { if ([alertView accepted]) { int matrixSize = [[alertView enteredText] intValue]; if ([[alertView title] isEqualToString:NSLocalizedString(@"LinearSize",@"Linear Equation Matrix Size")]) { - if (matrixSize > 26 || matrixSize <= 0 || [[alertView enteredText] isEqualToString:@""]) { + if (matrixSize > 26 || matrixSize <= 1 || [[alertView enteredText] isEqualToString:@""]) { GIDAAlertView *gsaExtra = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"LinearSize" ,@"Linear Equation Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept")]; [gsaExtra setDelegate:self]; + [gsaExtra setKeyboard:UIKeyboardTypeNumberPad]; [gsaExtra show]; } else { GIDAMatrixViewController *viewController = [[GIDAMatrixViewController alloc] initWithMatrixSize:matrixSize andSolver:GIDALinearEquations]; [self endUIViewController:viewController]; } } else { - if (matrixSize > 26 || matrixSize <= 0 || [[alertView enteredText] isEqualToString:@""]) { - GIDAAlertView *gsaExtra = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"DeterminantSize" ,@"Determinant Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept") andKeyBoard:UIKeyboardTypeNumberPad]; + if (matrixSize > 26 || matrixSize <= 1 || [[alertView enteredText] isEqualToString:@""]) { + GIDAAlertView *gsaExtra = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"DeterminantSize" ,@"Determinant Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept") ]; + + [gsaExtra setKeyboard:UIKeyboardTypeNumberPad]; [gsaExtra show]; } else { GIDAMatrixViewController *viewController = [[GIDAMatrixViewController alloc] initWithMatrixSize:matrixSize andSolver:GIDADeterminant]; @@ -131,7 +135,8 @@ -(void)creatingUIViewController:(id)sender{ #ifdef DEBUG NSLog(@"LES"); #endif - GIDAAlertView *gsa = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"LinearSize" ,@"Linear Equation Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept") andKeyBoard:UIKeyboardTypeNumberPad]; + GIDAAlertView *gsa = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"LinearSize" ,@"Linear Equation Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept")]; + [gsa setKeyboard:UIKeyboardTypeNumberPad]; [gsa setDelegate:self]; [gsa show]; return ; @@ -140,7 +145,10 @@ -(void)creatingUIViewController:(id)sender{ #ifdef DEBUG NSLog(@"DET"); #endif - GIDAAlertView *gsa = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"DeterminantSize" ,@"Determinant Matrix Size") cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept") andKeyBoard:UIKeyboardTypeNumberPad]; + GIDAAlertView *gsa = [[GIDAAlertView alloc] initWithPrompt:NSLocalizedString(@"DeterminantSize" ,@"Determinant Matrix Size") + cancelButtonTitle:NSLocalizedString(@"Cancel",@"Cancel") + acceptButtonTitle:NSLocalizedString(@"Accept", @"Accept")]; + [gsa setKeyboard:UIKeyboardTypeNumberPad]; [gsa setDelegate:self]; [gsa show]; return; diff --git a/MATSOL/GIDAUtilities/GIDAAlertView.h b/MATSOL/GIDAUtilities/GIDAAlertView.h index dd3c81d..055b650 100644 --- a/MATSOL/GIDAUtilities/GIDAAlertView.h +++ b/MATSOL/GIDAUtilities/GIDAAlertView.h @@ -17,58 +17,104 @@ #import typedef enum { - GIDAAlertViewMessageImage = 0, - GIDAAlertViewSpinner = 1, - GIDAAlertViewPrompt = 2, - GIDAAlertViewNoPrompt = 3, - GIDAAlertViewProgressTime = 4, - GIDAAlertViewProgressURL = 5, - GIDAAlertViewCheck = 6, - GIDAAlertViewXMark = 7 + GIDAAlertViewMessageImage, + GIDAAlertViewSpinner, + GIDAAlertViewPrompt, + GIDAAlertViewNoPrompt, + GIDAAlertViewProgressTime, + GIDAAlertViewProgressURL, + GIDAAlertViewCheck, + GIDAAlertViewXMark }GIDAAlertViewType; -@interface ProgressBar : UIView --(id)initWithFrame:(CGRect)frame andProgressBarColor:(UIColor *)pcolor; --(void)moveBar:(CGFloat)progress; --(void)setProgressBarColor:(UIColor *)color; -@end - @class GIDAAlertView; +/** + * Methods that the GIDAAlertView delegate must implement. + */ @protocol GIDAAlertViewDelegate @optional +/** Tells the delegate that an alert has been clicked. + +@param alertView The alert view that sends the notification */ -(void)alertOnClicked:(GIDAAlertView *)alertView; +/** Tells the delegate that an alert has been dismised. + + @param alertView The alert view that sends the notification */ -(void)alertOnDismiss:(GIDAAlertView *)alertView; +/** Tells the delegate that an alert has been clicked, dismissed and finished background activities. + + @param alertView The alert view that sends the notification */ -(void)alertFinished:(GIDAAlertView *)alertView; @end +/** + * Description of GIDAAlertView + */ @interface GIDAAlertView : UIAlertView +/** @name Attributes */ @property (nonatomic, strong) NSString *identifier; @property (readonly) GIDAAlertViewType type; @property (readonly) BOOL accepted; @property (nonatomic, strong) id gavdelegate; +/** @name Initialization */ + +/** Initialization of a GIDAAlertView with an check mark and a message. + + An NSString presented along with a check mark + @param message String with the message to present + @return A GIDAAlertView object or `nil` if it could not be created. */ +- (id)initWithCheckMarkAndMessage:(NSString *)message; + +/** Initialization of a GIDAAlertView with an exclamation mark and a message. + + An NSString presented along with a exclamation mark + @param message String with the message to present + @return A GIDAAlertView object or `nil` if it could not be created. */ +- (id)initWithExclamationMarkAndMessage:(NSString *)message; + +/** Initialization of a GIDAAlertView with an image and prompt + + Creates an alert that presents an image and a prompt. This can be used for confirming that the user is a real user. This can be used for CAPTCHA requests + + @param image An image to present in the alertview + @param message The message to present in the alert + @param cancelTitle String for the cancel button + @param acceptTitle String for the accept button + @return A GIDAAlertView object or `nil` if it could not be created. */ +- (id)initWithImage:(UIImage *)image andMessage:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle; + +/** Initialization of a GIDAAlertView with a message and an image. + + An NSString and a UIImage to be presented in the alert +@param someMessage String with the message +@param someImage Image to show in alert +@return A GIDAAlertView object or `nil` if it could not be created.*/ - (id)initWithMessage:(NSString *)someMessage andAlertImage:(UIImage *)someImage; -- (id) initWithSpinnerAndMessage:(NSString *)message; --(id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...; -- (id)initWithImage:(UIImage *)image andPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle; + +/** Initialization of a GIDAAlertView with a message and a graphic spinner. + + An NSString presented along with a UIActivityIndicatorView in the alert +@param message String with the message to present +@return A GIDAAlertView object or `nil` if it could not be created. */ +- (id) initWithSpinnerWith:(NSString *)message; - (id)initWithPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle; -- (id)initWithPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle andKeyBoard:(UIKeyboardType)keyboard; + - (id)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle andMessage:(NSString *)message; -- (id)initWithProgressBarAndMessage:(NSString *)message andTime:(NSInteger)seconds; -- (id)initWithProgressBarAndMessage:(NSString *)message andURL:(NSURL *)url; -- (id)initWithProgressBarAndMessage:(NSString *)message andURL:(NSURL *)url andProgressBarColor:(UIColor *)pcolor; -- (id)initWithCheckMarkAndMessage:(NSString *)message; --(id)initWithXMarkAndMessage:(NSString *)message; --(id)initWithExclamationMarkAndMessage:(NSString *)message; +- (id)initWithProgressBarWith:(NSString *)message andTime:(NSInteger)seconds; +- (id)initWithProgressBarWith:(NSString *)message andURL:(NSURL *)url; +- (id)initWithProgressCircleWith:(NSString *)message andURL:(NSURL *)url; +- (id)initWithXMarkWith:(NSString *)message; +/** @name Other Methods */ - (void)setColor:(UIColor *)color; - (NSString *) enteredText; -- (NSString *) message; - (void)presentProgressBar; - (void)presentAlertFor:(float)seconds; - (void)presentAlertWithSpinnerAndHideAfterSelector:(SEL)selector from:(id)sender withObject:(id)object; - (void)progresBarStartDownload; --(NSDictionary *)getDownloadedData; --(void)setProgressBarColor:(UIColor *)color; +- (NSDictionary *)getDownloadedData; +- (void)setProgressBarColor:(UIColor *)color; +- (void)setKeyboard:(UIKeyboardType)keyboard; @end diff --git a/MATSOL/GIDAUtilities/GIDAAlertView.m b/MATSOL/GIDAUtilities/GIDAAlertView.m index 4cfedc9..f99a7a1 100644 --- a/MATSOL/GIDAUtilities/GIDAAlertView.m +++ b/MATSOL/GIDAUtilities/GIDAAlertView.m @@ -15,50 +15,170 @@ #import "GIDAAlertView.h" -@implementation ProgressBar +@interface LoadingCircle : UIView { + //Angle for arc, in radians. + CGFloat angle; +} + +//Color for arc +@property (nonatomic, strong) UIColor *arcColor; +@property (nonatomic, strong) UILabel *percentageLabel; +@end +@implementation LoadingCircle -(id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - [self setBackgroundColor:[UIColor blueColor]]; - CGRect rect = self.frame; - int radius = 8; - if (rect.size.width < 21) { - radius = rect.size.width/3; + [self setBackgroundColor:[UIColor clearColor]]; + + //Start at -90 as 0.0 is to the right. + angle = -90.0f*M_PI/180.0f; + + CGRect labelFrame = frame; + labelFrame.origin.x = 0; + labelFrame.origin.y = 0; + //Label to show the current percentage. Size of the frame to have the text centered. + _percentageLabel = [[UILabel alloc] initWithFrame:labelFrame]; + [_percentageLabel setTextAlignment:NSTextAlignmentCenter]; + [_percentageLabel setBackgroundColor:[UIColor clearColor]]; + [_percentageLabel setTextColor:[UIColor whiteColor]]; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [_percentageLabel setFont:[UIFont boldSystemFontOfSize:20]]; + } else { + [_percentageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; } - self.layer.cornerRadius = radius; - [self setAlpha:0.8]; + [self addSubview:_percentageLabel]; + _arcColor = [UIColor whiteColor]; } return self; } +-(void)setProgressLabelColor:(UIColor *)progressLabelColor { + [_percentageLabel setTextColor:progressLabelColor]; +} +-(void)setProgressColor:(UIColor *)color { + _arcColor = color; +} +//Update percentage values. +-(void)updateProgress:(CGFloat)percentage { + + //Update the percentage label appropriately + if (percentage >= 1.0f) { + [_percentageLabel setText:@"100%"]; + } else { + [_percentageLabel setText:[NSString stringWithFormat:@"%.1f%c",percentage*100,'%']]; + } + + //Calculate angle from percentage. + angle = (percentage * 360)-90; + angle = angle*M_PI/180.0f; + + //Call drawRect to draw again. + [self setNeedsDisplay]; +} +//Draw back circle and percentage arc. +-(void)drawRect:(CGRect)rect { + CGSize size = rect.size; + CGFloat radius = size.width/2.0f; + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSetLineWidth(context, 12.0); + + //Set the back circle, done by an elipse of the size of the UIView frame. + CGContextSetStrokeColorWithColor(context, [UIColor lightGrayColor].CGColor); + CGRect elipse = CGRectMake(6, 6, size.width-12, size.height-12); + CGContextAddEllipseInRect(context, elipse); + CGContextStrokePath(context); + + //Set the arc of the progress so far. Starting from center top, to the percentage angle in a clockwise way. + CGContextSetStrokeColorWithColor(context, _arcColor.CGColor); + CGContextAddArc(context, radius, radius, radius-6, -90.0f*M_PI/180.0f, angle, 0); + CGContextStrokePath(context); +} +@end --(id)initWithFrame:(CGRect)frame andProgressBarColor:(UIColor *)pcolor { +@interface ProgressBar : UIView +@property (nonatomic, strong) UIColor *progressColor; +@property CGFloat progress; +@property (nonatomic, strong) UILabel *progressLabel; +@end +@implementation ProgressBar + +-(id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - [self setBackgroundColor:pcolor]; - CGRect rect = self.frame; - int radius = 8; - if (rect.size.width < 21) { - radius = rect.size.width/3; + _progress = 0.0; + [self setBackgroundColor:[UIColor clearColor]]; + + CGRect labelFrame = frame; + labelFrame.origin.x = 0; + labelFrame.origin.y = 0; + _progressLabel = [[UILabel alloc] initWithFrame:labelFrame]; + [_progressLabel setTextAlignment:NSTextAlignmentCenter]; + _progressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; + [_progressLabel setTextColor:[UIColor whiteColor]]; + [_progressLabel setBackgroundColor:[UIColor clearColor]]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [_progressLabel setFont:[UIFont boldSystemFontOfSize:20]]; + } else { + [_progressLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; } - self.layer.cornerRadius = radius; - [self setAlpha:0.8]; + [self addSubview:_progressLabel]; } return self; } --(void)setProgressBarColor:(UIColor *)color { - [self setBackgroundColor:color]; -} --(void)moveBar:(CGFloat)progress { - CGRect frame = self.frame; - frame.size.width = 100*progress; - self.frame = frame; - int radius = 8; - if (frame.size.width < 21) { - radius = frame.size.width/3; +-(void)setProgressLabelColor:(UIColor *)progressLabelColor { + [_progressLabel setTextColor:progressLabelColor]; +} +-(void)setProgressColor:(UIColor *)color { + _progressColor = color; +} + + +//Update the percentage value and label appropriately. Call for drawRect again. +-(void)updateProgress:(CGFloat)percentage { + _progress = percentage; + + if (percentage >= 1.0f) { + [_progressLabel setText:@"100%"]; + } else { + [_progressLabel setText:[NSString stringWithFormat:@"%.1f%c",fabsf(percentage*100),'%']]; + } + + [self setNeedsDisplay]; +} + +//Create rectangle with rounded corner for the appropiate width related to the progress. +-(void)drawRect:(CGRect)rect { + rect.size.width = rect.size.width*_progress; + if (!_progressColor) { + _progressColor = [UIColor blueColor]; } - self.layer.cornerRadius = radius; - [self setAlpha:0.8]; + CGFloat radius = 8; + if (rect.size.width < 21) { + radius = rect.size.width/3; + } + + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, _progressColor.CGColor); + CGContextSetAlpha(context, 0.8); + + CGContextMoveToPoint(context, rect.origin.x, rect.origin.y + radius); + CGContextAddLineToPoint(context, rect.origin.x, rect.origin.y + rect.size.height - radius); + CGContextAddArc(context, rect.origin.x + radius, rect.origin.y + rect.size.height - radius, + radius, M_PI, M_PI / 2, 1); //STS fixed + CGContextAddLineToPoint(context, rect.origin.x + rect.size.width - radius, + rect.origin.y + rect.size.height); + CGContextAddArc(context, rect.origin.x + rect.size.width - radius, + rect.origin.y + rect.size.height - radius, radius, M_PI / 2, 0.0f, 1); + CGContextAddLineToPoint(context, rect.origin.x + rect.size.width, rect.origin.y + radius); + CGContextAddArc(context, rect.origin.x + rect.size.width - radius, rect.origin.y + radius, + radius, 0.0f, -M_PI / 2, 1); + CGContextAddLineToPoint(context, rect.origin.x + radius, rect.origin.y); + CGContextAddArc(context, rect.origin.x + radius, rect.origin.y + radius, radius, + -M_PI / 2, M_PI, 1); + + CGContextFillPath(context); } @end @@ -66,7 +186,6 @@ -(void)moveBar:(CGFloat)progress { @interface GIDAAlertView() { BOOL withSpinnerOrImage; float progress; - NSTimer *timer; double timeSeconds; float _receivedDataBytes; float _totalFileSize; @@ -75,25 +194,26 @@ @interface GIDAAlertView() { BOOL failedDownload; } +@property (nonatomic, strong) NSString *entered; @property (nonatomic, strong) UITextField *textField; -@property (nonatomic, strong) UILabel *theMessage; +@property (nonatomic, strong) UILabel *messageLabel; +@property (nonatomic, strong) UILabel *messageExtraLabel; @property (nonatomic, strong) UIColor *alertColor; @property (nonatomic, strong) NSTimer *timer; @property (nonatomic, strong) NSMutableData *responseData; @property (nonatomic, strong) NSURL *userURL; @property (nonatomic, strong) NSString *mimeType; @property (nonatomic, strong) NSString *textEncoding; -@property (nonatomic, strong) ProgressBar *progressBar; -@property (nonatomic, strong) UILabel *progressLabel; +@property (nonatomic, strong) id progressBar; @property (nonatomic, strong) NSURLConnection *connection; @property (nonatomic, strong) NSString *downloadError; @property (nonatomic, strong) UILabel *cancelLabel; @property (nonatomic, strong) UIView *backgroundView; - +@property (nonatomic, strong) UIImageView *imageView; +@property (nonatomic, strong) UILabel *labelMark; @end @implementation GIDAAlertView -@synthesize timer = _timer; -(GIDAAlertViewType)type { return alertType; @@ -103,76 +223,121 @@ -(id)initWithMessage:(NSString *)message andAlertImage:(UIImage *)image { self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; if (self) { withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; - [imageView setFrame:CGRectMake(100, 35, 80, 80)]; - [self addSubview:imageView]; - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 115, 160, 50)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; - _responseData = nil; alertType = GIDAAlertViewMessageImage; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [super setTitle:@""]; + + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 130)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + + UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; + [imageView setFrame:CGRectMake(40, 5, 80, 80)]; + + UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 85, 160, 50)]; + [messageLabel setTextAlignment:NSTextAlignmentCenter]; + [messageLabel setText:message]; + [messageLabel setBackgroundColor:[UIColor clearColor]]; + [messageLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [messageLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [messageLabel setAdjustsFontSizeToFitWidth:YES]; + [messageLabel removeFromSuperview]; + + [_backgroundView addSubview:imageView]; + [_backgroundView addSubview:messageLabel]; + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } else { + _backgroundView = nil; + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + + UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; + [imageView setFrame:CGRectMake(100, 25, 80, 80)]; + [self addSubview:imageView]; + + UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [messageLabel setTextAlignment:NSTextAlignmentCenter]; + [messageLabel setText:message]; + [messageLabel setBackgroundColor:[UIColor clearColor]]; + [messageLabel setTextColor:[UIColor whiteColor]]; + [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:messageLabel]; + + [self bringSubviewToFront:_backgroundView]; + [self bringSubviewToFront:imageView]; + [self bringSubviewToFront:messageLabel]; + } } return self; } - --(id)initWithProgressBarAndMessage:(NSString *)message andTime:(NSInteger)seconds { +-(id)initWithProgressBarWith:(NSString *)message andTime:(NSInteger)seconds { self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; if (self) { progress = -0.1; timeSeconds = seconds/10; withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(90, 25, 0, 100)]; - [self addSubview:_progressBar]; - _progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, -25, 200, 200)]; - [_progressLabel setTextAlignment:UITextAlignmentCenter]; - _progressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - [_progressLabel setTextColor:[UIColor whiteColor]]; - [_progressLabel setBackgroundColor:[UIColor clearColor]]; - [_progressLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [self addSubview:_progressLabel]; - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 136, 200, 44)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; - - - _cancelLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 32, 32)]; - [_cancelLabel setBackgroundColor:[UIColor blackColor]]; - [_cancelLabel setTextAlignment:UITextAlignmentCenter]; - [_cancelLabel setTextColor:[UIColor whiteColor]]; - [_cancelLabel setText:@"\u2718"]; - [_cancelLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - _cancelLabel.layer.cornerRadius = 15; - _cancelLabel.layer.borderColor = [[UIColor whiteColor] CGColor]; - _cancelLabel.layer.borderWidth = 1.5; - - - UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(215, -15, 30, 30)]; - [button addSubview:_cancelLabel]; - - [button addTarget:self action:@selector(cancelDownload:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:button]; //[iv release]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + self = [super initWithTitle:@"" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; + _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(50, 5, 100, 100)]; + [_progressBar setProgressLabelColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 160)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + _messageExtraLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 110, 160, 50)]; + [_messageExtraLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageExtraLabel setText:message]; + [_messageExtraLabel setBackgroundColor:[UIColor clearColor]]; + [_messageExtraLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_messageExtraLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [_messageExtraLabel setAdjustsFontSizeToFitWidth:YES]; + [_messageExtraLabel removeFromSuperview]; + + [_backgroundView addSubview:_progressBar]; + [_backgroundView addSubview:_messageExtraLabel]; + + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } else { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(90, 25, 100, 100)]; + [self addSubview:_progressBar]; + + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + + _cancelLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 32, 32)]; + [_cancelLabel setBackgroundColor:[UIColor blackColor]]; + [_cancelLabel setTextAlignment:NSTextAlignmentCenter]; + [_cancelLabel setTextColor:[UIColor whiteColor]]; + [_cancelLabel setText:@"\u2718"]; + [_cancelLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + _cancelLabel.layer.cornerRadius = 15; + _cancelLabel.layer.borderColor = [[UIColor whiteColor] CGColor]; + _cancelLabel.layer.borderWidth = 1.5; + + + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(215, -15, 30, 30)]; + [button addSubview:_cancelLabel]; + + [button addTarget:self action:@selector(cancelDownload:) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:button]; //[iv release]; + } _responseData = nil; alertType = GIDAAlertViewProgressTime; } @@ -181,8 +346,7 @@ -(id)initWithProgressBarAndMessage:(NSString *)message andTime:(NSInteger)second -(void)moveProgress { if (progress <= 1.0) { progress += 0.1; - [_progressBar moveBar:progress]; - [_progressLabel setText:[NSString stringWithFormat:@"%0.0f%@",fabs(progress*100),@"%"]]; + [_progressBar updateProgress:progress]; } else { [_timer invalidate]; _timer = nil; @@ -195,135 +359,199 @@ -(void)presentProgressBar { [[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSDefaultRunLoopMode]; } --(id) initWithSpinnerAndMessage:(NSString *)message { +-(id) initWithSpinnerWith:(NSString *)message { self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; if (self) { withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - UIActivityIndicatorView *theSpinner=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; - [theSpinner setFrame:CGRectMake(90, 25, 100, 100)]; - - [theSpinner startAnimating]; - [self addSubview:theSpinner]; - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 125, 180, 50)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [super setTitle:@""]; + UIActivityIndicatorView *theSpinner=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + [theSpinner setFrame:CGRectMake(50, 5, 100, 100)]; + + [theSpinner startAnimating]; + + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 160)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + _messageExtraLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 110, 160, 50)]; + [_messageExtraLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageExtraLabel setText:message]; + [_messageExtraLabel setBackgroundColor:[UIColor clearColor]]; + [_messageExtraLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_messageExtraLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [_messageExtraLabel setAdjustsFontSizeToFitWidth:YES]; + + [_backgroundView addSubview:theSpinner]; + [_backgroundView addSubview:_messageExtraLabel]; + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } else { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + UIActivityIndicatorView *theSpinner=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + [theSpinner setFrame:CGRectMake(90, 25, 100, 100)]; + + [theSpinner startAnimating]; + [self addSubview:theSpinner]; + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + } _responseData = nil; alertType = GIDAAlertViewSpinner; } return self; } - -- (id)initWithPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle andKeyBoard:(UIKeyboardType)keyboard { - while ([prompt sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000)].width > 240.0) { - prompt = [NSString stringWithFormat:@"%@...", [prompt substringToIndex:[prompt length] - 4]]; - } - NSString *heightString = @"\n"; - CGFloat height = [prompt sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000) lineBreakMode:UILineBreakModeWordWrap].height; - for (int i = 0; i < height; i+=22) { - heightString = [heightString stringByAppendingString:@"\n"]; - } - - NSString *total = [prompt stringByAppendingString:heightString]; - height = [total sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000) lineBreakMode:UILineBreakModeWordWrap].height; - if (self = [super initWithTitle:prompt message:heightString delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { - - _backgroundView = [[UIView alloc] initWithFrame:super.frame]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - withSpinnerOrImage = NO; - _textField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, height+10, 260.0, 31.0)]; - [_textField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; - [_textField setAutocorrectionType:UITextAutocorrectionTypeNo]; - [_textField setBorderStyle:UITextBorderStyleRoundedRect]; - [_textField setTextAlignment:NSTextAlignmentCenter]; - [_textField setKeyboardAppearance:UIKeyboardAppearanceAlert]; - [_textField setKeyboardType:keyboard]; - [self addSubview:_textField]; +- (id)initWithPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle { + _responseData = nil; + alertType = GIDAAlertViewPrompt; + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + if (self = [super initWithTitle:prompt message:nil delegate:self cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { + [self setAlertViewStyle:UIAlertViewStylePlainTextInput]; + } + } else { + while ([prompt sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000)].width > 240.0) { + prompt = [NSString stringWithFormat:@"%@...", [prompt substringToIndex:[prompt length] - 4]]; + } + NSString *heightString = @"\n"; + NSInteger bm; + if ([[[UIDevice currentDevice] systemVersion] floatValue] < 6.0) { + bm = UILineBreakModeWordWrap; + } else { + bm = NSLineBreakByWordWrapping; + } + CGFloat height = [prompt sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000) lineBreakMode:bm].height; + for (int i = 0; i < height; i+=22) { + heightString = [heightString stringByAppendingString:@"\n"]; + } - _alertColor = [UIColor blackColor]; - _responseData = nil; - alertType = GIDAAlertViewPrompt; + NSString *total = [prompt stringByAppendingString:heightString]; + height = [total sizeWithFont:[UIFont systemFontOfSize:18.0] constrainedToSize:CGSizeMake(240, 1000) lineBreakMode:bm].height; + if (self = [super initWithTitle:prompt message:heightString delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { + + _backgroundView = [[UIView alloc] initWithFrame:super.frame]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + withSpinnerOrImage = NO; + _textField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, height+10, 260.0, 31.0)]; + [_textField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; + [_textField setAutocorrectionType:UITextAutocorrectionTypeNo]; + [_textField setBorderStyle:UITextBorderStyleRoundedRect]; + [_textField setTextAlignment:NSTextAlignmentCenter]; + [_textField setKeyboardAppearance:UIKeyboardAppearanceAlert]; + [self addSubview:_textField]; + + _alertColor = [UIColor blackColor]; + } } return self; } -- (id)initWithPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle { - self = [self initWithPrompt:prompt cancelButtonTitle:cancelTitle acceptButtonTitle:acceptTitle andKeyBoard:UIKeyboardTypeDefault]; - return self; -} + -(void)drawRect:(CGRect)rect { - if (alertType == GIDAAlertViewPrompt || alertType == GIDAAlertViewNoPrompt) { - [_backgroundView setFrame:rect]; - [self sendSubviewToBack:_backgroundView]; - _backgroundView.layer.borderColor = [[UIColor whiteColor] CGColor]; - _backgroundView.layer.borderWidth = 1.5; - } -} -- (id)initWithImage:(UIImage *)image andPrompt:(NSString *)prompt cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle { - while ([prompt sizeWithFont:[UIFont systemFontOfSize:18.0]].width > 240.0) { - prompt = [NSString stringWithFormat:@"%@...", [prompt substringToIndex:[prompt length] - 4]]; - } - NSString *height = @"\n"; - for (int i = 0; i < image.size.height; i+=14) { - height = [height stringByAppendingString:@"\n"]; - } - if (self = [super initWithTitle:prompt message:height delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { - withSpinnerOrImage = NO; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; - CGSize imageSize = image.size; - CGRect imageViewFrame = CGRectMake((280-imageSize.width)/2, 20.0f, imageSize.width, imageSize.height); - [imageView setFrame:imageViewFrame]; - UITextField *theTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, imageSize.height+40.0, 260.0, 31.0)]; - [theTextField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; - [theTextField setAutocorrectionType:UITextAutocorrectionTypeNo]; - [theTextField setBorderStyle:UITextBorderStyleRoundedRect]; - [theTextField setTextAlignment:NSTextAlignmentCenter]; - [theTextField setKeyboardAppearance:UIKeyboardAppearanceAlert]; - [self addSubview:imageView]; - [self addSubview:theTextField]; - self.textField = theTextField; - - _alertColor = [UIColor blackColor]; - - // if not >= 4.0 - NSString *sysVersion = [[UIDevice currentDevice] systemVersion]; - if (![sysVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedDescending) { - CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 130.0); - [self setTransform:translate]; + // if (alertType == GIDAAlertViewPrompt || alertType == GIDAAlertViewNoPrompt) { + [_backgroundView setFrame:rect]; + [self sendSubviewToBack:_backgroundView]; + _backgroundView.layer.borderColor = [[UIColor whiteColor] CGColor]; + _backgroundView.layer.borderWidth = 1.5; + // } +} +- (id)initWithImage:(UIImage *)image andMessage:(NSString *)message cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle { + withSpinnerOrImage = NO; + _responseData = nil; + alertType = GIDAAlertViewPrompt; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + if (self = [super initWithTitle:message message:nil delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { + + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 130)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + + UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; + [imageView setFrame:CGRectMake(40, 5, 80, 80)]; + + UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 85, 160, 50)]; + [messageLabel setTextAlignment:NSTextAlignmentCenter]; + [messageLabel setText:message]; + [messageLabel setBackgroundColor:[UIColor clearColor]]; + [messageLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [messageLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [messageLabel setAdjustsFontSizeToFitWidth:YES]; + [messageLabel removeFromSuperview]; + + [_backgroundView addSubview:imageView]; + [_backgroundView addSubview:messageLabel]; + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } + } else { + while ([message sizeWithFont:[UIFont systemFontOfSize:18.0]].width > 240.0) { + message = [NSString stringWithFormat:@"%@...", [message substringToIndex:[message length] - 4]]; + } + NSString *height = @"\n"; + for (int i = 0; i < image.size.height; i+=14) { + height = [height stringByAppendingString:@"\n"]; + } + if (self = [super initWithTitle:message message:height delegate:nil cancelButtonTitle:cancelTitle otherButtonTitles:acceptTitle, nil]) { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; + CGSize imageSize = image.size; + CGRect imageViewFrame = CGRectMake((280-imageSize.width)/2, 20.0f, imageSize.width, imageSize.height); + [imageView setFrame:imageViewFrame]; + UITextField *theTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, imageSize.height+40.0, 260.0, 31.0)]; + [theTextField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter]; + [theTextField setAutocorrectionType:UITextAutocorrectionTypeNo]; + [theTextField setBorderStyle:UITextBorderStyleRoundedRect]; + [theTextField setTextAlignment:NSTextAlignmentCenter]; + [theTextField setKeyboardAppearance:UIKeyboardAppearanceAlert]; + [self addSubview:imageView]; + [self addSubview:theTextField]; + self.textField = theTextField; + + _alertColor = [UIColor blackColor]; + } - _responseData = nil; - alertType = GIDAAlertViewPrompt; } return self; } + -(id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... { self = [super initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:nil]; if (self) { - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; alertType = GIDAAlertViewNoPrompt; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + } else { + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + } } return self; } + -(id)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle acceptButtonTitle:(NSString *)acceptTitle andMessage:(NSString *)message { while ([title sizeWithFont:[UIFont systemFontOfSize:18.0]].width > 240.0) { title = [NSString stringWithFormat:@"%@...", [title substringToIndex:[title length] - 4]]; @@ -336,20 +564,14 @@ -(id)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle a [_backgroundView setAlpha:0.8]; _backgroundView.layer.cornerRadius = 15; [self addSubview:_backgroundView]; - _theMessage = [[UILabel alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 31.0)]; - [_theMessage setBackgroundColor:[UIColor clearColor]]; - [_theMessage setTextColor:[UIColor whiteColor]]; - [_theMessage setTextAlignment:NSTextAlignmentCenter]; - [_theMessage setText:message]; - [self addSubview:_theMessage]; + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 31.0)]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [self addSubview:_messageLabel]; _alertColor = [UIColor blackColor]; - // if not >= 4.0 - NSString *sysVersion = [[UIDevice currentDevice] systemVersion]; - if (![sysVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedDescending) { - CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 130.0); - [self setTransform:translate]; - } _responseData = nil; alertType = GIDAAlertViewNoPrompt; } @@ -369,18 +591,14 @@ -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [_responseData appendData:data]; if (progress < 1 && progress >= 0) { - NSString *string = [NSString stringWithFormat:@"%.1f%@",progress*100,@"%"]; - [_progressLabel setText:string]; - [_progressBar moveBar:progress]; + [_progressBar updateProgress:progress]; } else { - [_progressLabel setText:@"100%"]; - [_progressBar moveBar:1]; + [_progressBar updateProgress:1]; } } -(void)connectionDidFinishLoading:(NSURLConnection *)connection { - [_progressBar moveBar:1]; - [_progressLabel setText:@"100%"]; + [_progressBar updateProgress:1]; double delayInSeconds = 0.7; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ @@ -401,60 +619,6 @@ -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)erro }); } -- (id)initWithProgressBarAndMessage:(NSString *)message andURL:(NSURL *)url andProgressBarColor:(UIColor *)pcolor { - self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; - if (self) { - _receivedDataBytes = 0; - _totalFileSize = 0; - progress = -0.1; - withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(90, 25, 0, 100) andProgressBarColor:pcolor]; - [self addSubview:_progressBar]; - _progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, -25, 200, 200)]; - [_progressLabel setTextAlignment:UITextAlignmentCenter]; - _progressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - [_progressLabel setTextColor:[UIColor whiteColor]]; - [_progressLabel setBackgroundColor:[UIColor clearColor]]; - [_progressLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [self addSubview:_progressLabel]; - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 136, 200, 44)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; - - _cancelLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 32, 32)]; - [_cancelLabel setBackgroundColor:[UIColor blackColor]]; - [_cancelLabel setTextAlignment:UITextAlignmentCenter]; - [_cancelLabel setTextColor:[UIColor whiteColor]]; - [_cancelLabel setText:@"\u2718"]; - [_cancelLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - _cancelLabel.layer.cornerRadius = 15; - _cancelLabel.layer.borderColor = [[UIColor whiteColor] CGColor]; - _cancelLabel.layer.borderWidth = 1.5; - - - UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(215, -15, 30, 30)]; - [button addSubview:_cancelLabel]; - - [button addTarget:self action:@selector(cancelDownload:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:button]; - - failedDownload = NO; - _responseData = nil; - _userURL = url; - alertType = GIDAAlertViewProgressURL; - } - return self; -} -(void)cancelDownload:(id)sender { [_connection cancel]; failedDownload = YES; @@ -462,52 +626,146 @@ -(void)cancelDownload:(id)sender { [self dismissWithClickedButtonIndex:0 animated:YES]; } -- (id)initWithProgressBarAndMessage:(NSString *)message andURL:(NSURL *)url { - self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; - if (self) { - _receivedDataBytes = 0; - _totalFileSize = 0; - progress = -0.1; - withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(100, 35, 0, 80)]; - [self addSubview:_progressBar]; - _progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(115, 50, 60, 50)]; - [_progressLabel setTextAlignment:NSTextAlignmentCenter]; - _progressLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - [_progressLabel setTextColor:[UIColor whiteColor]]; - [_progressLabel setBackgroundColor:[UIColor clearColor]]; - [_progressLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [self addSubview:_progressLabel]; - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 115, 160, 50)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; - failedDownload = NO; - _responseData = nil; - //[iv release]; - _userURL = url; - alertType = GIDAAlertViewProgressURL; + +- (id)initWithProgressBarWith:(NSString *)message andURL:(NSURL *)url { + _receivedDataBytes = 0; + _totalFileSize = 0; + progress = -0.1; + withSpinnerOrImage = YES; + failedDownload = NO; + _responseData = nil; + _userURL = url; + alertType = GIDAAlertViewProgressURL; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + //Cancel button, not available now due to iOS 7 can not handle modifications to alertView + // if(self = [super initWithTitle:@"" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]){ + if (self = [super initWithTitle:nil message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]) { + _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(50, 5, 100, 100)]; + [_progressBar setProgressLabelColor:[UIColor grayColor]]; + [_progressBar setProgressColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 160)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + _messageExtraLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 110, 160, 50)]; + [_messageExtraLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageExtraLabel setText:message]; + [_messageExtraLabel setBackgroundColor:[UIColor clearColor]]; + [_messageExtraLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_messageExtraLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [_messageExtraLabel setAdjustsFontSizeToFitWidth:YES]; + [_messageExtraLabel removeFromSuperview]; + [_backgroundView addSubview:_progressBar]; + [_backgroundView addSubview:_messageExtraLabel]; + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } + } else { + self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; + if (self) { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + + _progressBar = [[ProgressBar alloc] initWithFrame:CGRectMake(90, 25, 100, 100)]; + [self addSubview:_progressBar]; + + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 136, 200, 44)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + } + } + return self; +} +- (id)initWithProgressCircleWith:(NSString *)message andURL:(NSURL *)url { + _receivedDataBytes = 0; + _totalFileSize = 0; + progress = -0.1; + withSpinnerOrImage = YES; + failedDownload = NO; + _responseData = nil; + _userURL = url; + alertType = GIDAAlertViewProgressURL; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + if(self = [super initWithTitle:@"" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]){ + _progressBar = [[LoadingCircle alloc] initWithFrame:CGRectMake(50, 5, 100, 100)]; + [_progressBar setProgressLabelColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_progressBar setProgressColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 160)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + _messageExtraLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 110, 160, 50)]; + [_messageExtraLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageExtraLabel setText:message]; + [_messageExtraLabel setBackgroundColor:[UIColor clearColor]]; + [_messageExtraLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_messageExtraLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [_messageExtraLabel setAdjustsFontSizeToFitWidth:YES]; + [_messageExtraLabel removeFromSuperview]; + [_backgroundView addSubview:_progressBar]; + [_backgroundView addSubview:_messageExtraLabel]; + + [self setValue:_backgroundView forKey:@"accessoryView"]; + } + } else { + + self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; + if (self) { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + + _progressBar = [[LoadingCircle alloc] initWithFrame:CGRectMake(90, 20, 100, 100)]; + [self addSubview:_progressBar]; + + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + } } return self; } - (void)setColor:(UIColor *)color { - _alertColor = color; - if (_backgroundView) { - [_backgroundView setBackgroundColor:color]; - } - if (_cancelLabel) { - [_cancelLabel setBackgroundColor:color]; + if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0) { + _alertColor = color; + if (_backgroundView) { + [_backgroundView setBackgroundColor:color]; + } + if (_cancelLabel) { + [_cancelLabel setBackgroundColor:color]; + } + } else { + switch (alertType) { + case GIDAAlertViewCheck: + [_messageExtraLabel setTextColor:color]; + [_labelMark setTextColor:color]; + break; + case GIDAAlertViewProgressURL: + [_messageExtraLabel setTextColor:color]; + [_progressBar setProgressColor:color]; + if ([_progressBar isKindOfClass:[LoadingCircle class]]) { + [_progressBar setProgressLabelColor:color]; + } + break; + default: + [_messageExtraLabel setTextColor:color]; + break; + } } } @@ -517,21 +775,21 @@ - (void)show { } - (NSString *)enteredText { - return _textField.text; + return _entered; } - (NSString *)message { - return [[self theMessage] text]; + return [[self messageLabel] text]; } + - (void) layoutSubviews { - for (UIView *sub in [self subviews]) - { - if([sub class] == [UIImageView class] && sub.tag == 0) - { - [sub removeFromSuperview]; - break; - } - } + for (UIView *sub in [self subviews]) + { + if ([sub isKindOfClass:[UIImageView class]] && sub.tag == 0) { + [sub removeFromSuperview]; + break; + } + } } -(void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated { @@ -543,72 +801,89 @@ -(void)setDelegate:(id)delegate { } -(void)presentAlertWithSpinnerAndHideAfterSelector:(SEL)selector from:(id)sender withObject:(id)object { [self show]; - if ([sender canPerformAction:selector withSender:object]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" - [sender performSelector:selector withObject:object]; + [sender performSelector:selector withObject:object]; #pragma clang diagnostic pop - dispatch_async(dispatch_get_main_queue(), ^ - { - [self dismissWithClickedButtonIndex:0 animated:YES]; - }); - }); - } + dispatch_async(dispatch_get_main_queue(), ^ + { + [self dismissWithClickedButtonIndex:0 animated:YES]; + }); + }); } -(id)initWithCharacter:(NSString *)character andMessage:(NSString *)message{ - self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; - if (self) { - withSpinnerOrImage = YES; - _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; - [_backgroundView setBackgroundColor:[UIColor blackColor]]; - [_backgroundView setAlpha:0.8]; - _backgroundView.layer.cornerRadius = 15; - [self addSubview:_backgroundView]; - - UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 25, 200, 120)]; - [label setTextAlignment:UITextAlignmentCenter]; - [label setTextColor:[UIColor whiteColor]]; - [label setBackgroundColor:[UIColor clearColor]]; - [label setText:character]; - // [label setFont:[UIFont systemFontOfSize:90]]; - [label setFont:[UIFont fontWithName:@"ZapfDingbatsITC" size:100]]; - // [label setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:label]; - - UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; - [messageLabel setTextAlignment:NSTextAlignmentCenter]; - [messageLabel setText:message]; - [messageLabel setBackgroundColor:[UIColor clearColor]]; - [messageLabel setTextColor:[UIColor whiteColor]]; - [messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; - [messageLabel setAdjustsFontSizeToFitWidth:YES]; - [self addSubview:messageLabel]; - _responseData = nil; + withSpinnerOrImage = YES; + _responseData = nil; + alertType = GIDAAlertViewCheck; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + if (self = [super initWithTitle:nil message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]) { + + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 160, 130)]; + [_backgroundView setBackgroundColor:[UIColor clearColor]]; + + _labelMark = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, 160, 80)]; + [_labelMark setTextAlignment:NSTextAlignmentCenter]; + [_labelMark setTextColor:[UIColor whiteColor]]; + [_labelMark setBackgroundColor:[UIColor clearColor]]; + [_labelMark setText:character]; + [_labelMark setFont:[UIFont fontWithName:@"ZapfDingbatsITC" size:100]]; + + _messageExtraLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 90, 160, 50)]; + [_messageExtraLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageExtraLabel setText:message]; + [_messageExtraLabel setBackgroundColor:[UIColor clearColor]]; + [_messageExtraLabel setTextColor:[UIColor colorWithRed:(28.0/255) green:(130.0/255) blue:(251.0/255) alpha:1]]; + [_messageExtraLabel setFont:[UIFont boldSystemFontOfSize:20]]; + [_messageExtraLabel setAdjustsFontSizeToFitWidth:YES]; + [_messageExtraLabel removeFromSuperview]; + + [_backgroundView addSubview:_labelMark]; + [_backgroundView addSubview:_messageExtraLabel]; + [self setValue:_backgroundView forKey:@"accessoryView"]; + } + } else { + self = [super initWithTitle:@"\n\n\n\n\n" message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; + if (self) { + _backgroundView = [[UIView alloc] initWithFrame:CGRectMake(40, -10, 200, 200)]; + [_backgroundView setBackgroundColor:[UIColor blackColor]]; + [_backgroundView setAlpha:0.8]; + _backgroundView.layer.cornerRadius = 15; + [self addSubview:_backgroundView]; + + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 15, 200, 120)]; + [label setTextAlignment:NSTextAlignmentCenter]; + [label setTextColor:[UIColor whiteColor]]; + [label setBackgroundColor:[UIColor clearColor]]; + [label setText:character]; + [label setFont:[UIFont fontWithName:@"ZapfDingbatsITC" size:100]]; + [self addSubview:label]; + + _messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(62, 125, 160, 50)]; + [_messageLabel setTextAlignment:NSTextAlignmentCenter]; + [_messageLabel setText:message]; + [_messageLabel setBackgroundColor:[UIColor clearColor]]; + [_messageLabel setTextColor:[UIColor whiteColor]]; + [_messageLabel setFont:[UIFont fontWithName:@"TimesNewRomanPS-BoldMT" size:20]]; + [_messageLabel setAdjustsFontSizeToFitWidth:YES]; + [self addSubview:_messageLabel]; + } } return self; } -(id)initWithCheckMarkAndMessage:(NSString *)message { self = [self initWithCharacter:@"✓" andMessage:message]; - if (self) { - alertType = GIDAAlertViewCheck; - } return self; } -(id)initWithExclamationMarkAndMessage:(NSString *)message { self = [self initWithCharacter:@"❢" andMessage:message]; - if (self) { - alertType = GIDAAlertViewCheck; - } return self; } --(id)initWithXMarkAndMessage:(NSString *)message { +-(id)initWithXMarkWith:(NSString *)message { self = [self initWithCharacter:@"\u2718" andMessage:message]; - if (self) { - alertType = GIDAAlertViewCheck; - } return self; } -(void)presentAlertFor:(float)seconds { @@ -645,8 +920,18 @@ -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)button if (buttonIndex == 1) { acceptedAlert = YES; + if (alertType == GIDAAlertViewPrompt) { + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + _entered = [[alertView textFieldAtIndex:0] text]; + } else { + _entered = [[(GIDAAlertView *)alertView textField] text]; + } + } } else { acceptedAlert = NO; + if (alertType == GIDAAlertViewProgressURL) { + [self cancelDownload:nil]; + } } if ([_gavdelegate respondsToSelector:@selector(alertOnClicked:)]) [_gavdelegate alertOnClicked:(GIDAAlertView *)alertView]; @@ -669,6 +954,14 @@ -(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)b [_gavdelegate alertFinished:(GIDAAlertView *)alertView]; } -(void)setProgressBarColor:(UIColor *)color { - [_progressBar setProgressBarColor:color]; + [_progressBar setProgressColor:color]; +} + +-(void)setKeyboard:(UIKeyboardType)keyboard { + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [[self textFieldAtIndex:0] setKeyboardType:keyboard]; + } else { + [_textField setKeyboardType:keyboard]; + } } @end diff --git a/MATSOL/GIDAUtilities/GIDAMatrixCell.m b/MATSOL/GIDAUtilities/GIDAMatrixCell.m index a1c0bc5..5e09cc5 100644 --- a/MATSOL/GIDAUtilities/GIDAMatrixCell.m +++ b/MATSOL/GIDAUtilities/GIDAMatrixCell.m @@ -56,7 +56,9 @@ - (id)initWithRowFields:(NSArray *)row reuseIdentifier:(NSString *)reuseIdentifi [kbtb setBarStyle:UIBarStyleBlackTranslucent]; [kbtb setItems:[NSArray arrayWithObjects:lesskey,space,sign, space, fraction, space, openPar, space, closePar, space, back, betweenSignAndArrowSpace,ubbi,nil]]; - + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [kbtb setTintColor:[UIColor whiteColor]]; + } tf.inputAccessoryView = kbtb; tf.keyboardAppearance = UIKeyboardAppearanceAlert; diff --git a/MATSOL/GIDAUtilities/GIDAMatrixViewController.m b/MATSOL/GIDAUtilities/GIDAMatrixViewController.m index 991e350..2862178 100644 --- a/MATSOL/GIDAUtilities/GIDAMatrixViewController.m +++ b/MATSOL/GIDAUtilities/GIDAMatrixViewController.m @@ -22,6 +22,7 @@ @interface GIDAMatrixViewController () { //Variable used for >=iPhone 5 Layout BOOL ip5; BOOL flag; + BOOL appeared; } //Matrix of place holder for the UITextFields (a1, a2, ..., b1, b2, ..., s.a, s.b, ...). Never changes @@ -69,6 +70,7 @@ - (id)initWithMatrixSize:(NSInteger)size andSolver:(GIDASolver)gidasolver { self.navigationItem.rightBarButtonItem=solveButton; [self initializeArrays]; + appeared = NO; } return self; } else { @@ -125,6 +127,7 @@ - (void)dealloc { //View has appeared, load the table and scroll, when they are added remove the waiting view - (void)viewDidAppear:(BOOL)animated { + if (!appeared) { [self addViews]; while (flag) { @@ -135,6 +138,8 @@ - (void)viewDidAppear:(BOOL)animated { } } } + appeared = YES; + } } //Load the background and waiting view @@ -405,6 +410,10 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS //Do not let the user select the cell [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + + if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { + [cell setBackgroundColor:[UIColor clearColor]]; + } return cell; } diff --git a/MATSOL/Localization/en.lproj/CreditsViewController.xib b/MATSOL/Localization/en.lproj/CreditsViewController.xib index 20f142f..a46356a 100755 --- a/MATSOL/Localization/en.lproj/CreditsViewController.xib +++ b/MATSOL/Localization/en.lproj/CreditsViewController.xib @@ -1,644 +1,130 @@ - - - - 1536 - 12C60 - 2843 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 - - - YES - IBProxyObject - IBUIBarButtonItem - IBUIImageView - IBUILabel - IBUINavigationBar - IBUINavigationItem - IBUITextView - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 290 - {320, 44} - - - - - 1 - MSAxIDEAA - - NO - NO - IBCocoaTouchFramework - 2 - - 2 - MC4yMTU2ODYyNzQ1IDAuMjE1Njg2Mjc0NSAwLjIxNTY4NjI3NDUAA - - - YES - - - About - - IBCocoaTouchFramework - 50 - 1 - - 8 - - IBCocoaTouchFramework - - - - - - 256 - {{0, 40}, {320, 508}} - - - - - 2 - MCAwIDAuMDEwOTQ4OTA1MTEAA - - NO - YES - YES - IBCocoaTouchFramework - - NSImage - BrushedMetalBackground.png - - - - - 292 - {{22, 215}, {280, 30}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Universidad Iberoamericana - - 1 - MC4wOTgwMzkyMTcyOSAwLjA5ODAzOTIxNzI5IDAuMDk4MDM5MjE3MjkAA - - - - 1 - MC45MDE5NjA3OTAyIDAuOTAxOTYwNzkwMiAwLjkwMTk2MDc5MDIAA - - {0, 1} - 1 - 10 - 1 - - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - NO - - - - 292 - {{55, 272}, {214, 17}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Alejandro Paredes Alva - - - - {0, 1} - 1 - 9 - 1 - - 2 - 14 - - - Helvetica-Bold - 14 - 16 - - - - - 292 - {{30, 243}, {264, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - GIDA 2011 - Ingeniería Electrónica - - - - {0, 1} - 1 - 10 - - - - - - 292 - {{55, 286}, {214, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Santiago Torres Arias - - - - {0, 1} - 1 - 9 - 1 - - - - - - 292 - {{55, 302}, {214, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Yoshiki Vázquez Baeza - - - - {0, 1} - 1 - 9 - 1 - - - - - - 292 - {{20, 347}, {285, 38}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Contact - - - - 1 - 10 - 1 - - Helvetica-Bold - Helvetica - 2 - 24 - - - Helvetica-Bold - 24 - 16 - - - - - 292 - {{0, 383}, {320, 72}} - - - - - 3 - MSAwAA - - NO - YES - YES - IBCocoaTouchFramework - YES - NO - 2 - NO - aHR0cDovL3d3dy5pZS51aWEubXggICAgICAgCmh0dHA6Ly93d3cudWlhLm14ICAgICAgICAgICAgICAg -ICAKcG9sYXJiZWFycy5kZXZ0ZWFtQGdtYWlsLmNvbQ - - - 2 - IBCocoaTouchFramework - - 6 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 256 - {{83, 44}, {155, 155}} - - - - NO - YES - 1 - YES - IBCocoaTouchFramework - - NSImage - MATSOLLogo.png - - - - - 292 - {{20, 178}, {280, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Ver. X.X (XX) - - 1 - MCAwIDAAA - darkTextColor - - - 0 - 10 - 1 - - - - - {{0, 20}, {320, 548}} - - - - - - 1 - - - IBUIScreenMetrics - - YES - - YES - - - - - YES - {320, 568} - {568, 320} - - - IBCocoaTouchFramework - Retina 4 Full Screen - 2 - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - versionLabel - - - - 33 - - - - presionaBotonOcultaCreditos: - - - - 16 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 13 - - - YES - - - - - - 14 - - - YES - - - - - - 15 - - - - - 18 - - - - - 20 - - - - - 24 - - - - - 25 - - - - - 26 - - - - - 27 - - - - - 28 - - - - - 29 - - - - - 31 - - - - - 32 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 18.IBPluginDependency - 20.IBPluginDependency - 24.IBPluginDependency - 25.IBPluginDependency - 26.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - - - YES - CreditsViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 33 - - - - YES - - CreditsViewController - UIViewController - - presionaBotonOcultaCreditos: - id - - - presionaBotonOcultaCreditos: - - presionaBotonOcultaCreditos: - id - - - - versionLabel - UILabel - - - versionLabel - - versionLabel - UILabel - - - - IBProjectSource - ./Classes/CreditsViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - BrushedMetalBackground.png - MATSOLLogo.png - - - YES - {320, 416} - {512, 512} - - - 1929 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.ie.uia.mx +http://www.uia.mx +polarbears.devteam@gmail.com + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MATSOL/Localization/en.lproj/Localizable.strings b/MATSOL/Localization/en.lproj/Localizable.strings index ce44fcc..5ca9cb0 100644 Binary files a/MATSOL/Localization/en.lproj/Localizable.strings and b/MATSOL/Localization/en.lproj/Localizable.strings differ diff --git a/MATSOL/Localization/es.lproj/CreditsViewController.xib b/MATSOL/Localization/es.lproj/CreditsViewController.xib index ecb514f..730edd8 100755 --- a/MATSOL/Localization/es.lproj/CreditsViewController.xib +++ b/MATSOL/Localization/es.lproj/CreditsViewController.xib @@ -1,643 +1,113 @@ - - - - 1552 - 12C3006 - 3084 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - YES - IBProxyObject - IBUIBarButtonItem - IBUIImageView - IBUILabel - IBUINavigationBar - IBUINavigationItem - IBUITextView - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 290 - {320, 44} - - - - - 1 - MSAxIDEAA - - NO - NO - IBCocoaTouchFramework - 2 - - 2 - MC4yMTU2ODYyNzQ1IDAuMjE1Njg2Mjc0NSAwLjIxNTY4NjI3NDUAA - - - YES - - - Acerca De - - IBCocoaTouchFramework - 50 - 1 - - 8 - - IBCocoaTouchFramework - - - - - - 256 - {{0, 40}, {320, 508}} - - - - - 2 - MCAwIDAuMDEwOTQ4OTA1MTEAA - - NO - YES - YES - IBCocoaTouchFramework - - NSImage - BrushedMetalBackground.png - - - - - 292 - {{30, 215}, {280, 30}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Universidad Iberoamericana - - 1 - MC4wOTgwMzkyMTcyOSAwLjA5ODAzOTIxNzI5IDAuMDk4MDM5MjE3MjkAA - - - - 1 - MC45MDE5NjA3OTAyIDAuOTAxOTYwNzkwMiAwLjkwMTk2MDc5MDIAA - - {0, 1} - 1 - 10 - 1 - - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - NO - - - - 292 - {{63, 272}, {214, 17}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Alejandro Paredes Alva - - - - {0, 1} - 1 - 9 - 1 - - 2 - 14 - - - Helvetica-Bold - 14 - 16 - - - - - 292 - {{38, 243}, {264, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - GIDA 2011 - Ingeniería Electrónica - - - - {0, 1} - 1 - 10 - - - - - - 292 - {{63, 286}, {214, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Santiago Torres Arias - - - - {0, 1} - 1 - 9 - 1 - - - - - - 292 - {{63, 302}, {214, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Yoshiki Vázquez Baeza - - - - {0, 1} - 1 - 9 - 1 - - - - - - 292 - {{28, 347}, {285, 38}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Contacto - - - - 1 - 10 - 1 - - Helvetica-Bold - Helvetica - 2 - 24 - - - Helvetica-Bold - 24 - 16 - - - - - 292 - {{8, 383}, {261, 72}} - - - - 3 - MSAwAA - - NO - YES - YES - IBCocoaTouchFramework - YES - NO - 2 - NO - aHR0cDovL3d3dy5pZS51aWEubXggICAgICAgCmh0dHA6Ly93d3cudWlhLm14ICAgICAgICAgICAgICAg -ICAKcG9sYXJiZWFycy5kZXZ0ZWFtQGdtYWlsLmNvbQ - - - 2 - IBCocoaTouchFramework - - 6 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 292 - {{91, 44}, {155, 155}} - - - - NO - YES - 1 - YES - IBCocoaTouchFramework - - NSImage - MATSOLLogo.png - - - - - 292 - {{28, 178}, {280, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Ver. X.X (XX) - - 1 - MCAwIDAAA - darkTextColor - - - 0 - 10 - 1 - - - - - {{0, 20}, {320, 548}} - - - - - - 2 - - - IBUIScreenMetrics - - YES - - YES - - - - - YES - {320, 568} - {568, 320} - - - IBCocoaTouchFramework - Retina 4 Full Screen - 2 - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - versionLabel - - - - 33 - - - - presionaBotonOcultaCreditos: - - - - 16 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 13 - - - YES - - - - - - 14 - - - YES - - - - - - 15 - - - - - 18 - - - - - 20 - - - - - 24 - - - - - 25 - - - - - 26 - - - - - 27 - - - - - 28 - - - - - 29 - - - - - 31 - - - - - 32 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 18.IBPluginDependency - 20.IBPluginDependency - 24.IBPluginDependency - 25.IBPluginDependency - 26.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - - - YES - CreditsViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 33 - - - - YES - - CreditsViewController - UIViewController - - presionaBotonOcultaCreditos: - id - - - presionaBotonOcultaCreditos: - - presionaBotonOcultaCreditos: - id - - - - versionLabel - UILabel - - - versionLabel - - versionLabel - UILabel - - - - IBProjectSource - ./Classes/CreditsViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - BrushedMetalBackground.png - MATSOLLogo.png - - - YES - {320, 416} - {512, 512} - - - 2083 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.ie.uia.mx +http://www.uia.mx +polarbears.devteam@gmail.com + + + + + + + + + + + + + \ No newline at end of file diff --git a/MATSOL/Localization/es.lproj/Localizable.strings b/MATSOL/Localization/es.lproj/Localizable.strings index 2195b89..9fe4b5a 100644 Binary files a/MATSOL/Localization/es.lproj/Localizable.strings and b/MATSOL/Localization/es.lproj/Localizable.strings differ diff --git a/MATSOL/MATSOL-Info.plist b/MATSOL/MATSOL-Info.plist index 05e9b14..9eddca1 100644 --- a/MATSOL/MATSOL-Info.plist +++ b/MATSOL/MATSOL-Info.plist @@ -60,5 +60,7 @@ UIInterfaceOrientationPortrait + UIViewControllerBasedStatusBarAppearance + diff --git a/MATSOL/MATSOL.xcodeproj/project.pbxproj b/MATSOL/MATSOL.xcodeproj/project.pbxproj index b95f8fb..711d8d4 100644 --- a/MATSOL/MATSOL.xcodeproj/project.pbxproj +++ b/MATSOL/MATSOL.xcodeproj/project.pbxproj @@ -479,7 +479,12 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0500; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 6976FTX6A2; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MATSOL" */; compatibilityVersion = "Xcode 3.2"; @@ -697,7 +702,8 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Edgar Ortiz Loyola"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -706,7 +712,7 @@ INFOPLIST_FILE = "MATSOL-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = MATSOL; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "470A9DB4-991D-4A7D-A7AC-2F08A8559AB4"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; @@ -715,12 +721,15 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = MATSOL_Prefix.pch; INFOPLIST_FILE = "MATSOL-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = MATSOL; + PROVISIONING_PROFILE = ""; VALIDATE_PRODUCT = YES; }; name = Release; @@ -728,8 +737,7 @@ 9CF1259B126E8C6600CC1D45 /* Distribution */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Distribution: Edgar Ortiz Loyola"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Edgar Ortiz Loyola"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -747,12 +755,15 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = MATSOL_Prefix.pch; INFOPLIST_FILE = "MATSOL-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = MATSOL; + PROVISIONING_PROFILE = ""; VALIDATE_PRODUCT = YES; }; name = Distribution; @@ -760,13 +771,13 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Distribution: Edgar Ortiz Loyola"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Edgar Ortiz Loyola"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE = "470A9DB4-991D-4A7D-A7AC-2F08A8559AB4"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "470A9DB4-991D-4A7D-A7AC-2F08A8559AB4"; SDKROOT = iphoneos; @@ -776,8 +787,7 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Distribution: Edgar Ortiz Loyola"; + CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Edgar Ortiz Loyola"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES;