If you open the Font Book app on your Mac and choose the font you want to use, you can see the license terms of the font:
As far as I read the license of SF Pro Rounded, I could not find any statements you could use it in your company's logo.
Instead, I could find this:
You agree that you shall not use or incorporate the Symbols or any substantially or confusingly similar images into app icons, logos or make any other trademark use of the Symbols.
I'm not a legal expert, so you may contact to some legal or licensing expert and show all the terms in the license. But generally, you cannot use Apple's fonts other than using it in your apps.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is this normal behavior?
The ContentView body makes sense to change, but is the sheet's body also supposed to be redrawn when the sheet is not presenting anymore after dismiss?
I do not understand what your term redraw means, but if it means body being evaluated, the answer would be:
You should not care about that.
The property body would be called at any time when the runtime of SwiftUI thinks it is needed, your code should not depend on when or how may times it may be called.
It is sort of implementation details of SwiftUI, and may be changed at any time in the future.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can you show a complete code? (It can be simplified, but ready to run.)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
What am I doing wrong?
When you want to return a value from a closure, the closure must be declared as to return a value.
But, the closure type in observeSingleEvent(of:with:) is not declared to return a value.
When you want to pass something after some asynchronous operation is finished, one traditional way is using the completion handler pattern.
In your case, something like this:
func returnusername(completion: @escaping (String?)->Void) {
guard let uid = Auth.auth().currentUser?.uid else {
completion(nil)
return
}
//guard (Auth.auth().currentUser?.uid) != nil else {return} //<- Duplicate check, is not needed
Database.database().reference().child(uid).child("users").child("username").observeSingleEvent(of: .value){ (snapshot) in
guard let username = snapshot.value as? String else {
completion(nil)
return
}
completion(username)
}
}
You can use it as follows:
func someMethod() {
returnusername { username in
guard let username = username else {
return
}
//Use `username` here...
//...
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can you show a complete code to reproduce the issue?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
Can you provide a completion code to reproduce the issue, in addition to some sample images?
Topic:
Machine Learning & AI
SubTopic:
General
Tags:
ReactNative is not a framework of Apple's. You should better visit the supporting site or a community site of it to get better responses sooner.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
How do your show such characters in the section headers? Can you show a complete code to reproduce the issue?
Topic:
UI Frameworks
SubTopic:
UIKit
Tags:
Are you using NSKeyedUnarchiver explicitly somewhere in your code? If so, you should better update your code to prepare This will be disallowed in the future. It may be used somewhere in the runtime of iOS, in such cases, you may need to ignore the warning.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Thanks to Claude31, I could have explored a little more. Instead of import UIKit, import _Concurrency (in addition to import Foundation) will make it. What is odd is we do not need import _Concurrency in app projects. (You should not use import _Concurrency in actual projects, it may be treated as using a private framework.) And one more odd thing is import _Concurrency can be found when I see the generated header for Foundation by Cmd-clicking the line import Foundation.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Thanks for sharing your experience. I could have reproduced the issue on Big Sur 11.6 (iOS Blank playground). (With additional error: cannot find 'withUnsafeContinuation' in scope.) I do not think this is normal and you should better send a bug report to Apple.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Duplicate post is considered to be a bad manner, you should better care about it. And your question has nothing to do with the WWDC21 session wwdc21-10002, you should use the right tag. And the problem you have experienced, happens because C-double is a binary floating point number type and which cannot represent the value 0.1 precisely. It is the common behavior on all platforms which uses binary floating point, not only on Apple's platform. So, asking it in the Apple's dev forums is not appropriate. You should better find a good site to learn numeric processing.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
When you get a runtime exception with this message,
"[<Calculus_area_and_perimeter.ViewController 0x14c506020> setValue: forUndefinedKey:]: this class is not key value coding-compliant for the key calcArea."
iOS runtime is trying to connect an instance declared on storyboard/xib into the @IBOutlet of ViewController named calcArea.
Don't you remember you once connected something to an @IBOutlet and name it calcArea, and then renamed it to something else?
Anyway, you may need to remove the wrong connection pointing calcArea, and re-connect it to the right @IBOutlet.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
One possible reason is that you are enabling Code Review:
Please check if it really is enabled and try disabling it.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
You should better include the code as text, which helps involving more readers.
In your code, scene is a computed property, so it is evaluated at each time body is evaluated.
Generally, you should better avoid creating a computed property which creates a new instance, especially when the identity is important.
Please try something like this:
class GameScene: SKScene, ObservableObject { //<-
private let label = SKLabelNode(text: "Time Elapsed:\n0")
private var lastUpdateTime : TimeInterval = 0
override func didMove(to view: SKView) {
addChild(label)
}
override func update(_ currentTime: TimeInterval) {
if (self.lastUpdateTime == 0) {
self.lastUpdateTime = currentTime
}
let seconds = Int(currentTime - lastUpdateTime)
label.text = "Time Elapsed:\n\(seconds)"
label.numberOfLines = 2
}
}
struct ContentView: View {
@State private var showingLevelChooser = false
//↓
@StateObject var scene: GameScene = {
let scene = GameScene()
scene.size = CGSize(width: 300, height: 400)
scene.anchorPoint = CGPoint(x: 0.5, y: 0.5)
scene.scaleMode = .fill
return scene
}()
var body: some View {
ZStack {
SpriteView(scene: scene, isPaused: showingLevelChooser)
.ignoresSafeArea()
VStack {
Button("Level Chooser") {
showingLevelChooser.toggle()
}
Spacer()
}
}
.sheet(isPresented: $showingLevelChooser) {
VStack {
Button("Cancel") {
showingLevelChooser.toggle()
}
Text("Level Chooser")
}
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: