Skip to content

Commit 3e37769

Browse files
committed
First version
1 parent eee62c6 commit 3e37769

102 files changed

Lines changed: 6454 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FaceAttribute-Bridging-Header.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
#import "facesdk/facesdk.h"

FaceAttribute.xcodeproj/project.pbxproj

Lines changed: 728 additions & 0 deletions
Large diffs are not rendered by default.

FaceAttribute.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
uuid = "23EBFE48-9497-4887-8514-81BE1C1158C0"
4+
type = "1"
5+
version = "2.0">
6+
</Bucket>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>FaceAttribute.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
<key>FaceRecognition.xcscheme_^#shared#^_</key>
13+
<dict>
14+
<key>orderHint</key>
15+
<integer>0</integer>
16+
</dict>
17+
</dict>
18+
</dict>
19+
</plist>

FaceAttribute/.DS_Store

6 KB
Binary file not shown.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import UIKit
2+
import AVFoundation
3+
4+
class AboutViewController: UIViewController{
5+
6+
override func viewDidLoad() {
7+
super.viewDidLoad()
8+
}
9+
10+
@IBAction func done_clicked(_ sender: Any) {
11+
if let vc = self.presentingViewController as? ViewController {
12+
self.dismiss(animated: true, completion: nil)
13+
}
14+
}
15+
16+
17+
@IBAction func mail_clicked(_ sender: Any) {
18+
let appURL = URL(string: "mailto:contact@kby-ai.com") // URL scheme for Mail app
19+
20+
if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) {
21+
// If Mail app is installed, open it with a pre-filled email
22+
UIApplication.shared.open(appURL, options: [:], completionHandler: nil)
23+
} else {
24+
// If Mail app is not installed, show an alert indicating that Mail app is not available
25+
let alert = UIAlertController(title: "Mail App Not Available", message: "The Mail app is not installed on this device.", preferredStyle: .alert)
26+
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
27+
alert.addAction(okAction)
28+
UIApplication.shared.keyWindow?.rootViewController?.present(alert, animated: true, completion: nil)
29+
}
30+
}
31+
32+
33+
@IBAction func skype_clicked(_ sender: Any) {
34+
35+
}
36+
37+
@IBAction func telegram_clicked(_ sender: Any) {
38+
let appURL = URL(string: "tg://resolve?domain=kbyai") // URL scheme for Telegram app
39+
40+
if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) {
41+
// If Telegram app is installed, open it to the "Add Contact" screen
42+
UIApplication.shared.open(appURL, options: [:], completionHandler: nil)
43+
} else {
44+
let username = "kbyai"
45+
let telegramURL = URL(string: "https://t.me/\(username)")!
46+
UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil)
47+
}
48+
}
49+
50+
@IBAction func whatsapp_clicked(_ sender: Any) {
51+
let appURL = URL(string: "whatsapp://send?phone=+19092802609") // URL scheme for Telegram app
52+
53+
if let appURL = appURL, UIApplication.shared.canOpenURL(appURL) {
54+
// If Telegram app is installed, open it to the "Add Contact" screen
55+
UIApplication.shared.open(appURL, options: [:], completionHandler: nil)
56+
} else {
57+
let username = "+19092802609"
58+
let telegramURL = URL(string: "https://wa.me/\(username)")!
59+
UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil)
60+
}
61+
}
62+
63+
@IBAction func github_clicked(_ sender: Any) {
64+
let telegramURL = URL(string: "https://github.com/kby-ai")!
65+
UIApplication.shared.open(telegramURL, options: [:], completionHandler: nil)
66+
}
67+
}
68+

FaceAttribute/AppDelegate.swift

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
import UIKit
3+
import CoreData
4+
5+
@main
6+
class AppDelegate: UIResponder, UIApplicationDelegate {
7+
8+
9+
10+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
11+
// Override point for customization after application launch.
12+
return true
13+
}
14+
15+
// MARK: UISceneSession Lifecycle
16+
17+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
18+
// Called when a new scene session is being created.
19+
// Use this method to select a configuration to create the new scene with.
20+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
21+
}
22+
23+
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
24+
// Called when the user discards a scene session.
25+
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
26+
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
27+
}
28+
29+
// MARK: - Core Data stack
30+
31+
lazy var persistentContainer: NSPersistentContainer = {
32+
/*
33+
The persistent container for the application. This implementation
34+
creates and returns a container, having loaded the store for the
35+
application to it. This property is optional since there are legitimate
36+
error conditions that could cause the creation of the store to fail.
37+
*/
38+
let container = NSPersistentContainer(name: "FaceAttribute")
39+
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
40+
if let error = error as NSError? {
41+
// Replace this implementation with code to handle the error appropriately.
42+
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
43+
44+
/*
45+
Typical reasons for an error here include:
46+
* The parent directory does not exist, cannot be created, or disallows writing.
47+
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
48+
* The device is out of space.
49+
* The store could not be migrated to the current model version.
50+
Check the error message to determine what the actual problem was.
51+
*/
52+
fatalError("Unresolved error \(error), \(error.userInfo)")
53+
}
54+
})
55+
return container
56+
}()
57+
58+
// MARK: - Core Data Saving support
59+
60+
func saveContext () {
61+
let context = persistentContainer.viewContext
62+
if context.hasChanges {
63+
do {
64+
try context.save()
65+
} catch {
66+
// Replace this implementation with code to handle the error appropriately.
67+
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
68+
let nserror = error as NSError
69+
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
70+
}
71+
}
72+
}
73+
74+
}
75+

0 commit comments

Comments
 (0)