Skip to content

Commit

Permalink
pleaseeeeeeeeeeeee
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowCat98 committed May 12, 2024
1 parent 6d113ca commit 9e2b8df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/iGeodeLib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#pragma once
#include <functional>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

void showAlert(const char *title, const char *message, const char *Btn);
NSString* iOSVersion();
Expand Down
12 changes: 10 additions & 2 deletions src/iGeodeLib.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
#include <functional>
#include "iGeodeLib.hpp"

/*
very simple. converts NSString to std::string, although most functions here convert to char or std::string, this would probably come in handy in some situations.
usage:
auto str
std::string NS2S(NSString *str) {
return nsString ? [nsString UTF8String] : "";
}
*/
/*
shows a system level alert.
usage:
Expand Down Expand Up @@ -76,7 +84,7 @@ void CShowAlert(const char *title, const char *message, const char *Btn, std::fu

UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController];

[rootViewController presentViewController:alertController animated:YES completion:nil];
[rootViewController presentViewController:alertController animated:YES completion:nil];
}

/* self explanatory, get the ios version.
Expand All @@ -88,7 +96,7 @@ void CShowAlert(const char *title, const char *message, const char *Btn, std::fu
showAlert("Update Required", "Update to iOS 17.4", "shut up");
}
you might need to use the to_nsstring on this to convert it to a std::string
you might need to use the NS2S function on this to convert it to a std::string
*/
NSString* iOSVersion() {
Expand Down

0 comments on commit 9e2b8df

Please sign in to comment.