├── .gitignore ├── Demo ├── Classes │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── ViewController.h │ └── ViewController.m ├── Default-568h@2x.png ├── MainWindow.xib ├── Resources-iPad │ └── MainWindow-iPad.xib ├── SVWeb-Info.plist ├── SVWeb.xcodeproj │ └── project.pbxproj ├── SVWeb_Prefix.pch ├── ViewController.xib └── main.m ├── LICENSE.txt ├── README.md ├── SVWebViewController.podspec └── SVWebViewController ├── SVModalWebViewController.h ├── SVModalWebViewController.m ├── SVWebViewController.bundle ├── SVWebViewControllerBack.png ├── SVWebViewControllerBack@2x.png ├── SVWebViewControllerNext.png └── SVWebViewControllerNext@2x.png ├── SVWebViewController.h ├── SVWebViewController.m ├── UIActivities ├── Chrome │ ├── SVWebViewControllerActivityChrome-iPad.png │ ├── SVWebViewControllerActivityChrome-iPad@2x.png │ ├── SVWebViewControllerActivityChrome.h │ ├── SVWebViewControllerActivityChrome.m │ └── SVWebViewControllerActivityChrome@2x.png ├── SVWebViewControllerActivity.h ├── SVWebViewControllerActivity.m └── Safari │ ├── SVWebViewControllerActivitySafari-iPad.png │ ├── SVWebViewControllerActivitySafari-iPad@2x.png │ ├── SVWebViewControllerActivitySafari.h │ ├── SVWebViewControllerActivitySafari.m │ └── SVWebViewControllerActivitySafari@2x.png ├── da.lproj └── SVWebViewController.strings ├── de.lproj └── SVWebViewController.strings ├── en.lproj └── SVWebViewController.strings ├── es-ES.lproj └── SVWebViewController.strings ├── es.lproj └── SVWebViewController.strings ├── fr.lproj └── SVWebViewController.strings ├── ja.lproj └── SVWebViewController.strings ├── pt.lproj └── SVWebViewController.strings ├── zh-Hans.lproj └── SVWebViewController.strings └── zh-Hant.lproj └── SVWebViewController.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X 2 | *.DS_Store 3 | *.psd 4 | 5 | # Xcode 6 | *.pbxuser 7 | *.mode1v3 8 | *.mode2v3 9 | *.perspectivev3 10 | *.xcuserstate 11 | project.xcworkspace/ 12 | xcuserdata/ 13 | 14 | # Generated files 15 | build/ 16 | *.[oa] 17 | *.pyc 18 | 19 | # Backup files 20 | *~.nib 21 | / graphics/ 22 | 23 | # Cocoapods 24 | Pods 25 | -------------------------------------------------------------------------------- /Demo/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebAppDelegate.h 3 | // SVWebViewController 4 | // 5 | // Created by Sam Vermette on 21.02.11. 6 | // Copyright 2011 Sam Vermette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject { 12 | 13 | UIWindow *window; 14 | UINavigationController *navigationController; 15 | } 16 | 17 | @property (nonatomic, strong) IBOutlet UIWindow *window; 18 | @property (nonatomic, strong) IBOutlet UINavigationController *navigationController; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /Demo/Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebAppDelegate.m 3 | // SVWebViewController 4 | // 5 | // Created by Sam Vermette on 21.02.11. 6 | // Copyright 2011 Sam Vermette. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | 13 | @implementation AppDelegate 14 | @synthesize window; 15 | @synthesize navigationController; 16 | 17 | #pragma mark - 18 | #pragma mark Application lifecycle 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | self.window.rootViewController = navigationController; 22 | [self.window makeKeyAndVisible]; 23 | 24 | return YES; 25 | } 26 | 27 | #pragma mark - 28 | #pragma mark Memory management 29 | 30 | 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Demo/Classes/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // SVWebViewController 4 | // 5 | // Created by Sam Vermette on 21.02.11. 6 | // Copyright 2011 Sam Vermette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | - (IBAction)pushWebViewController; 14 | - (IBAction)presentWebViewController; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Demo/Classes/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.m 3 | // SVWebViewController 4 | // 5 | // Created by Sam Vermette on 21.02.11. 6 | // Copyright 2011 Sam Vermette. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SVWebViewController.h" 11 | #import "SVModalWebViewController.h" 12 | 13 | @implementation ViewController 14 | 15 | 16 | - (void)pushWebViewController { 17 | NSURL *URL = [NSURL URLWithString:@"http://samvermette.com"]; 18 | SVWebViewController *webViewController = [[SVWebViewController alloc] initWithURL:URL]; 19 | [self.navigationController pushViewController:webViewController animated:YES]; 20 | } 21 | 22 | 23 | - (void)presentWebViewController { 24 | NSURL *URL = [NSURL URLWithString:@"http://samvermette.com"]; 25 | SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:URL]; 26 | webViewController.modalPresentationStyle = UIModalPresentationPageSheet; 27 | [self presentViewController:webViewController animated:YES completion:NULL]; 28 | } 29 | 30 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 31 | return YES; 32 | } 33 | 34 | 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /Demo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/Demo/Default-568h@2x.png -------------------------------------------------------------------------------- /Demo/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 851 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBCocoaTouchFramework 34 | 35 | 36 | IBFirstResponder 37 | IBCocoaTouchFramework 38 | 39 | 40 | IBCocoaTouchFramework 41 | 42 | 43 | 44 | 1316 45 | 46 | {320, 480} 47 | 48 | 1 49 | MSAxIDEAA 50 | 51 | NO 52 | NO 53 | 54 | IBCocoaTouchFramework 55 | YES 56 | 57 | 58 | 59 | 60 | 1 61 | 62 | IBCocoaTouchFramework 63 | NO 64 | 65 | 66 | 256 67 | {0, 0} 68 | NO 69 | YES 70 | YES 71 | IBCocoaTouchFramework 72 | 73 | 74 | YES 75 | 76 | 77 | SVWebViewController 78 | 79 | Back 80 | IBCocoaTouchFramework 81 | 1 82 | 83 | IBCocoaTouchFramework 84 | 85 | 86 | ViewController 87 | 88 | 89 | 1 90 | 91 | IBCocoaTouchFramework 92 | NO 93 | 94 | 95 | 96 | 97 | 98 | 99 | YES 100 | 101 | 102 | delegate 103 | 104 | 105 | 106 | 4 107 | 108 | 109 | 110 | window 111 | 112 | 113 | 114 | 5 115 | 116 | 117 | 118 | navigationController 119 | 120 | 121 | 122 | 15 123 | 124 | 125 | 126 | 127 | YES 128 | 129 | 0 130 | 131 | 132 | 133 | 134 | 135 | 2 136 | 137 | 138 | YES 139 | 140 | 141 | 142 | 143 | -1 144 | 145 | 146 | File's Owner 147 | 148 | 149 | 3 150 | 151 | 152 | 153 | 154 | -2 155 | 156 | 157 | 158 | 159 | 9 160 | 161 | 162 | YES 163 | 164 | 165 | 166 | 167 | 168 | 169 | 11 170 | 171 | 172 | 173 | 174 | 13 175 | 176 | 177 | YES 178 | 179 | 180 | 181 | 182 | 183 | 14 184 | 185 | 186 | YES 187 | 188 | 189 | 190 | 191 | 192 | 17 193 | 194 | 195 | 196 | 197 | 198 | 199 | YES 200 | 201 | YES 202 | -1.CustomClassName 203 | -2.CustomClassName 204 | 11.IBPluginDependency 205 | 13.CustomClassName 206 | 13.IBPluginDependency 207 | 2.IBAttributePlaceholdersKey 208 | 2.IBEditorWindowLastContentRect 209 | 2.IBPluginDependency 210 | 3.CustomClassName 211 | 3.IBPluginDependency 212 | 9.IBEditorWindowLastContentRect 213 | 9.IBPluginDependency 214 | 215 | 216 | YES 217 | UIApplication 218 | UIResponder 219 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 220 | ViewController 221 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 222 | 223 | YES 224 | 225 | 226 | YES 227 | 228 | 229 | {{673, 376}, {320, 480}} 230 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 231 | AppDelegate 232 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 233 | {{186, 376}, {320, 480}} 234 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 235 | 236 | 237 | 238 | YES 239 | 240 | 241 | YES 242 | 243 | 244 | 245 | 246 | YES 247 | 248 | 249 | YES 250 | 251 | 252 | 253 | 17 254 | 255 | 256 | 257 | YES 258 | 259 | AppDelegate 260 | NSObject 261 | 262 | YES 263 | 264 | YES 265 | navigationController 266 | window 267 | 268 | 269 | YES 270 | UINavigationController 271 | UIWindow 272 | 273 | 274 | 275 | YES 276 | 277 | YES 278 | navigationController 279 | window 280 | 281 | 282 | YES 283 | 284 | navigationController 285 | UINavigationController 286 | 287 | 288 | window 289 | UIWindow 290 | 291 | 292 | 293 | 294 | IBProjectSource 295 | Classes/AppDelegate.h 296 | 297 | 298 | 299 | AppDelegate 300 | NSObject 301 | 302 | IBUserSource 303 | 304 | 305 | 306 | 307 | UIWindow 308 | UIView 309 | 310 | IBUserSource 311 | 312 | 313 | 314 | 315 | ViewController 316 | UIViewController 317 | 318 | YES 319 | 320 | YES 321 | presentWebViewController 322 | pushWebViewController 323 | 324 | 325 | YES 326 | id 327 | id 328 | 329 | 330 | 331 | YES 332 | 333 | YES 334 | presentWebViewController 335 | pushWebViewController 336 | 337 | 338 | YES 339 | 340 | presentWebViewController 341 | id 342 | 343 | 344 | pushWebViewController 345 | id 346 | 347 | 348 | 349 | 350 | IBProjectSource 351 | Classes/ViewController.h 352 | 353 | 354 | 355 | ViewController 356 | UIViewController 357 | 358 | IBUserSource 359 | 360 | 361 | 362 | 363 | 364 | YES 365 | 366 | NSObject 367 | 368 | IBFrameworkSource 369 | Foundation.framework/Headers/NSError.h 370 | 371 | 372 | 373 | NSObject 374 | 375 | IBFrameworkSource 376 | Foundation.framework/Headers/NSFileManager.h 377 | 378 | 379 | 380 | NSObject 381 | 382 | IBFrameworkSource 383 | Foundation.framework/Headers/NSKeyValueCoding.h 384 | 385 | 386 | 387 | NSObject 388 | 389 | IBFrameworkSource 390 | Foundation.framework/Headers/NSKeyValueObserving.h 391 | 392 | 393 | 394 | NSObject 395 | 396 | IBFrameworkSource 397 | Foundation.framework/Headers/NSKeyedArchiver.h 398 | 399 | 400 | 401 | NSObject 402 | 403 | IBFrameworkSource 404 | Foundation.framework/Headers/NSObject.h 405 | 406 | 407 | 408 | NSObject 409 | 410 | IBFrameworkSource 411 | Foundation.framework/Headers/NSRunLoop.h 412 | 413 | 414 | 415 | NSObject 416 | 417 | IBFrameworkSource 418 | Foundation.framework/Headers/NSThread.h 419 | 420 | 421 | 422 | NSObject 423 | 424 | IBFrameworkSource 425 | Foundation.framework/Headers/NSURL.h 426 | 427 | 428 | 429 | NSObject 430 | 431 | IBFrameworkSource 432 | Foundation.framework/Headers/NSURLConnection.h 433 | 434 | 435 | 436 | NSObject 437 | 438 | IBFrameworkSource 439 | UIKit.framework/Headers/UIAccessibility.h 440 | 441 | 442 | 443 | NSObject 444 | 445 | IBFrameworkSource 446 | UIKit.framework/Headers/UINibLoading.h 447 | 448 | 449 | 450 | NSObject 451 | 452 | IBFrameworkSource 453 | UIKit.framework/Headers/UIResponder.h 454 | 455 | 456 | 457 | UIApplication 458 | UIResponder 459 | 460 | IBFrameworkSource 461 | UIKit.framework/Headers/UIApplication.h 462 | 463 | 464 | 465 | UIBarButtonItem 466 | UIBarItem 467 | 468 | IBFrameworkSource 469 | UIKit.framework/Headers/UIBarButtonItem.h 470 | 471 | 472 | 473 | UIBarItem 474 | NSObject 475 | 476 | IBFrameworkSource 477 | UIKit.framework/Headers/UIBarItem.h 478 | 479 | 480 | 481 | UINavigationBar 482 | UIView 483 | 484 | IBFrameworkSource 485 | UIKit.framework/Headers/UINavigationBar.h 486 | 487 | 488 | 489 | UINavigationController 490 | UIViewController 491 | 492 | IBFrameworkSource 493 | UIKit.framework/Headers/UINavigationController.h 494 | 495 | 496 | 497 | UINavigationItem 498 | NSObject 499 | 500 | 501 | 502 | UIResponder 503 | NSObject 504 | 505 | 506 | 507 | UISearchBar 508 | UIView 509 | 510 | IBFrameworkSource 511 | UIKit.framework/Headers/UISearchBar.h 512 | 513 | 514 | 515 | UISearchDisplayController 516 | NSObject 517 | 518 | IBFrameworkSource 519 | UIKit.framework/Headers/UISearchDisplayController.h 520 | 521 | 522 | 523 | UIView 524 | 525 | IBFrameworkSource 526 | UIKit.framework/Headers/UIPrintFormatter.h 527 | 528 | 529 | 530 | UIView 531 | 532 | IBFrameworkSource 533 | UIKit.framework/Headers/UITextField.h 534 | 535 | 536 | 537 | UIView 538 | UIResponder 539 | 540 | IBFrameworkSource 541 | UIKit.framework/Headers/UIView.h 542 | 543 | 544 | 545 | UIViewController 546 | 547 | 548 | 549 | UIViewController 550 | 551 | IBFrameworkSource 552 | UIKit.framework/Headers/UIPopoverController.h 553 | 554 | 555 | 556 | UIViewController 557 | 558 | IBFrameworkSource 559 | UIKit.framework/Headers/UISplitViewController.h 560 | 561 | 562 | 563 | UIViewController 564 | 565 | IBFrameworkSource 566 | UIKit.framework/Headers/UITabBarController.h 567 | 568 | 569 | 570 | UIViewController 571 | UIResponder 572 | 573 | IBFrameworkSource 574 | UIKit.framework/Headers/UIViewController.h 575 | 576 | 577 | 578 | UIWindow 579 | UIView 580 | 581 | IBFrameworkSource 582 | UIKit.framework/Headers/UIWindow.h 583 | 584 | 585 | 586 | 587 | 0 588 | IBCocoaTouchFramework 589 | 590 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 591 | 592 | 593 | 594 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 595 | 596 | 597 | YES 598 | SVWeb.xcodeproj 599 | 3 600 | 141 601 | 602 | 603 | -------------------------------------------------------------------------------- /Demo/Resources-iPad/MainWindow-iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 851 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | YES 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | YES 22 | 23 | YES 24 | 25 | 26 | YES 27 | 28 | 29 | 30 | YES 31 | 32 | IBFilesOwner 33 | IBIPadFramework 34 | 35 | 36 | IBFirstResponder 37 | IBIPadFramework 38 | 39 | 40 | IBIPadFramework 41 | 42 | 43 | 44 | 1316 45 | 46 | {768, 1024} 47 | 48 | 1 49 | MSAxIDEAA 50 | 51 | NO 52 | NO 53 | 54 | 2 55 | 56 | IBIPadFramework 57 | YES 58 | 59 | 60 | 61 | 62 | 1 63 | 64 | IBIPadFramework 65 | NO 66 | 67 | 68 | 256 69 | {0, 0} 70 | NO 71 | YES 72 | YES 73 | IBIPadFramework 74 | 75 | 76 | YES 77 | 78 | 79 | SVWebViewController 80 | 81 | Back 82 | IBIPadFramework 83 | 1 84 | 85 | IBIPadFramework 86 | 87 | 88 | ViewController 89 | 90 | 91 | 1 92 | 93 | IBIPadFramework 94 | NO 95 | 96 | 97 | 98 | 99 | 100 | 101 | YES 102 | 103 | 104 | delegate 105 | 106 | 107 | 108 | 4 109 | 110 | 111 | 112 | window 113 | 114 | 115 | 116 | 5 117 | 118 | 119 | 120 | navigationController 121 | 122 | 123 | 124 | 15 125 | 126 | 127 | 128 | 129 | YES 130 | 131 | 0 132 | 133 | 134 | 135 | 136 | 137 | 2 138 | 139 | 140 | YES 141 | 142 | 143 | 144 | 145 | -1 146 | 147 | 148 | File's Owner 149 | 150 | 151 | 3 152 | 153 | 154 | 155 | 156 | -2 157 | 158 | 159 | 160 | 161 | 9 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | 170 | 171 | 11 172 | 173 | 174 | 175 | 176 | 13 177 | 178 | 179 | YES 180 | 181 | 182 | 183 | 184 | 185 | 14 186 | 187 | 188 | YES 189 | 190 | 191 | 192 | 193 | 194 | 17 195 | 196 | 197 | 198 | 199 | 200 | 201 | YES 202 | 203 | YES 204 | -1.CustomClassName 205 | -2.CustomClassName 206 | 11.IBPluginDependency 207 | 13.CustomClassName 208 | 13.IBLastUsedUIStatusBarStylesToTargetRuntimesMap 209 | 13.IBPluginDependency 210 | 2.IBAttributePlaceholdersKey 211 | 2.IBEditorWindowLastContentRect 212 | 2.IBLastUsedUIStatusBarStylesToTargetRuntimesMap 213 | 2.IBPluginDependency 214 | 3.CustomClassName 215 | 3.IBPluginDependency 216 | 9.IBEditorWindowLastContentRect 217 | 9.IBLastUsedUIStatusBarStylesToTargetRuntimesMap 218 | 9.IBPluginDependency 219 | 220 | 221 | YES 222 | UIApplication 223 | UIResponder 224 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 225 | ViewController 226 | 227 | IBCocoaTouchFramework 228 | 229 | 230 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 231 | 232 | YES 233 | 234 | 235 | YES 236 | 237 | 238 | {{673, 376}, {320, 480}} 239 | 240 | IBCocoaTouchFramework 241 | 242 | 243 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 244 | AppDelegate 245 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 246 | {{186, 376}, {320, 480}} 247 | 248 | IBCocoaTouchFramework 249 | 250 | 251 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 252 | 253 | 254 | 255 | YES 256 | 257 | 258 | YES 259 | 260 | 261 | 262 | 263 | YES 264 | 265 | 266 | YES 267 | 268 | 269 | 270 | 17 271 | 272 | 273 | 274 | YES 275 | 276 | AppDelegate 277 | NSObject 278 | 279 | YES 280 | 281 | YES 282 | navigationController 283 | window 284 | 285 | 286 | YES 287 | UINavigationController 288 | UIWindow 289 | 290 | 291 | 292 | YES 293 | 294 | YES 295 | navigationController 296 | window 297 | 298 | 299 | YES 300 | 301 | navigationController 302 | UINavigationController 303 | 304 | 305 | window 306 | UIWindow 307 | 308 | 309 | 310 | 311 | IBProjectSource 312 | Classes/AppDelegate.h 313 | 314 | 315 | 316 | AppDelegate 317 | NSObject 318 | 319 | IBUserSource 320 | 321 | 322 | 323 | 324 | UIWindow 325 | UIView 326 | 327 | IBUserSource 328 | 329 | 330 | 331 | 332 | ViewController 333 | UIViewController 334 | 335 | YES 336 | 337 | YES 338 | presentWebViewController 339 | pushWebViewController 340 | 341 | 342 | YES 343 | id 344 | id 345 | 346 | 347 | 348 | YES 349 | 350 | YES 351 | presentWebViewController 352 | pushWebViewController 353 | 354 | 355 | YES 356 | 357 | presentWebViewController 358 | id 359 | 360 | 361 | pushWebViewController 362 | id 363 | 364 | 365 | 366 | 367 | IBProjectSource 368 | Classes/ViewController.h 369 | 370 | 371 | 372 | ViewController 373 | UIViewController 374 | 375 | IBUserSource 376 | 377 | 378 | 379 | 380 | 381 | YES 382 | 383 | NSObject 384 | 385 | IBFrameworkSource 386 | Foundation.framework/Headers/NSError.h 387 | 388 | 389 | 390 | NSObject 391 | 392 | IBFrameworkSource 393 | Foundation.framework/Headers/NSFileManager.h 394 | 395 | 396 | 397 | NSObject 398 | 399 | IBFrameworkSource 400 | Foundation.framework/Headers/NSKeyValueCoding.h 401 | 402 | 403 | 404 | NSObject 405 | 406 | IBFrameworkSource 407 | Foundation.framework/Headers/NSKeyValueObserving.h 408 | 409 | 410 | 411 | NSObject 412 | 413 | IBFrameworkSource 414 | Foundation.framework/Headers/NSKeyedArchiver.h 415 | 416 | 417 | 418 | NSObject 419 | 420 | IBFrameworkSource 421 | Foundation.framework/Headers/NSObject.h 422 | 423 | 424 | 425 | NSObject 426 | 427 | IBFrameworkSource 428 | Foundation.framework/Headers/NSRunLoop.h 429 | 430 | 431 | 432 | NSObject 433 | 434 | IBFrameworkSource 435 | Foundation.framework/Headers/NSThread.h 436 | 437 | 438 | 439 | NSObject 440 | 441 | IBFrameworkSource 442 | Foundation.framework/Headers/NSURL.h 443 | 444 | 445 | 446 | NSObject 447 | 448 | IBFrameworkSource 449 | Foundation.framework/Headers/NSURLConnection.h 450 | 451 | 452 | 453 | NSObject 454 | 455 | IBFrameworkSource 456 | UIKit.framework/Headers/UIAccessibility.h 457 | 458 | 459 | 460 | NSObject 461 | 462 | IBFrameworkSource 463 | UIKit.framework/Headers/UINibLoading.h 464 | 465 | 466 | 467 | NSObject 468 | 469 | IBFrameworkSource 470 | UIKit.framework/Headers/UIResponder.h 471 | 472 | 473 | 474 | UIApplication 475 | UIResponder 476 | 477 | IBFrameworkSource 478 | UIKit.framework/Headers/UIApplication.h 479 | 480 | 481 | 482 | UIBarButtonItem 483 | UIBarItem 484 | 485 | IBFrameworkSource 486 | UIKit.framework/Headers/UIBarButtonItem.h 487 | 488 | 489 | 490 | UIBarItem 491 | NSObject 492 | 493 | IBFrameworkSource 494 | UIKit.framework/Headers/UIBarItem.h 495 | 496 | 497 | 498 | UINavigationBar 499 | UIView 500 | 501 | IBFrameworkSource 502 | UIKit.framework/Headers/UINavigationBar.h 503 | 504 | 505 | 506 | UINavigationController 507 | UIViewController 508 | 509 | IBFrameworkSource 510 | UIKit.framework/Headers/UINavigationController.h 511 | 512 | 513 | 514 | UINavigationItem 515 | NSObject 516 | 517 | 518 | 519 | UIResponder 520 | NSObject 521 | 522 | 523 | 524 | UISearchBar 525 | UIView 526 | 527 | IBFrameworkSource 528 | UIKit.framework/Headers/UISearchBar.h 529 | 530 | 531 | 532 | UISearchDisplayController 533 | NSObject 534 | 535 | IBFrameworkSource 536 | UIKit.framework/Headers/UISearchDisplayController.h 537 | 538 | 539 | 540 | UIView 541 | 542 | IBFrameworkSource 543 | UIKit.framework/Headers/UIPrintFormatter.h 544 | 545 | 546 | 547 | UIView 548 | 549 | IBFrameworkSource 550 | UIKit.framework/Headers/UITextField.h 551 | 552 | 553 | 554 | UIView 555 | UIResponder 556 | 557 | IBFrameworkSource 558 | UIKit.framework/Headers/UIView.h 559 | 560 | 561 | 562 | UIViewController 563 | 564 | 565 | 566 | UIViewController 567 | 568 | IBFrameworkSource 569 | UIKit.framework/Headers/UIPopoverController.h 570 | 571 | 572 | 573 | UIViewController 574 | 575 | IBFrameworkSource 576 | UIKit.framework/Headers/UISplitViewController.h 577 | 578 | 579 | 580 | UIViewController 581 | 582 | IBFrameworkSource 583 | UIKit.framework/Headers/UITabBarController.h 584 | 585 | 586 | 587 | UIViewController 588 | UIResponder 589 | 590 | IBFrameworkSource 591 | UIKit.framework/Headers/UIViewController.h 592 | 593 | 594 | 595 | UIWindow 596 | UIView 597 | 598 | IBFrameworkSource 599 | UIKit.framework/Headers/UIWindow.h 600 | 601 | 602 | 603 | 604 | 0 605 | IBIPadFramework 606 | 607 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 608 | 609 | 610 | 611 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 612 | 613 | 614 | YES 615 | ../SVWeb.xcodeproj 616 | 3 617 | 141 618 | 619 | 620 | -------------------------------------------------------------------------------- /Demo/SVWeb-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.1 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | NSMainNibFile~ipad 30 | MainWindow-iPad 31 | 32 | 33 | -------------------------------------------------------------------------------- /Demo/SVWeb.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 220F0B9F138E0EF400F59FC3 /* SVWebViewController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 220F0B9E138E0EF400F59FC3 /* SVWebViewController.bundle */; }; 15 | 221C80AF13BBDA2F005F0AB8 /* SVWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */; }; 16 | 22473B9C133800DD00F497E6 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22473B9B133800DD00F497E6 /* MainWindow-iPad.xib */; }; 17 | 22AAF0B61831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0AB1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad.png */; }; 18 | 22AAF0B71831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0AC1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad@2x.png */; }; 19 | 22AAF0B81831F52F00AB15C4 /* SVWebViewControllerActivityChrome.m in Sources */ = {isa = PBXBuildFile; fileRef = 22AAF0AE1831F52F00AB15C4 /* SVWebViewControllerActivityChrome.m */; }; 20 | 22AAF0B91831F52F00AB15C4 /* SVWebViewControllerActivityChrome@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0AF1831F52F00AB15C4 /* SVWebViewControllerActivityChrome@2x.png */; }; 21 | 22AAF0BA1831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0B11831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad.png */; }; 22 | 22AAF0BB1831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0B21831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad@2x.png */; }; 23 | 22AAF0BC1831F52F00AB15C4 /* SVWebViewControllerActivitySafari.m in Sources */ = {isa = PBXBuildFile; fileRef = 22AAF0B41831F52F00AB15C4 /* SVWebViewControllerActivitySafari.m */; }; 24 | 22AAF0BD1831F52F00AB15C4 /* SVWebViewControllerActivitySafari@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0B51831F52F00AB15C4 /* SVWebViewControllerActivitySafari@2x.png */; }; 25 | 22AAF0BF1831F5B300AB15C4 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 22AAF0BE1831F5B300AB15C4 /* README.md */; }; 26 | 22DBB66A1831E05D0008887C /* SVWebViewControllerActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 22DBB6691831E05D0008887C /* SVWebViewControllerActivity.m */; }; 27 | 22F087701458794B003ECD31 /* SVModalWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */; }; 28 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; 29 | 28C286E10D94DF7D0034E888 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* ViewController.m */; }; 30 | 28F335F11007B36200424DE2 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* ViewController.xib */; }; 31 | D53D8F1316A8688600711E30 /* SVWebViewController.strings in Resources */ = {isa = PBXBuildFile; fileRef = D53D8F1516A8688600711E30 /* SVWebViewController.strings */; }; 32 | D5FA63C516A8707A0087531C /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D5FA63C416A8707A0087531C /* Default-568h@2x.png */; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXFileReference section */ 36 | 0447A15218E0E27C001D8D50 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/SVWebViewController.strings; sourceTree = ""; }; 37 | 1A3406D316B7F32300150B11 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/SVWebViewController.strings"; sourceTree = ""; }; 38 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 39 | 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 1D6058910D05DD3D006BFB54 /* SVWeb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SVWeb.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 220F0B9E138E0EF400F59FC3 /* SVWebViewController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = SVWebViewController.bundle; sourceTree = ""; }; 44 | 221C80AD13BBDA2F005F0AB8 /* SVWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWebViewController.h; sourceTree = ""; }; 45 | 221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVWebViewController.m; sourceTree = ""; }; 46 | 22473B9B133800DD00F497E6 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = ""; }; 47 | 22AAF0AB1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivityChrome-iPad.png"; sourceTree = ""; }; 48 | 22AAF0AC1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivityChrome-iPad@2x.png"; sourceTree = ""; }; 49 | 22AAF0AD1831F52F00AB15C4 /* SVWebViewControllerActivityChrome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWebViewControllerActivityChrome.h; sourceTree = ""; }; 50 | 22AAF0AE1831F52F00AB15C4 /* SVWebViewControllerActivityChrome.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVWebViewControllerActivityChrome.m; sourceTree = ""; }; 51 | 22AAF0AF1831F52F00AB15C4 /* SVWebViewControllerActivityChrome@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivityChrome@2x.png"; sourceTree = ""; }; 52 | 22AAF0B11831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivitySafari-iPad.png"; sourceTree = ""; }; 53 | 22AAF0B21831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivitySafari-iPad@2x.png"; sourceTree = ""; }; 54 | 22AAF0B31831F52F00AB15C4 /* SVWebViewControllerActivitySafari.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWebViewControllerActivitySafari.h; sourceTree = ""; }; 55 | 22AAF0B41831F52F00AB15C4 /* SVWebViewControllerActivitySafari.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVWebViewControllerActivitySafari.m; sourceTree = ""; }; 56 | 22AAF0B51831F52F00AB15C4 /* SVWebViewControllerActivitySafari@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SVWebViewControllerActivitySafari@2x.png"; sourceTree = ""; }; 57 | 22AAF0BE1831F5B300AB15C4 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 58 | 22B0DA4C1832008E00B331B3 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/SVWebViewController.strings; sourceTree = ""; }; 59 | 22DBB6681831E05D0008887C /* SVWebViewControllerActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWebViewControllerActivity.h; sourceTree = ""; }; 60 | 22DBB6691831E05D0008887C /* SVWebViewControllerActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVWebViewControllerActivity.m; sourceTree = ""; }; 61 | 22F0876E1458794B003ECD31 /* SVModalWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVModalWebViewController.h; sourceTree = ""; }; 62 | 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVModalWebViewController.m; sourceTree = ""; }; 63 | 28A0AAE50D9B0CCF005BE974 /* SVWeb_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVWeb_Prefix.pch; sourceTree = ""; }; 64 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 65 | 28C286DF0D94DF7D0034E888 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 66 | 28C286E00D94DF7D0034E888 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 67 | 28F335F01007B36200424DE2 /* ViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ViewController.xib; path = ../ViewController.xib; sourceTree = ""; }; 68 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 69 | 431F485D17145A510045AA32 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SVWebViewController.strings; sourceTree = ""; }; 70 | 627D469418D9EA4300E514BB /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/SVWebViewController.strings; sourceTree = ""; }; 71 | 6DAD2E4EAB184F72ACE29999 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | 8D1107310486CEB800E47090 /* SVWeb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SVWeb-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 73 | A0667BBC457D4307AC51AC26 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; 74 | D53D8F1716A868C900711E30 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/SVWebViewController.strings; sourceTree = ""; }; 75 | D53D8F1816A8693200711E30 /* es-ES */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-ES"; path = "es-ES.lproj/SVWebViewController.strings"; sourceTree = ""; }; 76 | D53D8F1916A8693A00711E30 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/SVWebViewController.strings; sourceTree = ""; }; 77 | D5FA63C416A8707A0087531C /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 78 | /* End PBXFileReference section */ 79 | 80 | /* Begin PBXFrameworksBuildPhase section */ 81 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 82 | isa = PBXFrameworksBuildPhase; 83 | buildActionMask = 2147483647; 84 | files = ( 85 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 86 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 080E96DDFE201D6D7F000001 /* Classes */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 28C286DF0D94DF7D0034E888 /* ViewController.h */, 97 | 28C286E00D94DF7D0034E888 /* ViewController.m */, 98 | 28F335F01007B36200424DE2 /* ViewController.xib */, 99 | 1D3623240D0F684500981E51 /* AppDelegate.h */, 100 | 1D3623250D0F684500981E51 /* AppDelegate.m */, 101 | ); 102 | path = Classes; 103 | sourceTree = ""; 104 | }; 105 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 1D6058910D05DD3D006BFB54 /* SVWeb.app */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 2214586C13132D3200ED7D83 /* SVWebViewController */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 22F0876E1458794B003ECD31 /* SVModalWebViewController.h */, 117 | 22F0876F1458794B003ECD31 /* SVModalWebViewController.m */, 118 | 220F0B9E138E0EF400F59FC3 /* SVWebViewController.bundle */, 119 | 221C80AD13BBDA2F005F0AB8 /* SVWebViewController.h */, 120 | 221C80AE13BBDA2F005F0AB8 /* SVWebViewController.m */, 121 | D53D8F1516A8688600711E30 /* SVWebViewController.strings */, 122 | 22DBB63A1831DD8C0008887C /* UIActivities */, 123 | ); 124 | name = SVWebViewController; 125 | path = ../SVWebViewController; 126 | sourceTree = SOURCE_ROOT; 127 | }; 128 | 22473B9A133800DC00F497E6 /* Resources-iPad */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 22473B9B133800DD00F497E6 /* MainWindow-iPad.xib */, 132 | ); 133 | name = "Resources-iPad"; 134 | sourceTree = ""; 135 | }; 136 | 22AAF0AA1831F52F00AB15C4 /* Chrome */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 22AAF0AB1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad.png */, 140 | 22AAF0AC1831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad@2x.png */, 141 | 22AAF0AD1831F52F00AB15C4 /* SVWebViewControllerActivityChrome.h */, 142 | 22AAF0AE1831F52F00AB15C4 /* SVWebViewControllerActivityChrome.m */, 143 | 22AAF0AF1831F52F00AB15C4 /* SVWebViewControllerActivityChrome@2x.png */, 144 | ); 145 | path = Chrome; 146 | sourceTree = ""; 147 | }; 148 | 22AAF0B01831F52F00AB15C4 /* Safari */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 22AAF0B11831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad.png */, 152 | 22AAF0B21831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad@2x.png */, 153 | 22AAF0B31831F52F00AB15C4 /* SVWebViewControllerActivitySafari.h */, 154 | 22AAF0B41831F52F00AB15C4 /* SVWebViewControllerActivitySafari.m */, 155 | 22AAF0B51831F52F00AB15C4 /* SVWebViewControllerActivitySafari@2x.png */, 156 | ); 157 | path = Safari; 158 | sourceTree = ""; 159 | }; 160 | 22DBB63A1831DD8C0008887C /* UIActivities */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 22DBB6681831E05D0008887C /* SVWebViewControllerActivity.h */, 164 | 22DBB6691831E05D0008887C /* SVWebViewControllerActivity.m */, 165 | 22AAF0B01831F52F00AB15C4 /* Safari */, 166 | 22AAF0AA1831F52F00AB15C4 /* Chrome */, 167 | ); 168 | path = UIActivities; 169 | sourceTree = ""; 170 | }; 171 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 22AAF0BE1831F5B300AB15C4 /* README.md */, 175 | 080E96DDFE201D6D7F000001 /* Classes */, 176 | 2214586C13132D3200ED7D83 /* SVWebViewController */, 177 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 178 | 29B97317FDCFA39411CA2CEA /* Resources */, 179 | 22473B9A133800DC00F497E6 /* Resources-iPad */, 180 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 181 | 19C28FACFE9D520D11CA2CBB /* Products */, 182 | A0667BBC457D4307AC51AC26 /* Pods.xcconfig */, 183 | ); 184 | name = CustomTemplate; 185 | sourceTree = ""; 186 | }; 187 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 28A0AAE50D9B0CCF005BE974 /* SVWeb_Prefix.pch */, 191 | 29B97316FDCFA39411CA2CEA /* main.m */, 192 | ); 193 | name = "Other Sources"; 194 | sourceTree = ""; 195 | }; 196 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | 28AD735F0D9D9599002E5188 /* MainWindow.xib */, 200 | D5FA63C416A8707A0087531C /* Default-568h@2x.png */, 201 | 8D1107310486CEB800E47090 /* SVWeb-Info.plist */, 202 | ); 203 | name = Resources; 204 | sourceTree = ""; 205 | }; 206 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 210 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 211 | 6DAD2E4EAB184F72ACE29999 /* libPods.a */, 212 | ); 213 | name = Frameworks; 214 | sourceTree = ""; 215 | }; 216 | /* End PBXGroup section */ 217 | 218 | /* Begin PBXNativeTarget section */ 219 | 1D6058900D05DD3D006BFB54 /* SVWeb */ = { 220 | isa = PBXNativeTarget; 221 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SVWeb" */; 222 | buildPhases = ( 223 | 1D60588D0D05DD3D006BFB54 /* Resources */, 224 | 1D60588E0D05DD3D006BFB54 /* Sources */, 225 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 226 | ); 227 | buildRules = ( 228 | ); 229 | dependencies = ( 230 | ); 231 | name = SVWeb; 232 | productName = SVWeb; 233 | productReference = 1D6058910D05DD3D006BFB54 /* SVWeb.app */; 234 | productType = "com.apple.product-type.application"; 235 | }; 236 | /* End PBXNativeTarget section */ 237 | 238 | /* Begin PBXProject section */ 239 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 240 | isa = PBXProject; 241 | attributes = { 242 | LastUpgradeCheck = 0500; 243 | }; 244 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SVWeb" */; 245 | compatibilityVersion = "Xcode 3.2"; 246 | developmentRegion = English; 247 | hasScannedForEncodings = 1; 248 | knownRegions = ( 249 | English, 250 | Japanese, 251 | French, 252 | German, 253 | en, 254 | fr, 255 | de, 256 | "es-ES", 257 | es, 258 | "zh-Hant", 259 | cs, 260 | eu, 261 | fi, 262 | it, 263 | ja, 264 | ko, 265 | nl, 266 | no, 267 | pl, 268 | pt, 269 | ru, 270 | sk, 271 | sv, 272 | vi, 273 | zh_CN, 274 | ); 275 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 276 | projectDirPath = ""; 277 | projectRoot = ""; 278 | targets = ( 279 | 1D6058900D05DD3D006BFB54 /* SVWeb */, 280 | ); 281 | }; 282 | /* End PBXProject section */ 283 | 284 | /* Begin PBXResourcesBuildPhase section */ 285 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, 290 | 22AAF0BA1831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad.png in Resources */, 291 | 22AAF0BB1831F52F00AB15C4 /* SVWebViewControllerActivitySafari-iPad@2x.png in Resources */, 292 | 22AAF0B71831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad@2x.png in Resources */, 293 | 22AAF0B61831F52F00AB15C4 /* SVWebViewControllerActivityChrome-iPad.png in Resources */, 294 | 28F335F11007B36200424DE2 /* ViewController.xib in Resources */, 295 | 22473B9C133800DD00F497E6 /* MainWindow-iPad.xib in Resources */, 296 | 220F0B9F138E0EF400F59FC3 /* SVWebViewController.bundle in Resources */, 297 | 22AAF0BD1831F52F00AB15C4 /* SVWebViewControllerActivitySafari@2x.png in Resources */, 298 | 22AAF0BF1831F5B300AB15C4 /* README.md in Resources */, 299 | D53D8F1316A8688600711E30 /* SVWebViewController.strings in Resources */, 300 | 22AAF0B91831F52F00AB15C4 /* SVWebViewControllerActivityChrome@2x.png in Resources */, 301 | D5FA63C516A8707A0087531C /* Default-568h@2x.png in Resources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXResourcesBuildPhase section */ 306 | 307 | /* Begin PBXSourcesBuildPhase section */ 308 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 309 | isa = PBXSourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 313 | 22DBB66A1831E05D0008887C /* SVWebViewControllerActivity.m in Sources */, 314 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, 315 | 28C286E10D94DF7D0034E888 /* ViewController.m in Sources */, 316 | 221C80AF13BBDA2F005F0AB8 /* SVWebViewController.m in Sources */, 317 | 22F087701458794B003ECD31 /* SVModalWebViewController.m in Sources */, 318 | 22AAF0B81831F52F00AB15C4 /* SVWebViewControllerActivityChrome.m in Sources */, 319 | 22AAF0BC1831F52F00AB15C4 /* SVWebViewControllerActivitySafari.m in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | /* End PBXSourcesBuildPhase section */ 324 | 325 | /* Begin PBXVariantGroup section */ 326 | D53D8F1516A8688600711E30 /* SVWebViewController.strings */ = { 327 | isa = PBXVariantGroup; 328 | children = ( 329 | D53D8F1716A868C900711E30 /* en */, 330 | D53D8F1816A8693200711E30 /* es-ES */, 331 | D53D8F1916A8693A00711E30 /* es */, 332 | 1A3406D316B7F32300150B11 /* zh-Hant */, 333 | 431F485D17145A510045AA32 /* fr */, 334 | 22B0DA4C1832008E00B331B3 /* ja */, 335 | 627D469418D9EA4300E514BB /* de */, 336 | 0447A15218E0E27C001D8D50 /* pt */, 337 | ); 338 | name = SVWebViewController.strings; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | ALWAYS_SEARCH_USER_PATHS = NO; 348 | CLANG_ENABLE_OBJC_ARC = YES; 349 | COPY_PHASE_STRIP = NO; 350 | GCC_DYNAMIC_NO_PIC = NO; 351 | GCC_OPTIMIZATION_LEVEL = 0; 352 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 353 | GCC_PREFIX_HEADER = SVWeb_Prefix.pch; 354 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 355 | INFOPLIST_FILE = "SVWeb-Info.plist"; 356 | PRODUCT_NAME = SVWeb; 357 | SDKROOT = iphoneos; 358 | TARGETED_DEVICE_FAMILY = "1,2"; 359 | }; 360 | name = Debug; 361 | }; 362 | C01FCF4F08A954540054247B /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | CLANG_ENABLE_OBJC_ARC = NO; 366 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 367 | GCC_C_LANGUAGE_STANDARD = c99; 368 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 369 | GCC_WARN_UNDECLARED_SELECTOR = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 372 | ONLY_ACTIVE_ARCH = YES; 373 | SDKROOT = iphoneos; 374 | }; 375 | name = Debug; 376 | }; 377 | /* End XCBuildConfiguration section */ 378 | 379 | /* Begin XCConfigurationList section */ 380 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SVWeb" */ = { 381 | isa = XCConfigurationList; 382 | buildConfigurations = ( 383 | 1D6058940D05DD3E006BFB54 /* Debug */, 384 | ); 385 | defaultConfigurationIsVisible = 0; 386 | defaultConfigurationName = Debug; 387 | }; 388 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SVWeb" */ = { 389 | isa = XCConfigurationList; 390 | buildConfigurations = ( 391 | C01FCF4F08A954540054247B /* Debug */, 392 | ); 393 | defaultConfigurationIsVisible = 0; 394 | defaultConfigurationName = Debug; 395 | }; 396 | /* End XCConfigurationList section */ 397 | }; 398 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 399 | } 400 | -------------------------------------------------------------------------------- /Demo/SVWeb_Prefix.pch: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | #ifndef __IPHONE_3_0 6 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 7 | #endif 8 | 9 | 10 | #ifdef __OBJC__ 11 | #import 12 | #import 13 | #endif 14 | -------------------------------------------------------------------------------- /Demo/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 851 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 292 43 | 44 | YES 45 | 46 | 47 | 301 48 | {{30, 214}, {260, 44}} 49 | 50 | NO 51 | IBCocoaTouchFramework 52 | 0 53 | 0 54 | 55 | Helvetica-Bold 56 | 17 57 | 16 58 | 59 | 1 60 | presentController 61 | 62 | 3 63 | MQA 64 | 65 | 66 | 1 67 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 68 | 69 | 70 | 3 71 | MC41AA 72 | 73 | 74 | 75 | 76 | 301 77 | {{30, 105}, {260, 44}} 78 | 79 | NO 80 | IBCocoaTouchFramework 81 | 0 82 | 0 83 | 84 | 1 85 | pushController 86 | 87 | 88 | 1 89 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 90 | 91 | 92 | 93 | 94 | {320, 460} 95 | 96 | 97 | 3 98 | MC45AA 99 | 100 | IBCocoaTouchFramework 101 | 102 | 103 | 104 | 105 | YES 106 | 107 | 108 | view 109 | 110 | 111 | 112 | 7 113 | 114 | 115 | 116 | presentWebViewController 117 | 118 | 119 | 7 120 | 121 | 10 122 | 123 | 124 | 125 | pushWebViewController 126 | 127 | 128 | 7 129 | 130 | 11 131 | 132 | 133 | 134 | 135 | YES 136 | 137 | 0 138 | 139 | 140 | 141 | 142 | 143 | -1 144 | 145 | 146 | File's Owner 147 | 148 | 149 | -2 150 | 151 | 152 | 153 | 154 | 6 155 | 156 | 157 | YES 158 | 159 | 160 | 161 | 162 | 163 | 164 | 8 165 | 166 | 167 | 168 | 169 | 9 170 | 171 | 172 | 173 | 174 | 175 | 176 | YES 177 | 178 | YES 179 | -1.CustomClassName 180 | -2.CustomClassName 181 | 6.IBEditorWindowLastContentRect 182 | 6.IBPluginDependency 183 | 8.IBPluginDependency 184 | 8.IBViewBoundsToFrameTransform 185 | 9.IBPluginDependency 186 | 9.IBViewBoundsToFrameTransform 187 | 188 | 189 | YES 190 | ViewController 191 | UIResponder 192 | {{1403, 760}, {320, 460}} 193 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 194 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 195 | 196 | P4AAAL+AAABDEgAAwsAAAA 197 | 198 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 199 | 200 | P4AAAL+AAABDEgAAQVAAAA 201 | 202 | 203 | 204 | 205 | YES 206 | 207 | 208 | YES 209 | 210 | 211 | 212 | 213 | YES 214 | 215 | 216 | YES 217 | 218 | 219 | 220 | 11 221 | 222 | 223 | 224 | YES 225 | 226 | ViewController 227 | UIViewController 228 | 229 | YES 230 | 231 | YES 232 | presentWebViewController 233 | pushWebViewController 234 | 235 | 236 | YES 237 | id 238 | id 239 | 240 | 241 | 242 | YES 243 | 244 | YES 245 | presentWebViewController 246 | pushWebViewController 247 | 248 | 249 | YES 250 | 251 | presentWebViewController 252 | id 253 | 254 | 255 | pushWebViewController 256 | id 257 | 258 | 259 | 260 | 261 | IBProjectSource 262 | Classes/ViewController.h 263 | 264 | 265 | 266 | ViewController 267 | UIViewController 268 | 269 | IBUserSource 270 | 271 | 272 | 273 | 274 | 275 | YES 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSError.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSFileManager.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSKeyValueCoding.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSKeyValueObserving.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSKeyedArchiver.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSObject.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | Foundation.framework/Headers/NSRunLoop.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | Foundation.framework/Headers/NSThread.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | Foundation.framework/Headers/NSURL.h 337 | 338 | 339 | 340 | NSObject 341 | 342 | IBFrameworkSource 343 | Foundation.framework/Headers/NSURLConnection.h 344 | 345 | 346 | 347 | NSObject 348 | 349 | IBFrameworkSource 350 | UIKit.framework/Headers/UIAccessibility.h 351 | 352 | 353 | 354 | NSObject 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UINibLoading.h 358 | 359 | 360 | 361 | NSObject 362 | 363 | IBFrameworkSource 364 | UIKit.framework/Headers/UIResponder.h 365 | 366 | 367 | 368 | UIButton 369 | UIControl 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UIButton.h 373 | 374 | 375 | 376 | UIControl 377 | UIView 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIControl.h 381 | 382 | 383 | 384 | UIResponder 385 | NSObject 386 | 387 | 388 | 389 | UISearchBar 390 | UIView 391 | 392 | IBFrameworkSource 393 | UIKit.framework/Headers/UISearchBar.h 394 | 395 | 396 | 397 | UISearchDisplayController 398 | NSObject 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISearchDisplayController.h 402 | 403 | 404 | 405 | UIView 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UIPrintFormatter.h 409 | 410 | 411 | 412 | UIView 413 | 414 | IBFrameworkSource 415 | UIKit.framework/Headers/UITextField.h 416 | 417 | 418 | 419 | UIView 420 | UIResponder 421 | 422 | IBFrameworkSource 423 | UIKit.framework/Headers/UIView.h 424 | 425 | 426 | 427 | UIViewController 428 | 429 | IBFrameworkSource 430 | UIKit.framework/Headers/UINavigationController.h 431 | 432 | 433 | 434 | UIViewController 435 | 436 | IBFrameworkSource 437 | UIKit.framework/Headers/UIPopoverController.h 438 | 439 | 440 | 441 | UIViewController 442 | 443 | IBFrameworkSource 444 | UIKit.framework/Headers/UISplitViewController.h 445 | 446 | 447 | 448 | UIViewController 449 | 450 | IBFrameworkSource 451 | UIKit.framework/Headers/UITabBarController.h 452 | 453 | 454 | 455 | UIViewController 456 | UIResponder 457 | 458 | IBFrameworkSource 459 | UIKit.framework/Headers/UIViewController.h 460 | 461 | 462 | 463 | 464 | 0 465 | IBCocoaTouchFramework 466 | 467 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 468 | 469 | 470 | 471 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 472 | 473 | 474 | YES 475 | SVWeb.xcodeproj 476 | 3 477 | 141 478 | 479 | 480 | -------------------------------------------------------------------------------- /Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SVWebViewController 4 | // 5 | // Created by Sam Vermette on 21.02.11. 6 | // Copyright 2011 Sam Vermette. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | @autoreleasepool { 13 | int retVal = UIApplicationMain(argc, argv, nil, nil); 14 | return retVal; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Sam Vermette 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SVWebViewController 2 | 3 | SVWebViewController is a simple inline browser for your iOS 7 app. 4 | 5 | ![SVWebViewController](http://cl.ly/SQVO/download/GitHub.png) 6 | 7 | **SVWebViewController features:** 8 | 9 | * iPhone and iPad distinct UIs 10 | * full landscape orientation support 11 | * back, forward, stop/refresh and share buttons 12 | * Open in Safari and Chrome UIActivities 13 | * navbar title set to the currently visible web page 14 | * talks with `setNetworkActivityIndicatorVisible` 15 | 16 | ## Installation 17 | 18 | ### CocoaPods 19 | 20 | I'm not a big fan of CocoaPods, so tend to not keep it updated. If you really want to use SVWebViewController with CocoaPods, I suggest you use `pod 'SVWebViewController', :head` to pull from the `master` branch directly. I'm usually careful about what I push there and is the version I use myself in all my projects. 21 | 22 | ### Manually 23 | 24 | * Drag the `SVWebViewController/SVWebViewController` folder into your project. 25 | * `#import "SVWebViewController.h"` 26 | 27 | ## Usage 28 | 29 | (see sample Xcode project in `/Demo`) 30 | 31 | Just like any UIViewController, SVWebViewController can be pushed into a UINavigationController stack: 32 | 33 | ```objective-c 34 | SVWebViewController *webViewController = [[SVWebViewController alloc] initWithAddress:@"http://google.com"]; 35 | [self.navigationController pushViewController:webViewController animated:YES]; 36 | ``` 37 | 38 | It can also be presented modally using `SVModalWebViewController`: 39 | 40 | ```objective-c 41 | SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithAddress:@"http://google.com"]; 42 | [self presentViewController:webViewController animated:YES completion:NULL]; 43 | ``` 44 | 45 | ### SVWebViewControllerActivity 46 | 47 | Starting in iOS 6 Apple uses `UIActivity` to let you show additional sharing methods in share sheets. `SVWebViewController` comes with "Open in Safari" and "Open in Chrome" activities. You can easily add your own activity by subclassing `SVWebViewControllerActivity` which takes care of a few things automatically for you. Have a look at the Safari and Chrome activities for implementation examples. Feel free to send it as a pull request once you're done! 48 | 49 | 50 | ## Credits 51 | 52 | SVWebViewController is brought to you by [Sam Vermette](http://samvermette.com) and [contributors to the project](https://github.com/samvermette/SVWebViewController/contributors). If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by [creating new issues](https://github.com/samvermette/SVWebViewController/issues/new). If you're using SVWebViewController in your project, attribution is always appreciated. 53 | -------------------------------------------------------------------------------- /SVWebViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SVWebViewController' 3 | s.version = '1.0' 4 | s.summary = 'A simple inline browser for your iOS app.' 5 | s.homepage = 'http://samvermette.com/173' 6 | s.license = 'MIT' 7 | s.author = { 'Sam Vermette' => 'hello@samvermette.com' } 8 | s.source = { :git => 'https://github.com/samvermette/SVWebViewController.git', :tag => s.version.to_s } 9 | s.platform = :ios, '6.0' 10 | s.source_files = 'SVWebViewController/**/*.{h,m}' 11 | s.resources = 'SVWebViewController/**/*.{bundle,png,lproj}' 12 | s.requires_arc = true 13 | end 14 | -------------------------------------------------------------------------------- /SVWebViewController/SVModalWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVModalWebViewController.h 3 | // 4 | // Created by Oliver Letterer on 13.08.11. 5 | // Copyright 2011 Home. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import 10 | 11 | @class SVWebViewController; 12 | @class SVModalWebViewController; 13 | 14 | typedef NS_ENUM(NSUInteger, SVWebViewControllerDismissButtonStyle) { 15 | SVWebViewControllerDismissButtonStyleDone = 0, 16 | SVWebViewControllerDismissButtonStyleCancel 17 | }; 18 | 19 | @protocol SVModalWebViewControllerDelegate 20 | 21 | @optional 22 | - (void)controllerDidPressDoneButton:(SVModalWebViewController *)controller; 23 | 24 | @end 25 | 26 | @interface SVModalWebViewController : UINavigationController 27 | 28 | - (instancetype)initWithAddress:(NSString*)urlString; 29 | - (instancetype)initWithURL:(NSURL *)URL; 30 | - (instancetype)initWithURLRequest:(NSURLRequest *)request; 31 | 32 | @property (nonatomic, readonly) SVWebViewController *webViewController; 33 | 34 | @property (nonatomic, strong) UIColor *barsTintColor; 35 | @property (nonatomic, weak) id webViewDelegate; 36 | @property (nonatomic, assign) SVWebViewControllerDismissButtonStyle dismissButtonStyle; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /SVWebViewController/SVModalWebViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVModalWebViewController.m 3 | // 4 | // Created by Oliver Letterer on 13.08.11. 5 | // Copyright 2011 Home. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import "SVModalWebViewController.h" 10 | #import "SVWebViewController.h" 11 | 12 | @interface SVModalWebViewController () 13 | 14 | @property (nonatomic, strong) SVWebViewController *webViewController; 15 | @end 16 | 17 | @interface SVWebViewController (DoneButton) 18 | 19 | - (void)doneButtonTapped:(id)sender; 20 | 21 | @end 22 | 23 | 24 | @implementation SVModalWebViewController 25 | 26 | #pragma mark - Initialization 27 | 28 | 29 | - (instancetype)initWithAddress:(NSString*)urlString { 30 | return [self initWithURL:[NSURL URLWithString:urlString]]; 31 | } 32 | 33 | - (instancetype)initWithURL:(NSURL *)URL { 34 | return [self initWithURLRequest:[NSURLRequest requestWithURL:URL]]; 35 | } 36 | 37 | - (instancetype)initWithURLRequest:(NSURLRequest *)request { 38 | self.webViewController = [[SVWebViewController alloc] initWithURLRequest:request]; 39 | if (self = [super initWithRootViewController:self.webViewController]) { 40 | [self configureDoneButton]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)viewWillAppear:(BOOL)animated { 46 | [super viewWillAppear:NO]; 47 | 48 | self.webViewController.title = self.title; 49 | self.navigationBar.tintColor = self.barsTintColor; 50 | } 51 | 52 | - (void)configureDoneButton { 53 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || self.dismissButtonStyle == SVWebViewControllerDismissButtonStyleCancel) { 54 | self.webViewController.navigationItem.leftBarButtonItem = [self barButtonItemForDismissButtonStyle:self.dismissButtonStyle]; 55 | self.webViewController.navigationItem.rightBarButtonItem = nil; 56 | } 57 | else { 58 | self.webViewController.navigationItem.leftBarButtonItem = nil; 59 | self.webViewController.navigationItem.rightBarButtonItem = [self barButtonItemForDismissButtonStyle:self.dismissButtonStyle]; 60 | } 61 | } 62 | 63 | - (void)setDismissButtonStyle:(SVWebViewControllerDismissButtonStyle)dismissButtonStyle { 64 | if (_dismissButtonStyle != dismissButtonStyle) { 65 | _dismissButtonStyle = dismissButtonStyle; 66 | [self configureDoneButton]; 67 | } 68 | } 69 | 70 | - (UIBarButtonItem *)barButtonItemForDismissButtonStyle:(SVWebViewControllerDismissButtonStyle)dismissButtonStyle { 71 | switch (dismissButtonStyle) { 72 | case SVWebViewControllerDismissButtonStyleDone: 73 | return [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone 74 | target:self 75 | action:@selector(doneButtonTapped:)]; 76 | 77 | case SVWebViewControllerDismissButtonStyleCancel: 78 | return [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel 79 | target:self 80 | action:@selector(doneButtonTapped:)]; 81 | } 82 | } 83 | 84 | #pragma mark - Delegate 85 | 86 | - (void)setWebViewDelegate:(id)webViewDelegate { 87 | self.webViewController.delegate = webViewDelegate; 88 | } 89 | 90 | - (id)webViewDelegate { 91 | return self.webViewController.delegate; 92 | } 93 | 94 | - (void)doneButtonTapped:(id)sender { 95 | [self.webViewController doneButtonTapped:sender]; 96 | 97 | if ([self.webViewDelegate respondsToSelector:@selector(controllerDidPressDoneButton:)]) { 98 | [self.webViewDelegate controllerDidPressDoneButton:self]; 99 | } 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.bundle/SVWebViewControllerBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/SVWebViewController.bundle/SVWebViewControllerBack.png -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.bundle/SVWebViewControllerBack@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/SVWebViewController.bundle/SVWebViewControllerBack@2x.png -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.bundle/SVWebViewControllerNext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/SVWebViewController.bundle/SVWebViewControllerNext.png -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.bundle/SVWebViewControllerNext@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/SVWebViewController.bundle/SVWebViewControllerNext@2x.png -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewController.h 3 | // 4 | // Created by Sam Vermette on 08.11.10. 5 | // Copyright 2010 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | @interface SVWebViewController : UIViewController 10 | 11 | - (instancetype)initWithAddress:(NSString *)urlString; 12 | - (instancetype)initWithURL:(NSURL *)URL; 13 | - (instancetype)initWithURLRequest:(NSURLRequest *)request; 14 | 15 | @property (nonatomic, weak) id delegate; 16 | @property (nonatomic, readonly) UIWebView *webView; 17 | @property (nonatomic, strong) NSMutableArray *activities; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /SVWebViewController/SVWebViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewController.m 3 | // 4 | // Created by Sam Vermette on 08.11.10. 5 | // Copyright 2010 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import "SVWebViewControllerActivityChrome.h" 10 | #import "SVWebViewControllerActivitySafari.h" 11 | #import "SVWebViewController.h" 12 | 13 | @interface SVWebViewController () 14 | 15 | @property (nonatomic, strong) UIBarButtonItem *backBarButtonItem; 16 | @property (nonatomic, strong) UIBarButtonItem *forwardBarButtonItem; 17 | @property (nonatomic, strong) UIBarButtonItem *refreshBarButtonItem; 18 | @property (nonatomic, strong) UIBarButtonItem *stopBarButtonItem; 19 | @property (nonatomic, strong) UIBarButtonItem *actionBarButtonItem; 20 | 21 | @property (nonatomic, strong) UIWebView *webView; 22 | @property (nonatomic, strong) NSURLRequest *request; 23 | 24 | @end 25 | 26 | 27 | @implementation SVWebViewController 28 | 29 | #pragma mark - Initialization 30 | 31 | - (void)dealloc { 32 | [self.webView stopLoading]; 33 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 34 | self.webView.delegate = nil; 35 | self.delegate = nil; 36 | } 37 | 38 | - (instancetype)initWithAddress:(NSString *)urlString { 39 | return [self initWithURL:[NSURL URLWithString:urlString]]; 40 | } 41 | 42 | - (instancetype)initWithURL:(NSURL*)pageURL { 43 | return [self initWithURLRequest:[NSURLRequest requestWithURL:pageURL]]; 44 | } 45 | 46 | - (instancetype)initWithURLRequest:(NSURLRequest*)request { 47 | self = [super init]; 48 | if (self) { 49 | self.request = request; 50 | } 51 | return self; 52 | } 53 | 54 | - (void)loadRequest:(NSURLRequest*)request { 55 | [self.webView loadRequest:request]; 56 | } 57 | 58 | #pragma mark - View lifecycle 59 | 60 | - (void)loadView { 61 | self.view = self.webView; 62 | [self loadRequest:self.request]; 63 | } 64 | 65 | - (void)viewDidLoad { 66 | [super viewDidLoad]; 67 | [self updateToolbarItems]; 68 | } 69 | 70 | - (void)viewDidUnload { 71 | [super viewDidUnload]; 72 | self.webView = nil; 73 | _backBarButtonItem = nil; 74 | _forwardBarButtonItem = nil; 75 | _refreshBarButtonItem = nil; 76 | _stopBarButtonItem = nil; 77 | _actionBarButtonItem = nil; 78 | } 79 | 80 | - (void)viewWillAppear:(BOOL)animated { 81 | NSAssert(self.navigationController, @"SVWebViewController needs to be contained in a UINavigationController. If you are presenting SVWebViewController modally, use SVModalWebViewController instead."); 82 | 83 | [super viewWillAppear:animated]; 84 | 85 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 86 | [self.navigationController setToolbarHidden:NO animated:animated]; 87 | } 88 | else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 89 | [self.navigationController setToolbarHidden:YES animated:animated]; 90 | } 91 | } 92 | 93 | - (void)viewWillDisappear:(BOOL)animated { 94 | [super viewWillDisappear:animated]; 95 | 96 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { 97 | [self.navigationController setToolbarHidden:YES animated:animated]; 98 | } 99 | } 100 | 101 | - (void)viewDidDisappear:(BOOL)animated { 102 | [super viewDidDisappear:animated]; 103 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 104 | } 105 | 106 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 107 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 108 | return YES; 109 | 110 | return toInterfaceOrientation != UIInterfaceOrientationPortraitUpsideDown; 111 | } 112 | 113 | #pragma mark - Getters 114 | 115 | - (UIWebView*)webView { 116 | if(!_webView) { 117 | _webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; 118 | _webView.delegate = self; 119 | _webView.scalesPageToFit = YES; 120 | } 121 | return _webView; 122 | } 123 | 124 | - (UIBarButtonItem *)backBarButtonItem { 125 | if (!_backBarButtonItem) { 126 | _backBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"SVWebViewController.bundle/SVWebViewControllerBack"] 127 | style:UIBarButtonItemStylePlain 128 | target:self 129 | action:@selector(goBackTapped:)]; 130 | _backBarButtonItem.width = 18.0f; 131 | } 132 | return _backBarButtonItem; 133 | } 134 | 135 | - (UIBarButtonItem *)forwardBarButtonItem { 136 | if (!_forwardBarButtonItem) { 137 | _forwardBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"SVWebViewController.bundle/SVWebViewControllerNext"] 138 | style:UIBarButtonItemStylePlain 139 | target:self 140 | action:@selector(goForwardTapped:)]; 141 | _forwardBarButtonItem.width = 18.0f; 142 | } 143 | return _forwardBarButtonItem; 144 | } 145 | 146 | - (UIBarButtonItem *)refreshBarButtonItem { 147 | if (!_refreshBarButtonItem) { 148 | _refreshBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(reloadTapped:)]; 149 | } 150 | return _refreshBarButtonItem; 151 | } 152 | 153 | - (UIBarButtonItem *)stopBarButtonItem { 154 | if (!_stopBarButtonItem) { 155 | _stopBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(stopTapped:)]; 156 | } 157 | return _stopBarButtonItem; 158 | } 159 | 160 | - (UIBarButtonItem *)actionBarButtonItem { 161 | if (!_actionBarButtonItem) { 162 | _actionBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(actionButtonTapped:)]; 163 | } 164 | return _actionBarButtonItem; 165 | } 166 | 167 | #pragma mark - Toolbar 168 | 169 | - (void)updateToolbarItems { 170 | self.backBarButtonItem.enabled = self.self.webView.canGoBack; 171 | self.forwardBarButtonItem.enabled = self.self.webView.canGoForward; 172 | 173 | UIBarButtonItem *refreshStopBarButtonItem = self.self.webView.isLoading ? self.stopBarButtonItem : self.refreshBarButtonItem; 174 | 175 | UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 176 | UIBarButtonItem *flexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 177 | 178 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 179 | CGFloat toolbarWidth = 250.0f; 180 | fixedSpace.width = 35.0f; 181 | 182 | NSArray *items = [NSArray arrayWithObjects: 183 | fixedSpace, 184 | refreshStopBarButtonItem, 185 | fixedSpace, 186 | self.backBarButtonItem, 187 | fixedSpace, 188 | self.forwardBarButtonItem, 189 | fixedSpace, 190 | self.actionBarButtonItem, 191 | nil]; 192 | 193 | UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, toolbarWidth, 44.0f)]; 194 | toolbar.items = items; 195 | toolbar.barStyle = self.navigationController.navigationBar.barStyle; 196 | toolbar.tintColor = self.navigationController.navigationBar.tintColor; 197 | self.navigationItem.rightBarButtonItems = items.reverseObjectEnumerator.allObjects; 198 | } 199 | 200 | else { 201 | NSArray *items = [NSArray arrayWithObjects: 202 | fixedSpace, 203 | self.backBarButtonItem, 204 | flexibleSpace, 205 | self.forwardBarButtonItem, 206 | flexibleSpace, 207 | refreshStopBarButtonItem, 208 | flexibleSpace, 209 | self.actionBarButtonItem, 210 | fixedSpace, 211 | nil]; 212 | 213 | self.navigationController.toolbar.barStyle = self.navigationController.navigationBar.barStyle; 214 | self.navigationController.toolbar.tintColor = self.navigationController.navigationBar.tintColor; 215 | self.toolbarItems = items; 216 | } 217 | } 218 | 219 | #pragma mark - UIWebViewDelegate 220 | 221 | - (void)webViewDidStartLoad:(UIWebView *)webView { 222 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; 223 | [self updateToolbarItems]; 224 | 225 | if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { 226 | [self.delegate webViewDidStartLoad:webView]; 227 | } 228 | } 229 | 230 | 231 | - (void)webViewDidFinishLoad:(UIWebView *)webView { 232 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 233 | 234 | if (self.navigationItem.title == nil) { 235 | self.navigationItem.title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"]; 236 | } 237 | 238 | [self updateToolbarItems]; 239 | 240 | if ([self.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { 241 | [self.delegate webViewDidFinishLoad:webView]; 242 | } 243 | } 244 | 245 | - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { 246 | [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; 247 | [self updateToolbarItems]; 248 | 249 | if ([self.delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { 250 | [self.delegate webView:webView didFailLoadWithError:error]; 251 | } 252 | } 253 | 254 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { 255 | if ([self.delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { 256 | return [self.delegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; 257 | } 258 | 259 | return YES; 260 | } 261 | 262 | #pragma mark - Target actions 263 | 264 | - (void)goBackTapped:(UIBarButtonItem *)sender { 265 | [self.webView goBack]; 266 | } 267 | 268 | - (void)goForwardTapped:(UIBarButtonItem *)sender { 269 | [self.webView goForward]; 270 | } 271 | 272 | - (void)reloadTapped:(UIBarButtonItem *)sender { 273 | [self.webView reload]; 274 | } 275 | 276 | - (void)stopTapped:(UIBarButtonItem *)sender { 277 | [self.webView stopLoading]; 278 | [self updateToolbarItems]; 279 | } 280 | 281 | - (void)actionButtonTapped:(id)sender { 282 | NSURL *url = self.webView.request.URL ? self.webView.request.URL : self.request.URL; 283 | if (url != nil) { 284 | if ([[url absoluteString] hasPrefix:@"file:///"]) { 285 | UIDocumentInteractionController *dc = [UIDocumentInteractionController interactionControllerWithURL:url]; 286 | [dc presentOptionsMenuFromRect:self.view.bounds inView:self.view animated:YES]; 287 | } else { 288 | UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[url] applicationActivities:self.activities]; 289 | 290 | #ifdef __IPHONE_8_0 291 | if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1 && 292 | UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 293 | { 294 | UIPopoverPresentationController *ctrl = activityController.popoverPresentationController; 295 | ctrl.sourceView = self.view; 296 | ctrl.barButtonItem = sender; 297 | } 298 | #endif 299 | 300 | [self presentViewController:activityController animated:YES completion:nil]; 301 | } 302 | } 303 | } 304 | 305 | - (void)doneButtonTapped:(id)sender { 306 | [self dismissViewControllerAnimated:YES completion:NULL]; 307 | } 308 | 309 | - (NSMutableArray *)activities { 310 | if (!_activities) { 311 | _activities = [NSMutableArray arrayWithArray:SVWebViewController.defaultActivities]; 312 | } 313 | return _activities; 314 | } 315 | 316 | + (NSArray *)defaultActivities { 317 | return @[[SVWebViewControllerActivitySafari new], [SVWebViewControllerActivityChrome new]]; 318 | } 319 | 320 | @end 321 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome-iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome-iPad.png -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome-iPad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome-iPad@2x.png -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivityChrome.h 3 | // 4 | // Created by Sam Vermette on 11 Nov, 2013. 5 | // Copyright 2013 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import "SVWebViewControllerActivity.h" 10 | 11 | @interface SVWebViewControllerActivityChrome : SVWebViewControllerActivity 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivityChrome.h 3 | // 4 | // Created by Sam Vermette on 11 Nov, 2013. 5 | // Copyright 2013 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import "SVWebViewControllerActivityChrome.h" 10 | 11 | @implementation SVWebViewControllerActivityChrome 12 | 13 | - (NSString *)activityTitle { 14 | return NSLocalizedStringFromTable(@"Open in Chrome", @"SVWebViewController", nil); 15 | } 16 | 17 | - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { 18 | for (id activityItem in activityItems) { 19 | if ([activityItem isKindOfClass:[NSURL class]] && [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"googlechrome://"]]) { 20 | return YES; 21 | } 22 | } 23 | return NO; 24 | } 25 | 26 | - (void)performActivity { 27 | NSURL *inputURL = self.URLToOpen; 28 | NSString *scheme = inputURL.scheme; 29 | 30 | // Replace the URL Scheme with the Chrome equivalent. 31 | NSString *chromeScheme = nil; 32 | if ([scheme isEqualToString:@"http"]) { 33 | chromeScheme = @"googlechrome"; 34 | } else if ([scheme isEqualToString:@"https"]) { 35 | chromeScheme = @"googlechromes"; 36 | } 37 | 38 | // Proceed only if a valid Google Chrome URI Scheme is available. 39 | if (chromeScheme) { 40 | NSString *absoluteString = [inputURL absoluteString]; 41 | NSRange rangeForScheme = [absoluteString rangeOfString:@":"]; 42 | NSString *urlNoScheme = 43 | [absoluteString substringFromIndex:rangeForScheme.location]; 44 | NSString *chromeURLString = 45 | [chromeScheme stringByAppendingString:urlNoScheme]; 46 | NSURL *chromeURL = [NSURL URLWithString:chromeURLString]; 47 | 48 | // Open the URL with Chrome. 49 | [[UIApplication sharedApplication] openURL:chromeURL]; 50 | } 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Chrome/SVWebViewControllerActivityChrome@2x.png -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/SVWebViewControllerActivity.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivity.h 3 | // SVWeb 4 | // 5 | // Created by Sam Vermette on 11/11/2013. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface SVWebViewControllerActivity : UIActivity 12 | 13 | @property (nonatomic, strong) NSURL *URLToOpen; 14 | @property (nonatomic, strong) NSString *schemePrefix; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/SVWebViewControllerActivity.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivity.m 3 | // SVWeb 4 | // 5 | // Created by Sam Vermette on 11/11/2013. 6 | // 7 | // 8 | 9 | #import "SVWebViewControllerActivity.h" 10 | 11 | @implementation SVWebViewControllerActivity 12 | 13 | - (NSString *)activityType { 14 | return NSStringFromClass([self class]); 15 | } 16 | 17 | - (UIImage *)activityImage { 18 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 19 | return [UIImage imageNamed:[self.activityType stringByAppendingString:@"-iPad"]]; 20 | else 21 | return [UIImage imageNamed:self.activityType]; 22 | } 23 | 24 | - (void)prepareWithActivityItems:(NSArray *)activityItems { 25 | for (id activityItem in activityItems) { 26 | if ([activityItem isKindOfClass:[NSURL class]]) { 27 | self.URLToOpen = activityItem; 28 | } 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari-iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari-iPad.png -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari-iPad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari-iPad@2x.png -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari.h: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivitySafari.h 3 | // 4 | // Created by Sam Vermette on 11 Nov, 2013. 5 | // Copyright 2013 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | #import "SVWebViewControllerActivity.h" 10 | 11 | @interface SVWebViewControllerActivitySafari : SVWebViewControllerActivity 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari.m: -------------------------------------------------------------------------------- 1 | // 2 | // SVWebViewControllerActivitySafari.m 3 | // 4 | // Created by Sam Vermette on 11 Nov, 2013. 5 | // Copyright 2013 Sam Vermette. All rights reserved. 6 | // 7 | // https://github.com/samvermette/SVWebViewController 8 | 9 | 10 | #import "SVWebViewControllerActivitySafari.h" 11 | 12 | @implementation SVWebViewControllerActivitySafari 13 | 14 | - (NSString *)activityTitle { 15 | return NSLocalizedStringFromTable(@"Open in Safari", @"SVWebViewController", nil); 16 | } 17 | 18 | - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { 19 | for (id activityItem in activityItems) { 20 | if ([activityItem isKindOfClass:[NSURL class]] && [[UIApplication sharedApplication] canOpenURL:activityItem]) { 21 | return YES; 22 | } 23 | } 24 | return NO; 25 | } 26 | 27 | - (void)performActivity { 28 | BOOL completed = [[UIApplication sharedApplication] openURL:self.URLToOpen]; 29 | [self activityDidFinish:completed]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransitApp/SVWebViewController/fe4ddeca1a8c7e5cc5ea716667426463f31b28f3/SVWebViewController/UIActivities/Safari/SVWebViewControllerActivitySafari@2x.png -------------------------------------------------------------------------------- /SVWebViewController/da.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Anders Fogh Eriksen 2 | "Open in Safari" = "Åbn i Safari"; 3 | "Open in Chrome" = "Åbn i Chrome"; 4 | "Copy Link" = "Kopier Link"; 5 | "Mail Link to this Page" = "Mail Link til denne side"; -------------------------------------------------------------------------------- /SVWebViewController/de.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | "Open in Safari" = "In Safari öffnen"; 2 | "Open in Chrome" = "In Chrome öffnen"; -------------------------------------------------------------------------------- /SVWebViewController/en.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Alex Ruperez 2 | "Open in Safari" = "Open in Safari"; 3 | "Open in Chrome" = "Open in Chrome"; -------------------------------------------------------------------------------- /SVWebViewController/es-ES.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Alex Ruperez 2 | "Open in Safari" = "Abrir en Safari"; 3 | "Open in Chrome" = "Abrir en Chrome"; -------------------------------------------------------------------------------- /SVWebViewController/es.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Alex Ruperez 2 | "Open in Safari" = "Abrir en Safari"; 3 | "Open in Chrome" = "Abrir en Chrome"; -------------------------------------------------------------------------------- /SVWebViewController/fr.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Benjamin Michotte 2 | "Open in Safari" = "Ouvrir dans Safari"; 3 | "Open in Chrome" = "Ouvrir dans Chrome"; -------------------------------------------------------------------------------- /SVWebViewController/ja.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | "Open in Safari" = "Safariで開く"; 2 | "Open in Chrome" = "Chromeで開く"; 3 | -------------------------------------------------------------------------------- /SVWebViewController/pt.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | "Open in Safari" = "Abrir no Safari"; 2 | "Open in Chrome" = "Abrir no Chrome"; -------------------------------------------------------------------------------- /SVWebViewController/zh-Hans.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 James Stout 2 | "Open in Safari" = "在Safari中打开"; 3 | "Open in Chrome" = "在Chrome中打开"; 4 | "Copy Link" = "复制网页链接"; 5 | "Mail Link to this Page" = "以电邮传送此页链接"; 6 | "Cancel"="取消"; 7 | -------------------------------------------------------------------------------- /SVWebViewController/zh-Hant.lproj/SVWebViewController.strings: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 James Stout 2 | "Open in Safari" = "打開Safari"; 3 | "Open in Chrome" = "打開Chrome"; --------------------------------------------------------------------------------