diff --git a/Classes/CustomAlert.h b/Classes/CustomAlert.h deleted file mode 100644 index 52f0d53..0000000 --- a/Classes/CustomAlert.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// CustomAlert.h -// -// -// Created by Mike Seaby on 30/03/2010. -// Copyright 2010 Mike Seaby. All rights reserved. -// -#import - -@interface CustomAlert : UIAlertView -{ - -} - -+ (void) setBackgroundColor:(UIColor *) background withStrokeColor:(UIColor *) stroke; - -@end diff --git a/Classes/CustomAlert.m b/Classes/CustomAlert.m deleted file mode 100644 index 25004c5..0000000 --- a/Classes/CustomAlert.m +++ /dev/null @@ -1,115 +0,0 @@ -// -// CustomAlert.m -// -// -// Created by Mike Seaby on 30/03/2010. -// Copyright 2010 Mike Seaby. All rights reserved. -// - -#import "CustomAlert.h" - -@interface CustomAlert (Private) - -- (void) drawRoundedRect:(CGRect) rect inContext:(CGContextRef) context withRadius:(CGFloat) radius; - -@end - -static UIColor *fillColor = nil; -static UIColor *borderColor = nil; - -@implementation CustomAlert - -+ (void) setBackgroundColor:(UIColor *) background withStrokeColor:(UIColor *) stroke -{ - if(fillColor != nil) - { - [fillColor release]; - [borderColor release]; - } - - fillColor = [background retain]; - borderColor = [stroke retain]; -} - -- (id)initWithFrame:(CGRect)frame -{ - if((self = [super initWithFrame:frame])) - { - if(fillColor == nil) - { - fillColor = [[UIColor blackColor] retain]; - borderColor = [[UIColor colorWithHue:0.625 saturation:0.0 brightness:0.8 alpha:0.8] retain]; - } - } - - return self; -} - -- (void)drawRect:(CGRect)rect -{ - CGContextRef context = UIGraphicsGetCurrentContext(); - - CGContextClearRect(context, rect); - CGContextSetAllowsAntialiasing(context, true); - CGContextSetLineWidth(context, 0.0); - CGContextSetAlpha(context, 0.8); - CGContextSetLineWidth(context, 2.0); - CGContextSetStrokeColorWithColor(context, [borderColor CGColor]); - CGContextSetFillColorWithColor(context, [fillColor CGColor]); - - // Draw background - CGFloat backOffset = 2; - CGRect backRect = CGRectMake(rect.origin.x + backOffset, rect.origin.y + backOffset, rect.size.width - backOffset*2, rect.size.height - backOffset*2); - [self drawRoundedRect:backRect inContext:context withRadius:8]; //8 - CGContextDrawPath(context, kCGPathFillStroke); - - // Clip Context - CGRect clipRect = CGRectMake(backRect.origin.x + backOffset-1, backRect.origin.y + backOffset-1, backRect.size.width - (backOffset-1)*2, backRect.size.height - (backOffset-1)*2); - [self drawRoundedRect:clipRect inContext:context withRadius:8]; //9 - CGContextClip (context); - - //Draw highlight - CGGradientRef glossGradient; - CGColorSpaceRef rgbColorspace; - size_t num_locations = 2; - CGFloat locations[2] = { 0.0, 1.0 }; - CGFloat components[8] = { 1.0, 1.0, 1.0, 0.35, 1.0, 1.0, 1.0, 0.06 }; - rgbColorspace = CGColorSpaceCreateDeviceRGB(); - glossGradient = CGGradientCreateWithColorComponents(rgbColorspace, components, locations, num_locations); - - CGRect ovalRect = CGRectMake(-130, -115, (rect.size.width*2), rect.size.width/2); - - CGPoint start = CGPointMake(rect.origin.x, rect.origin.y); - CGPoint end = CGPointMake(rect.origin.x, rect.size.height/5); - - CGContextSetAlpha(context, 1.0); - CGContextAddEllipseInRect(context, ovalRect); - CGContextClip (context); - - CGContextDrawLinearGradient(context, glossGradient, start, end, 0); - - CGGradientRelease(glossGradient); - CGColorSpaceRelease(rgbColorspace); -} - -- (void) drawRoundedRect:(CGRect) rrect inContext:(CGContextRef) context withRadius:(CGFloat) radius -{ - CGContextBeginPath (context); - - CGFloat minx = CGRectGetMinX(rrect), midx = CGRectGetMidX(rrect), maxx = CGRectGetMaxX(rrect); - CGFloat miny = CGRectGetMinY(rrect), midy = CGRectGetMidY(rrect), maxy = CGRectGetMaxY(rrect); - - CGContextMoveToPoint(context, minx, midy); - CGContextAddArcToPoint(context, minx, miny, midx, miny, radius); - CGContextAddArcToPoint(context, maxx, miny, maxx, midy, radius); - CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius); - CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius); - CGContextClosePath(context); -} - -- (void)dealloc -{ - [super dealloc]; -} - -@end \ No newline at end of file diff --git a/Classes/ObjC_MixAppDelegate.m b/Classes/ObjC_MixAppDelegate.m index 2054fd9..de70717 100644 --- a/Classes/ObjC_MixAppDelegate.m +++ b/Classes/ObjC_MixAppDelegate.m @@ -35,7 +35,12 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]]; } - //sleep(10); // Delay App start by holding the Default.png for 10 seconds + // Enable Safari's Web Inspector for iOS 5 using a conditional, as app will throw a hissy fit & crash if lower than iOS 5 :) + if ([[[UIDevice currentDevice] systemVersion] floatValue] > 5) { + [NSClassFromString(@"WebView") _enableRemoteInspector]; + } + + //sleep(10); // Delay App start by holding the Default.png for 10 seconds // Fancy Fade/Zoom After Load //********************************* @@ -51,11 +56,10 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { splashView.alpha = 0.0; //splashView.frame = CGRectMake(-60, -85, 440, 635); // Comment this out (or change dimension to match initWithFrame) for fade without zoom. [UIView commitAnimations]; + } - - /* this is the method in charge to remove the detectos it receives a string (the name of the page) you want to remove the detectors diff --git a/Classes/customUIAlert.h b/Classes/customUIAlert.h new file mode 100644 index 0000000..e394774 --- /dev/null +++ b/Classes/customUIAlert.h @@ -0,0 +1,22 @@ +// +// customUIAlert.h +// ObjC-Mix +// +// Created by Mike Seaby on 29/12/2011. +// Copyright (c) 2011 Mike Seaby. All rights reserved. +// + +#import + +@interface customUIAlert : UIAlertView +{ + UIWebView *_webView; + NSString *_currentPage; + NSDictionary* _parameters; +} + +@property (nonatomic, assign) UIWebView *_webView; +@property (retain) NSString *_currentPage; +@property(retain) NSDictionary* _parameters; + +@end diff --git a/Classes/customUIAlert.m b/Classes/customUIAlert.m new file mode 100644 index 0000000..1c9d7be --- /dev/null +++ b/Classes/customUIAlert.m @@ -0,0 +1,174 @@ +// +// customUIAlert.m +// ObjC-Mix +// +// Created by Mike Seaby on 29/12/2011. +// Copyright (c) 2011 Mike Seaby. All rights reserved. +// + +#import "customUIAlert.h" +#import "NKBridge.h" +#import "Nimble.h" +#import + +@implementation customUIAlert +@synthesize _webView, _currentPage, _parameters; + +-(void)customAlert +{ + NSLog(@"Custom Alert Called"); + + customUIAlert *customAlertView = [[customUIAlert alloc] initWithTitle:[_parameters objectForKey:@"title"] + message:[_parameters objectForKey:@"message"] + delegate:self + cancelButtonTitle:[_parameters objectForKey:@"cancel"] + otherButtonTitles:[_parameters objectForKey:@"ok"],nil]; + + [customAlertView show]; + [customAlertView release]; +} + +- (void)layoutSubviews +{ + for (UIView *subview in self.subviews){ + if ([subview isMemberOfClass:[UIImageView class]]) { + subview.hidden = YES; //Hide UIImageView Containing Blue Background + } + + if ([subview isMemberOfClass:[UILabel class]]) { // Point to UILabels To Change Text + UILabel *label = (UILabel*)subview; // Cast From UIView to UILabel + label.textColor = [UIColor colorWithRed:210.0f/255.0f green:210.0f/255.0f blue:210.0f/255.0f alpha:1.0f]; + label.shadowColor = [UIColor blackColor]; + label.shadowOffset = CGSizeMake(0.0f, 1.0f); + } + } +} + + +- (void)drawRect:(CGRect)rect { + + //--------------------------------------------------------------------------------------------------- + + // Image + //UIImage *image = [UIImage imageNamed:@"wbg.png"]; + //[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; + + //--------------------------------------------------------------------------------------------------- + + + + // Reference the Current Graphics Context + CGContextRef context = UIGraphicsGetCurrentContext(); + + // Create a Base Shape + CGRect activeBounds = self.bounds; + CGFloat cornerRadius = 10.0f; // How round do you like your corners? (Try -2.0f for that wonky look!) + CGFloat inset = 2.5f; // Set that inset. Higher values = less padding. + CGFloat originX = activeBounds.origin.x + inset; + CGFloat originY = activeBounds.origin.y + inset; + CGFloat width = activeBounds.size.width - (inset*2.0f); + CGFloat height = activeBounds.size.height - (inset*2.0f); + + CGRect bPathFrame = CGRectMake(originX, originY, width, height); + CGPathRef path = [UIBezierPath bezierPathWithRoundedRect:bPathFrame cornerRadius:cornerRadius].CGPath; + + // Add Fill and Outer Drop Shadow + CGContextAddPath(context, path); + CGContextSetFillColorWithColor(context, [UIColor colorWithRed:210.0f/255.0f green:210.0f/255.0f blue:210.0f/255.0f alpha:1.0f].CGColor); + CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 1.0f), 6.0f, [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:1.0f].CGColor); + CGContextDrawPath(context, kCGPathFill); + + // Clip the Context + CGContextSaveGState(context); //Save Context State Before Clipping To "path" + CGContextAddPath(context, path); + CGContextClip(context); + + // Draw Gradient + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + size_t count = 3; + CGFloat locations[3] = {0.0f, 0.57f, 1.0f}; + CGFloat components[12] = + { + 70.0f/255.0f, 70.0f/255.0f, 70.0f/255.0f, 1.0f, //1 + 55.0f/255.0f, 55.0f/255.0f, 55.0f/255.0f, 1.0f, //2 + 40.0f/255.0f, 40.0f/255.0f, 40.0f/255.0f, 1.0f //3 + }; + CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, components, locations, count); + CGPoint startPoint = CGPointMake(activeBounds.size.width * 0.5f, 0.0f); + CGPoint endPoint = CGPointMake(activeBounds.size.width * 0.5f, activeBounds.size.height); + CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0); + CGColorSpaceRelease(colorSpace); + CGGradientRelease(gradient); + + // Hatched Background + CGFloat buttonOffset = 0.5f; // Offset by half point for crisp lines. Change this value to move hatched area down - try 92.5 for instance + CGContextSaveGState(context); // Save Context State Before Clipping "hatchPath" + CGRect hatchFrame = CGRectMake(0.0f, buttonOffset, activeBounds.size.width, (activeBounds.size.height - buttonOffset+1.0f)); + CGContextClipToRect(context, hatchFrame); + + CGFloat spacer = 4.0f; + int rows = (activeBounds.size.width + activeBounds.size.height/spacer); + CGFloat padding = 0.0f; + CGMutablePathRef hatchPath = CGPathCreateMutable(); + for(int i=1; i<=rows; i++) { + CGPathMoveToPoint(hatchPath, NULL, spacer * i, padding); + CGPathAddLineToPoint(hatchPath, NULL, padding, spacer * i); + } + CGContextAddPath(context, hatchPath); + CGPathRelease(hatchPath); + CGContextSetLineWidth(context, 1.0f); + CGContextSetLineCap(context, kCGLineCapRound); + CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:0.35f].CGColor); + CGContextDrawPath(context, kCGPathStroke); + + // Draw A Separating Line + CGMutablePathRef linePath = CGPathCreateMutable(); + CGFloat linePathY = (buttonOffset - 1.0f); + CGPathMoveToPoint(linePath, NULL, 0.0f, linePathY); + CGPathAddLineToPoint(linePath, NULL, activeBounds.size.width, linePathY); + CGContextAddPath(context, linePath); + CGPathRelease(linePath); + CGContextSetLineWidth(context, 3.0f); + CGContextSaveGState(context); //Save Context State Before Drawing "linePath" Shadow + CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:0.6f].CGColor); + CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 1.0f), 0.0f, [UIColor colorWithRed:255.0f/255.0f green:255.0f/255.0f blue:255.0f/255.0f alpha:0.2f].CGColor); + CGContextDrawPath(context, kCGPathStroke); + CGContextRestoreGState(context); //Restore Context State After Drawing "linePath" Shadow + + // Inner Shadow + CGContextAddPath(context, path); + CGContextSetLineWidth(context, 3.0f); + CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:210.0f/255.0f green:210.0f/255.0f blue:210.0f/255.0f alpha:1.0f].CGColor); + CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 0.0f), 6.0f, [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:1.0f].CGColor); + CGContextDrawPath(context, kCGPathStroke); + + // Redraw The Path to avoid Pixellation + CGContextRestoreGState(context); //Restore First Context State Before Clipping "path" + CGContextAddPath(context, path); + CGContextSetLineWidth(context, 3.0f); + CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:210.0f/255.0f green:210.0f/255.0f blue:210.0f/255.0f alpha:1.0f].CGColor); + CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 0.0f), 0.0f, [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:0.1f].CGColor); + CGContextDrawPath(context, kCGPathStroke); + +} + + + + + +#pragma mark NK Setters + +- (void)setNKWebView:(UIWebView*)view { + self._webView = view; +} + +- (void)setNKCurrentPage:(NSString*)page { + self._currentPage = page; +} + +- (void)setNKParameters:(NSDictionary*)parameters +{ + self._parameters = parameters; +} + +@end diff --git a/Classes/flashLight.m b/Classes/flashLight.m old mode 100644 new mode 100755 index 31244d2..a4ef7f9 --- a/Classes/flashLight.m +++ b/Classes/flashLight.m @@ -19,7 +19,45 @@ - (void)dealloc { } + +#if TARGET_IPHONE_SIMULATOR +#warning *** Simulator: Flashlight only works on device & will crash simulator if called. +#endif + - (id) init { + + + { +#if TARGET_IPHONE_SIMULATOR + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"FYI" message:@"Flashlight not available on simulator. If you try, it WILL crash this app\n\n ;)" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; + + // Add an image to the UIAlertView --------------------------------------------------------------------- + UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 32, 32)]; + + // Get the Layer of imageView + CALayer * l = [imageView layer]; + [l setMasksToBounds:YES]; + [l setCornerRadius:6.0]; + + // Add a border to the image + [l setBorderWidth:2.0]; + [l setBorderColor:[[UIColor whiteColor] CGColor]]; + + NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"icon.png"]]; + UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path]; + [imageView setImage:bkgImg]; + [bkgImg release]; + [path release]; + + [alert addSubview:imageView]; + [imageView release]; + // Image Code Endeth here ------------------------------------------------------------------------------ + + [alert show]; + [alert release]; +#endif + } + if ((self = [super init])) { // initialize flashlight diff --git a/ObjC-Mix.xcodeproj/project.pbxproj b/ObjC-Mix.xcodeproj/project.pbxproj index 32cd947..eb5da24 100755 --- a/ObjC-Mix.xcodeproj/project.pbxproj +++ b/ObjC-Mix.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 1E0A643D13D42F1500E117D8 /* checkJailbreak.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E0A643C13D42F1500E117D8 /* checkJailbreak.m */; }; 1E10ADA113ABAE4800909A64 /* listFilesInDocumentsFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E10ADA013ABAE4800909A64 /* listFilesInDocumentsFolder.m */; }; 1E10ADA313ABAEC800909A64 /* listfiles.html in Resources */ = {isa = PBXBuildFile; fileRef = 1E10ADA213ABAEC800909A64 /* listfiles.html */; }; - 1E1CDEE612E9FA79003F7976 /* CustomAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E1CDEE512E9FA79003F7976 /* CustomAlert.m */; }; 1E1CDEF812E9FC51003F7976 /* ActivityIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E1CDEF712E9FC51003F7976 /* ActivityIndicator.m */; }; 1E2633FB1342483200C22494 /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 1E2633FA1342483200C22494 /* style.css */; }; 1E2724E91330C6E100839B08 /* leftButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E2724E81330C6E100839B08 /* leftButton.m */; }; @@ -27,6 +26,7 @@ 1E312998135B47E200C4D881 /* deShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E312997135B47E200C4D881 /* deShadow.m */; }; 1E3A94B91385324B003A53AB /* flashLight.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E3A94B81385324B003A53AB /* flashLight.m */; }; 1E47B81A133E651D005EF497 /* locale.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E47B819133E651D005EF497 /* locale.m */; }; + 1E4F676314ACA8F300EA3FCB /* customUIAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E4F676214ACA8F300EA3FCB /* customUIAlert.m */; }; 1E6490B4140FBDD30097C5F6 /* undetecttel.html in Resources */ = {isa = PBXBuildFile; fileRef = 1E6490B3140FBDD30097C5F6 /* undetecttel.html */; }; 1E733F4A1382EA4700292604 /* buttonlessAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E733F491382EA4600292604 /* buttonlessAlert.m */; }; 1E733F4D1382EC3F00292604 /* navSpinner.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E733F4C1382EC3F00292604 /* navSpinner.m */; }; @@ -91,8 +91,6 @@ 1E10AD9F13ABAE4800909A64 /* listFilesInDocumentsFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = listFilesInDocumentsFolder.h; sourceTree = ""; }; 1E10ADA013ABAE4800909A64 /* listFilesInDocumentsFolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = listFilesInDocumentsFolder.m; sourceTree = ""; }; 1E10ADA213ABAEC800909A64 /* listfiles.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = listfiles.html; sourceTree = ""; }; - 1E1CDEE412E9FA79003F7976 /* CustomAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomAlert.h; sourceTree = ""; }; - 1E1CDEE512E9FA79003F7976 /* CustomAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomAlert.m; sourceTree = ""; }; 1E1CDEF612E9FC51003F7976 /* ActivityIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityIndicator.h; sourceTree = ""; }; 1E1CDEF712E9FC51003F7976 /* ActivityIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActivityIndicator.m; sourceTree = ""; }; 1E2633FA1342483200C22494 /* style.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = style.css; sourceTree = ""; }; @@ -112,6 +110,8 @@ 1E3A94B81385324B003A53AB /* flashLight.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = flashLight.m; sourceTree = ""; }; 1E47B818133E651D005EF497 /* locale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = locale.h; sourceTree = ""; }; 1E47B819133E651D005EF497 /* locale.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = locale.m; sourceTree = ""; }; + 1E4F676114ACA8F300EA3FCB /* customUIAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = customUIAlert.h; sourceTree = ""; }; + 1E4F676214ACA8F300EA3FCB /* customUIAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = customUIAlert.m; sourceTree = ""; }; 1E6490B3140FBDD30097C5F6 /* undetecttel.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = undetecttel.html; sourceTree = ""; }; 1E733F481382EA4600292604 /* buttonlessAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buttonlessAlert.h; sourceTree = ""; }; 1E733F491382EA4600292604 /* buttonlessAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = buttonlessAlert.m; sourceTree = ""; }; @@ -224,8 +224,8 @@ 1E733F491382EA4600292604 /* buttonlessAlert.m */, 1E0A643B13D42F1500E117D8 /* checkJailbreak.h */, 1E0A643C13D42F1500E117D8 /* checkJailbreak.m */, - 1E1CDEE412E9FA79003F7976 /* CustomAlert.h */, - 1E1CDEE512E9FA79003F7976 /* CustomAlert.m */, + 1E4F676114ACA8F300EA3FCB /* customUIAlert.h */, + 1E4F676214ACA8F300EA3FCB /* customUIAlert.m */, 1ECD2964147C1DDE00FABDB0 /* CompassClass.h */, 1ECD2965147C1DDE00FABDB0 /* CompassClass.m */, 1ECD2966147C1DDE00FABDB0 /* CompassObject.h */, @@ -468,7 +468,6 @@ files = ( 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 1D3623260D0F684500981E51 /* ObjC_MixAppDelegate.m in Sources */, - 1E1CDEE612E9FA79003F7976 /* CustomAlert.m in Sources */, 1E1CDEF812E9FC51003F7976 /* ActivityIndicator.m in Sources */, 1E91B88812EAF73F008FF06A /* battery.m in Sources */, 1E2724E91330C6E100839B08 /* leftButton.m in Sources */, @@ -490,6 +489,7 @@ 1ECD2942147BF69200FABDB0 /* TObject.m in Sources */, 1ECD2968147C1DDE00FABDB0 /* CompassClass.m in Sources */, 1ECD2969147C1DDE00FABDB0 /* CompassObject.m in Sources */, + 1E4F676314ACA8F300EA3FCB /* customUIAlert.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/main.html b/main.html index 640b4f5..6f126a6 100644 --- a/main.html +++ b/main.html @@ -37,8 +37,8 @@ -// NKRegisterClass's -NKRegisterClass("CustomAlert"); +// NKRegisterClasses +NKRegisterClass("customUIAlert"); NKRegisterClass("ActivityIndicator"); NKRegisterClass("webViewController"); NKRegisterClass("battery"); @@ -165,13 +165,12 @@ // ************************************************************************ -function showComposer() + +function showCustomAlert() { - var composer = new NKMailComposer(); - composer.setRecipient("a.voloshyn@gmail.com, voloshyn@me.com"); - composer.setSubject("Email Composer");! - composer.setBody("Message Body!"); - composer.show(); + var customAlert="customAlert?className=customUIAlert&title=Custom Alert&message=This is a customised UIAlertView\n\nWoohoo!&cancel=Lovely!&ok=Nice!" + + CallNKitAction(customAlert); } @@ -179,10 +178,7 @@