update README for new API
This commit is contained in:
parent
4b54a6fad5
commit
98597c6903
1 changed files with 3 additions and 3 deletions
|
@ -51,14 +51,14 @@ const objc = @import("objc");
|
||||||
|
|
||||||
pub fn macosVersionAtLeast(major: i64, minor: i64, patch: i64) bool {
|
pub fn macosVersionAtLeast(major: i64, minor: i64, patch: i64) bool {
|
||||||
/// Get the objc class from the runtime
|
/// Get the objc class from the runtime
|
||||||
const NSProcessInfo = objc.Class.getClass("NSProcessInfo").?;
|
const NSProcessInfo = objc.getClass("NSProcessInfo").?;
|
||||||
|
|
||||||
/// Call a class method with no arguments that returns another objc object.
|
/// Call a class method with no arguments that returns another objc object.
|
||||||
const info = NSProcessInfo.msgSend(objc.Object, objc.sel("processInfo"), .{});
|
const info = NSProcessInfo.msgSend(objc.Object, "processInfo", .{});
|
||||||
|
|
||||||
/// Call an instance method that returns a boolean and takes a single
|
/// Call an instance method that returns a boolean and takes a single
|
||||||
/// argument.
|
/// argument.
|
||||||
return info.msgSend(bool, objc.sel("isOperatingSystemAtLeastVersion:"), .{
|
return info.msgSend(bool, "isOperatingSystemAtLeastVersion:", .{
|
||||||
NSOperatingSystemVersion{ .major = major, .minor = minor, .patch = patch },
|
NSOperatingSystemVersion{ .major = major, .minor = minor, .patch = patch },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue