| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package objc |
| 6 |
|
| 7 |
import ( |
| 8 |
"ObjC/Foundation" |
| 9 |
"ObjC/Foundation/NSMutableString" |
| 10 |
"ObjC/NetworkExtension/NEPacket" |
| 11 |
"ObjC/UIKit" |
| 12 |
) |
| 13 |
|
| 14 |
type GoNSDate struct { |
| 15 |
Foundation.NSDate |
| 16 |
this Foundation.NSDate |
| 17 |
} |
| 18 |
|
| 19 |
func (d *GoNSDate) Hash(this Foundation.NSDate) int { |
| 20 |
return 0 |
| 21 |
} |
| 22 |
|
| 23 |
type GoNSObject struct { |
| 24 |
C Foundation.NSObjectC |
| 25 |
P Foundation.NSObjectP |
| 26 |
} |
| 27 |
|
| 28 |
func (o *GoNSObject) Description(this Foundation.NSObjectC) string { |
| 29 |
return "" |
| 30 |
} |
| 31 |
|
| 32 |
func DupNSDate(date Foundation.NSDate) Foundation.NSDate { |
| 33 |
return date |
| 34 |
} |
| 35 |
|
| 36 |
type GoUIResponder struct { |
| 37 |
UIKit.UIResponder |
| 38 |
} |
| 39 |
|
| 40 |
func (r *GoUIResponder) PressesBegan(_ Foundation.NSSet, _ UIKit.UIPressesEvent) { |
| 41 |
} |
| 42 |
|
| 43 |
const NSUTF8StringEncoding = 8 |
| 44 |
|
| 45 |
func CreateReadNSMutableString() { |
| 46 |
myData := []byte{'A', 'B'} |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
mString := NSMutableString.NewWithData(myData, uint(NSUTF8StringEncoding)) |
| 51 |
|
| 52 |
_ = mString.DataUsingEncoding(uint(NSUTF8StringEncoding)) |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
const PF_INET = 2 |
| 57 |
|
| 58 |
func CallUcharFunction() { |
| 59 |
_ = NEPacket.NewWithData(nil, uint8(PF_INET)) |
| 60 |
} |