Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.mode1v3
*.mode2v3
xcuserdata

.DS_Store
45 changes: 45 additions & 0 deletions Demo/Demo-IOS/Demo-IOS-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>Kiss.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
14 changes: 14 additions & 0 deletions Demo/Demo-IOS/Demo-IOS-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'Demo-IOS' target in the 'Demo-IOS' project
//

#import <Availability.h>

#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
2 changes: 2 additions & 0 deletions Demo/Demo-IOS/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

19 changes: 19 additions & 0 deletions Demo/Demo-IOS/KissAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// KissAppDelegate.h
// Demo-IOS
//
// Created by Dominik Pich on 19.06.12.
// Copyright (c) 2012 Kiss. All rights reserved.
//

#import <UIKit/UIKit.h>

@class KissViewController;

@interface KissAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) KissViewController *viewController;

@end
56 changes: 56 additions & 0 deletions Demo/Demo-IOS/KissAppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// KissAppDelegate.m
// Demo-IOS
//
// Created by Dominik Pich on 19.06.12.
// Copyright (c) 2012 Kiss. All rights reserved.
//

#import "KissAppDelegate.h"

#import "KissViewController.h"

@implementation KissAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[KissViewController alloc] initWithNibName:@"KissViewController_iPhone" bundle:nil];
} else {
self.viewController = [[KissViewController alloc] initWithNibName:@"KissViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
15 changes: 15 additions & 0 deletions Demo/Demo-IOS/KissViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// KissViewController.h
// Demo-IOS
//
// Created by Dominik Pich on 19.06.12.
// Copyright (c) 2012 Kiss. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface KissViewController : UIViewController

@property(weak) IBOutlet UIWebView *webView;
- (IBAction)openAndConvert;
@end
55 changes: 55 additions & 0 deletions Demo/Demo-IOS/KissViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// KissViewController.m
// Demo-IOS
//
// Created by Dominik Pich on 19.06.12.
// Copyright (c) 2012 Kiss. All rights reserved.
//

#import "KissViewController.h"
#import "DDXML.h"

@interface KissViewController ()

@end

@implementation KissViewController

@synthesize webView;

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}

- (IBAction)openAndConvert {
id file = [[NSBundle mainBundle] URLForResource:@"books" withExtension:@"xml"];
id data = [NSData dataWithContentsOfURL:file];
NSXMLDocument *doc = [[NSXMLDocument alloc] initWithData: data options:0 error:nil];

NSArray *tags = [doc nodesForXPath:@"//author" error:nil];
NSMutableString *html = [NSMutableString stringWithString:@"<ul>"];
for (NSXMLNode *node in tags) {
[html appendFormat:@"<li>author:: %@</li>", node.description];
}
[html appendString:@"</ul>"];

[self.webView loadHTMLString:html baseURL:nil];
}
@end
Loading