Skip to content

Commit dd255ca

Browse files
author
yanqizhou
committed
Merge branch 'master' of https://github.com/y500/YYDebugDatabase
2 parents 34b9db0 + abe7c05 commit dd255ca

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ To integrate YYDebugDatabase into your Xcode project using CocoaPods, specify it
2424
```ruby
2525
pod 'YYDebugDatabase'
2626
```
27+
28+
If use Swift, remember to add `use_frameworks!`
29+
30+
```ruby
31+
use_frameworks!
32+
pod 'YYDebugDatabase'
33+
```
34+
2735
#### Not build in Release
2836

2937
First, add configurations in Podfile.
@@ -59,6 +67,20 @@ making one line code at `application:didFinishLaunchingWithOptions`:
5967
[[DebugDatabaseManager shared] startServerOnPort:9002];
6068
#end
6169
```
70+
71+
If use Swift:
72+
73+
import at Appdelegate.swift:
74+
75+
```swift
76+
import YYDebugDatabase
77+
```
78+
making one line code at `application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)`:
79+
80+
```Swift:
81+
DebugDatabaseManager.shared().startServer(onPort: 9002);
82+
```
83+
6284
# Advanced
6385

6486
It only shows the databasesin in Documents directory and Library/Cache directory by default, if you want show databases in other directories, you can use:
@@ -75,8 +97,16 @@ for example:
7597
NSString *cacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Cache"];
7698
[[DebugDatabaseManager shared] startServerOnPort:9002 directories:@[resourceDirectory, databaseDirectory, documentDirectory, cacheDirectory]];
7799
```
100+
If use Swift:
101+
102+
```swift
103+
let directory:String = (Bundle.main.resourcePath)!;
104+
let documentsPath:String = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
105+
let cachePath:String = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
106+
DebugDatabaseManager.shared().startServer(onPort: 9002, directories: [directory, documentsPath, cachePath]);
107+
```
78108

79-
That’s all, just start the application :
109+
That’s all(you can look at the Demo for details), just start the application :
80110

81111
Now open the provided link in your browser, and you will see like this:
82112

0 commit comments

Comments
 (0)