xcode

Use Realm Query Results as UITableView Section Headers

独自空忆成欢 提交于 2021-02-11 09:40:30
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

Use Realm Query Results as UITableView Section Headers

纵饮孤独 提交于 2021-02-11 09:39:02
问题 I am trying to use results from a Realm query as section headers in a UITableView. Realm classes: class Person: Object { @objc dynamic var personId = UUID().uuidString @objc dynamic var firstName: String = "" @objc dynamic var surname: String = "" @objc dynamic var mobileNumber: Int = 0 @objc dynamic var password: String = "" override static func primaryKey() -> String? { return "personId" } } class Category: Object { @objc dynamic var categoryId = UUID().uuidString @objc dynamic var person:

Is it possible to take a snapshot of combined views including the camera?

纵然是瞬间 提交于 2021-02-11 08:43:28
问题 My app has a button that should take a screenshot of whatever is on the screen by calling "takeSnapShot" (see code below). I have two views and one of them is a picker view that I use for the camera, so in the screen I see the image coming from the camera and next to it another view with images. The thing is that I capture the screen but it doesn't capture the image coming from the camera. Also, I think I render the view.layer but the debugger keeps saying> "Snapshotting a view that has not

Is it possible to take a snapshot of combined views including the camera?

喜你入骨 提交于 2021-02-11 08:42:16
问题 My app has a button that should take a screenshot of whatever is on the screen by calling "takeSnapShot" (see code below). I have two views and one of them is a picker view that I use for the camera, so in the screen I see the image coming from the camera and next to it another view with images. The thing is that I capture the screen but it doesn't capture the image coming from the camera. Also, I think I render the view.layer but the debugger keeps saying> "Snapshotting a view that has not

Swiftui timer not firing after navigating back

大兔子大兔子 提交于 2021-02-11 07:02:39
问题 i have a timer in SwiftUI which works when opening the view for the first time. When navigating back and opening again, the timer does not start. Any idea what can be wrong ? import SwiftUI struct ClockDetail: View { @State var seconds: Int = 0 @ObservedObject var motion: MotionManager let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() var body: some View { VStack(alignment: .leading) { Text("\(seconds)").font(.title).onReceive(timer) { output in self.seconds += 1 }

Xcode 11 Action Editor? How to invoke?

你。 提交于 2021-02-11 04:35:55
问题 In an earlier post I asked about the right settings for initializing a SCNParticleEngine. With some hints from Zay I managed to get both the SCNP and code paths to work – almost identically. Except that the SCNP path had the particles shrinking over time while the coding path did not. Turns out that buried inside the SCNP file is a dictionary entry “Size” which is a SCNParticlePropertyController. Here’s the code from the debugger: The gotcha is that when I open the SCNP file in the editor, I

Xcode 11 Action Editor? How to invoke?

左心房为你撑大大i 提交于 2021-02-11 04:33:29
问题 In an earlier post I asked about the right settings for initializing a SCNParticleEngine. With some hints from Zay I managed to get both the SCNP and code paths to work – almost identically. Except that the SCNP path had the particles shrinking over time while the coding path did not. Turns out that buried inside the SCNP file is a dictionary entry “Size” which is a SCNParticlePropertyController. Here’s the code from the debugger: The gotcha is that when I open the SCNP file in the editor, I

SPTSessionManager does not initialize or fail

别说谁变了你拦得住时间么 提交于 2021-02-11 01:11:06
问题 When I try to call sessionManager.initialize() neither func sessionManager(manager: SPTSessionManager, didFailWith error: Error) nor func sessionManager(manager: SPTSessionManager, didInitiate session: SPTSession) are called. I have a nodeJS server running on AWS for token access and refresh and I have also tried running a local Ruby server to get the token. No matter what, calling initialize() does nothing. It does fail or succeed and nothing is output to console. I have tried running the

iOS App not using full screen on iPhone 7

こ雲淡風輕ζ 提交于 2021-02-10 20:18:09
问题 I have an iOS App originally developed for iPhone 4 and 5. After doing some updates, I tried to run it on iPhone 7 (Simulator), the Views won't fill the screen any more. They (inclusing the title bar) leave a black margin on the right and the bottom of the screen. I found a lot of similar posts regarding iPhone 5, where an appropriate launch image was missing. Yet, I have included all possible launch images in their correct sizes as asset catalogue (shows no warnings any more, puh), and the

SwiftUI: Why is the height of proxy.safeAreaInsets.bottom equal to keyboardHeight?

核能气质少年 提交于 2021-02-10 20:13:11
问题 So the safeAreaInset.bottom on the iPhone 11 Pro Max is 34.0, but when the keyboard is open, it changes the safeAreaInset.bottom to the height of the keyboard (346.0 points). Is there any way to access the safeAreaInset.bottom value (34.0) when the keyboard is open? For reference, my content view has a geometry reader in it: var body: some View { GeometryReader { proxy in //I pass in proxy into views in here and then access the safe area with proxy.safeAreaInsets.bottom } } I also need this