Post

Replies

Boosts

Views

Created

I wonder why operator overriding is like this.
I wonder how the + function is used directly. extension CGPoint {     static func add(lhs: Self, rhs: Self) -> CGPoint {         CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y)     }     static func +(lhs: Self, rhs: Self) -> CGPoint {         CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y)     } } private func testCGPoint() {     let dummy1 = CGPoint(x: 2, y: 3)     let dummy2 = CGPoint(x: 4, y: 5)     let dummy3: CGPoint = .add(lhs: dummy1, rhs: dummy2)     let dummy4: CGPoint = dummy1 + dummy2 } in my expectation, I thought that the + function would be used like the add function. i thought this form. CGPoint.+(lhs: dummy1, rhs: dummy2) But the + function did not. How are you doing this?
1
0
1k
Jul ’22
Can i participate in swift student challenge as a soldier?
I'm sorry I don't speak English well, so I use a translator so sentences may be awkward. I am a Korean college student who likes swift. Most Korean men go to the military. So next year I will take a leave of absence from university and I will be one of them. But, I would like to participate in the annual WWDC swift student challenge. Is it possible for me to participate and win? If I take a leave of absence and participate as a soldier, is it impossible to receive the award?
1
0
1.2k
Jun ’22
Can I participate in swift student challenge as a soldier?
I'm sorry I don't speak English well, so I use a translator so sentences may be awkward. I am a Korean college student who likes swift. Most Korean men go to the military. So next year I will take a leave of absence from university and I will be one of them. But, I would like to participate in the annual WWDC swift student challenge. Is it possible for me to participate and win? If I take a leave of absence and participate as a soldier, is it impossible to receive the award?
0
0
1k
Jun ’22
how to get real time camera frame in swiftui
I want to get real time camera frames to apply machine learning in swiftui. i made camera app with swiftui like this. but, i don't know how to get camera frame and how to apply machine learning techniques to camera frames struct ImagePicker: UIViewControllerRepresentable {       var sourceType: UIImagePickerController.SourceType = .camera       func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController {           let imagePicker = UIImagePickerController()         imagePicker.allowsEditing = false         imagePicker.sourceType = sourceType           return imagePicker     }       func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) {       } }
0
0
959
Jun ’22
I wonder if-let memory allocation.
var name: String? = "name" if let copyname = name { print(copyname) } In this code, are name and copyname allocated in two different memory?
Replies
2
Boosts
0
Views
1.1k
Activity
Aug ’22
I wonder why operator overriding is like this.
I wonder how the + function is used directly. extension CGPoint {     static func add(lhs: Self, rhs: Self) -> CGPoint {         CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y)     }     static func +(lhs: Self, rhs: Self) -> CGPoint {         CGPoint(x: lhs.x + rhs.x, y: lhs.y + rhs.y)     } } private func testCGPoint() {     let dummy1 = CGPoint(x: 2, y: 3)     let dummy2 = CGPoint(x: 4, y: 5)     let dummy3: CGPoint = .add(lhs: dummy1, rhs: dummy2)     let dummy4: CGPoint = dummy1 + dummy2 } in my expectation, I thought that the + function would be used like the add function. i thought this form. CGPoint.+(lhs: dummy1, rhs: dummy2) But the + function did not. How are you doing this?
Replies
1
Boosts
0
Views
1k
Activity
Jul ’22
what's different?
The professor codes like this in the lecture var number: Int { return 3 } what's different about this? var number: Int = 3
Replies
3
Boosts
0
Views
763
Activity
Jul ’22
Can i participate in swift student challenge as a soldier?
I'm sorry I don't speak English well, so I use a translator so sentences may be awkward. I am a Korean college student who likes swift. Most Korean men go to the military. So next year I will take a leave of absence from university and I will be one of them. But, I would like to participate in the annual WWDC swift student challenge. Is it possible for me to participate and win? If I take a leave of absence and participate as a soldier, is it impossible to receive the award?
Replies
1
Boosts
0
Views
1.2k
Activity
Jun ’22
Can I participate in swift student challenge as a soldier?
I'm sorry I don't speak English well, so I use a translator so sentences may be awkward. I am a Korean college student who likes swift. Most Korean men go to the military. So next year I will take a leave of absence from university and I will be one of them. But, I would like to participate in the annual WWDC swift student challenge. Is it possible for me to participate and win? If I take a leave of absence and participate as a soldier, is it impossible to receive the award?
Replies
0
Boosts
0
Views
1k
Activity
Jun ’22
how to get real time camera frame in swiftui
I want to get real time camera frames to apply machine learning in swiftui. i made camera app with swiftui like this. but, i don't know how to get camera frame and how to apply machine learning techniques to camera frames struct ImagePicker: UIViewControllerRepresentable {       var sourceType: UIImagePickerController.SourceType = .camera       func makeUIViewController(context: UIViewControllerRepresentableContext) -> UIImagePickerController {           let imagePicker = UIImagePickerController()         imagePicker.allowsEditing = false         imagePicker.sourceType = sourceType           return imagePicker     }       func updateUIViewController(_ uiViewController: UIImagePickerController, context: UIViewControllerRepresentableContext) {       } }
Replies
0
Boosts
0
Views
959
Activity
Jun ’22
Any references to machine learning with swiftui?
i'm learning about swiftui and machine learning(by python pytorch). I want to use machine learning in swiftui like coreml or vision. but, almost reference of coreml or vision are written in uikit. so, any references(book or lecture or document, yotube) to machine learning with swiftui?
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’22
can i use sfsymbols in my app?
i will make and release my app in appstore. in this process, i use sfsymbols icons in my app. Is this legally okay? like copyright
Replies
3
Boosts
0
Views
2.9k
Activity
May ’22
can i use apple logo on my playgrounds app?
can i use sf symbols applelogo(Image(systemname:"applelogo") on my swift playgrounds app?
Replies
2
Boosts
0
Views
1.1k
Activity
Apr ’22
Can I use the sf symbols icons commercially?
Any problem?
Topic: Design SubTopic: General Tags:
Replies
3
Boosts
0
Views
2.4k
Activity
Apr ’22
where is submit button?
I finished my playground app, and I filled out my information on the submission page. Can't find submit button
Replies
0
Boosts
0
Views
602
Activity
Apr ’22
Can I write department office information in the supervisor's information when applying?
I am leave of absence. i don't know my dean, principal, superintendent information. so, can i write my department office information in supervisor's information when applying?
Replies
0
Boosts
0
Views
729
Activity
Apr ’22