Sounds good! I’ll take a look into it, thanks again!
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Latest posts made by colint
-
RE: Swipe TableViewCell to show multiple actions
-
RE: Swipe TableViewCell to show multiple actions
Looking good! I’m not seeing the “your edit” button sliding out all the way but I’m sure I can figure that out. Thanks so much for your help!
-
RE: Swipe TableViewCell to show multiple actions
I could try but not this Sunday, normally tomorrow
Of course, no rush! That’s interesting, I didn’t know you could use touch_began, etc. with the ui module. I suppose it would need a little math to calculate which cell the touch was on but that should still be doable.
-
RE: Swipe TableViewCell to show multiple actions
Strange, it must be just a problem on my end then. When I put ui.inbackground it doesn’t freeze, but the alerts show up behind the presented view, so I can only see them once I close the window. Anyway, like you said, as long as both actions show up then this is a good alternative way to do it! The only thing I’m wondering about now is if there is a way to get the same behaviour from the original solution, where a long swipe to the left would perform one of the actions. Thanks again for the help!
-
RE: UI: How to change status bar color when hide_title_bar=True
@JonB thanks, that’s good to know. I think there would be a way to set that in info.plist too, so maybe I’ll just go with that for now since it shouldn’t need to change colours while running. Thanks again for all your help!
Update: Yes, there is a way to change this in the info.plist file so I removed the setStatusBarStyle call for now.
-
RE: Swipe TableViewCell to show multiple actions
@cvp Thanks for the script, the gestures module seems really neat! I tried out your code and the actions showed up nicely, the only thing is that for some reason, the script freezes when I press either of the buttons. I have had some issues with console.alert that I think started after some iOS update, so it may just be that that is causing the problem.
-
RE: Swipe TableViewCell to show multiple actions
Thanks for all the help! And sorry for taking a while to get back to you, I’ve been really busy these past few days. I tried your code and both actions are showing up for me every time, however Pythonista is still crashing from segmentation faults whenever I tap either action (whether or not I remove the blk.invoke). Thanks again and I agree that it’s hard to imagine a time when @JonB was smarter!
-
RE: UI: How to change status bar color when hide_title_bar=True
Thanks so much for your help! setStatusBarStyle_ with the True argument crashed for some reason, it said the function only expected one argument. When I removed the True and just put in the number that seems to work fine!
-
Swipe TableViewCell to show multiple actions
Hello,
I would like to have another action (in addition to the delete action) be available when swiping a TableViewCell to the side. From this older forum post it seems like I need to override a method, but I didn't get enough details from that to be able to do it myself (do I override in the TableView or in the delegate?). I also found this website explaining how to do it in Swift https://useyourloaf.com/blog/table-swipe-actions/#swipe-actions-ios-11, which shows a different and newer method to override since the older one is now deprecated. However, I'm not sure how to translate this code into Python, and I'm also not sure how to override the method since my delegate is not actually a subclass of UITableViewDelegate (and I'm not sure how to make it one). Any help would be greatly appreciated!
-
RE: UI: How to change status bar color when hide_title_bar=True
Thank you so much for your help, it works great! As a follow-up, do you happen to know how to change the color of the text and icons themselves (clock, battery icon, etc.)? I would like to have white text when the background is black, and vice versa.
For anyone else interested, I tested a bit and made a few changes, the final code is:
# Find the window (I think I remember seeing somewhere that the keyWindow method is # deprecated, so I used this code for finding windows that I saw somewhere else) for window in UIApplication.sharedApplication().windows(): # Note, there are multiple windows, one is the window of the actual Pythonista application. I had # if 'PA3PythonistaWindow' in str(window._get_objc_classname()): # but this seems to only change the pythonista application and not my app's window. # For now, I am just running the following code on all windows in the loop and it works: F = window.windowScene().statusBarManager().statusBarFrame() statusBar = ObjCClass('UIView').alloc().initWithFrame(F) statusBar.backgroundColor = UIColor.redColor() window.addSubview_(statusBar)