Post

Replies

Boosts

Views

Activity

Reply to NEFilterDataProvider method handleInboundData parameter readBytes, is this data encrypted?
readBytes is just Data, so you need to decode the Data into whatever you are expecting it to be. e.g. if you are expecting a string, try something like: /// I don't have your readBytes, so I'll make a dummy one... let readBytes = Data() /// Convert to the target class you are expecting (e.g. String) guard let string = String(data: readBytes, encoding: .utf8) else { print("Error: couldn't get String from readBytes") return } /// Success... print("string: \(string)") Does that answer your question?
Jan ’22
Reply to convert base64 string to image on SwiftUI
If I understand you correctly, you want to convert a base64 String to a SwiftUI Image. /// I don't have your base64-encoded String, so I'll make a dummy one... let sourceData = Data() let base64String = sourceData.base64EncodedString() /// Convert base64-encoded String to UIImage guard let stringData = Data(base64Encoded: base64String), let uiImage = UIImage(data: stringData) else { print("Error: couldn't create UIImage") return } /// Convert UIImage to SwiftUI Image let swiftUIImage = Image(uiImage: uiImage) Is that what you wanted to know?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to How to draw a line of shapes in swift
In SwiftUI... You can draw in a View, using a Path Path has methods (that you should find familiar) like: move(to:) addLine(to:) addCurve(to:control1:control2:) To get the rotation, you could then use the View modifier: rotationEffect(_:anchor:) You could draw this over another view using a ZStack, or by using the "overlay" View modifier
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
Reply to Issues building HikeView.swift (from SwiftUI Tutorial)
Perhaps there is a problem with your Hike.swift? Could you share the code for that? Or maybe... When you were adding the files to your project, did you check: Copy items if needed Add to targets {Landmarks} Test: Select the file "HikeView.swift" In the file Inspector... ...make sure "Target Membership" shows a tick by "Landmarks"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Error -> init(coder:) has not been implemented
How are you initializing the CVC?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to NEFilterDataProvider method handleInboundData parameter readBytes, is this data encrypted?
readBytes is just Data, so you need to decode the Data into whatever you are expecting it to be. e.g. if you are expecting a string, try something like: /// I don't have your readBytes, so I'll make a dummy one... let readBytes = Data() /// Convert to the target class you are expecting (e.g. String) guard let string = String(data: readBytes, encoding: .utf8) else { print("Error: couldn't get String from readBytes") return } /// Success... print("string: \(string)") Does that answer your question?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Error -> init(coder:) has not been implemented
Where is the error... which class, which line?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to convert base64 string to image on SwiftUI
If I understand you correctly, you want to convert a base64 String to a SwiftUI Image. /// I don't have your base64-encoded String, so I'll make a dummy one... let sourceData = Data() let base64String = sourceData.base64EncodedString() /// Convert base64-encoded String to UIImage guard let stringData = Data(base64Encoded: base64String), let uiImage = UIImage(data: stringData) else { print("Error: couldn't create UIImage") return } /// Convert UIImage to SwiftUI Image let swiftUIImage = Image(uiImage: uiImage) Is that what you wanted to know?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to draw a line of shapes in swift
In SwiftUI... You can draw in a View, using a Path Path has methods (that you should find familiar) like: move(to:) addLine(to:) addCurve(to:control1:control2:) To get the rotation, you could then use the View modifier: rotationEffect(_:anchor:) You could draw this over another view using a ZStack, or by using the "overlay" View modifier
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Enterprise account
Here you go: https://developer.apple.com/programs/enterprise/
Topic: Business & Education SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Why I Decided To Join The Empower Network
Reported as Spam.
Replies
Boosts
Views
Activity
Jan ’22
Reply to Testing Apps
Apple provide TestFlight for this purpose.
Replies
Boosts
Views
Activity
Jan ’22
Reply to What does receiver refer to in the documentation for OperationQueue?
Yes, the receiver is the OperationQueue that you are using.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to SwiftUI Edit Button not working after animation
In Overview, try moving the .animation from it's current position, to immediately after the .navigationViewStyle That is, apply it to the NavigationView (which is what you are animating in), not the entire Group
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Issues building HikeView.swift (from SwiftUI Tutorial)
Perhaps there is a problem with your Hike.swift? Could you share the code for that? Or maybe... When you were adding the files to your project, did you check: Copy items if needed Add to targets {Landmarks} Test: Select the file "HikeView.swift" In the file Inspector... ...make sure "Target Membership" shows a tick by "Landmarks"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Random number without repetition
You could add the four indexes (0 to 3) to an array, in random order. Then: removeLast() Use this index with your string array Repeat, until the index array is empty Then (if necessary) start again, with a new random order
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to How to disable screensaver when I running my iPad app onto m1 macbook
Adjust your Mac screensaver as normal: Mac > System Preferences... > Desktop & Screen Saver > Screen Saver .. then turn off the screen saver, or adjust it's settings.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to System Preferences --> Network --> Ethernet --> Limit IP Address Tracking
Search for "iCloud Private Relay" e.g. https://support.apple.com/en-gb/HT212614 Or specifically for Limit IP Address Tracking: https://nerdschalk.com/hide-ip-address-on-iphone-how-to-use-limit-ip-address-tracking-feature-for-this/
Replies
Boosts
Views
Activity
Jan ’22
Reply to Xcode 13 doesnt have Objective C option?
Did that help you, @GaneshAcharya?
Topic: Programming Languages SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’22