Post

Replies

Boosts

Views

Activity

Reply to UISheetPresentationController behind UITabBar
+1 for a sample. How does presenting a UITabBarController on top of the UISheetPresentationController make the sheet appear behind the tab bar but above the tab view controllers' content? Only thing I can think of is maybe adding a UITabBar (which is a view) to the sheet itself at the bottom. But then I'd have to basically reimplement UITabBarController functionality from scratch and this would be very disruptive to my app's current structure (probably not worth the effort). That would get the "Find My app" look (which has a sheet that can't be dismissed). In my case I need a sheet that is dismissible. I think a nice enhancement would be able to specify a passthrough view, or something of that nature on UISheetPresentationController. Something like: @property (nonatomic,strong,nullable) UITabBar *passThroughTabBar; So existing UITabBarControllers can easily add a sheet that doesn't block the tab bar. Or maybe something like this: @property (nonatomic,strong,nullable) CGFloat bottomMargin; //assign the UITabBar's frame height to this so it floats above the tab bar instead of covering it.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’23
Reply to Using SF Symbols on iOS 13 and falling back to assets on iOS 12
Adding a fallback image isn't working for me for iOS 14 ('m using a symbol introduced in iOS 15 and I'm getting this warning in a storyboard file). I tried: Adding a normal image asset with the same name as the symbol in my Asset catalog. Adding a "Symbol image set" with the same name as a symbol in my Asset catalog. Neither worked for me. The symbol has dots. like key.radiowaves.forward.fill
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’23
Reply to UIKit doesn't always retain custom UIViewControllerTransitioningDelegate?
Whoops made a mistake in the last code block in my previous post (can't edit it). It should be: theVC.modalPresentationStyle = UIModalPresentationCustom; theVC.transitioningDelegate = transDelegate; theVC.strongTransDelegate = transDelegate; I'm assuming the transitioningDelegate property was declared weak anticipating cases where someone would set self as the transitioningDelegate I guess.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’23
Reply to How to pass reference to NSPersistentContainer to storyboard-created table view controller in objective c
Declare a initializer like this in your ToDoListTableViewController header file: -(instancetype)initWithCoder:(NSCoder*)coder persistentContainer:(NSPersistentContainer*)persistentContainer; Then in your implementation: -(instancetype)initWithCoder:(NSCoder*)coder persistentContainer:(NSPersistentContainer*)persistentContainer { self = [super initWithCoder:coder]; if (self) { _persistentContainer = persistentContainer; } return self; } Then you can do this: UIStoryboard *mainSB = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; ToDoListTableViewController *toDOVC = [mainSB instantiateViewControllerWithIdentifier:@"ToDoListTableViewController" creator:^UIViewController * _Nullable(NSCoder * _Nonnull coder) { return [[ToDoListTableViewController alloc]initWithCoder:coder persistentContainer:persistentContainer]; }]; But I wouldn't stop there. You could make the code cleaner by also declaring a factory method in ToDoListTableViewController so you can write the UIStoryboard code from many different places: //In ToDoListTableViewController's header file: +(ToDoListTableViewController*)makeWithPersistentContainer:(NSPersistentContainer*)persistentContainer; //Implementation: +(ToDoListTableViewController*)makeWithPersistentContainer:(NSPersistentContainer*)persistentContainer; { UIStoryboard *mainSB = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; return [mainSB instantiateViewControllerWithIdentifier:@"ToDoListTableViewController" creator:^UIViewController * _Nullable(NSCoder * _Nonnull coder) { return [[ToDoListTableViewController alloc]initWithCoder:coder persistentContainer:persistentContainer]; }]; } Then you can just use the +makeWithPersistentContainer: to make the ToDoListTableViewController. Alternatively you could look for documentation on the hidden IBSegueAction feature but it's probably not necessary.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’23
Reply to WKWebView document.onvisibilitychange event not always being fired. Need to detect page changes reliability from WKUserScript
Thanks again for your replies! So after some research it appears that there is no javascript event to detect url changes. So the javascript code I have won't work for "web apps" that modify an already loaded DOM and change the URL programmatically. Usually a combination of onhashchange and onstatechange will capture all the ways JS programmatically changes the apparent URL without loading a new document. Both those aren't relevant for the back/forward cases. I heard about onhashchange but I can't seem to find documentation for a onstatechange event? It is my understanding that onhashchange won't pick up url changes in all cases? Being able to run a script after a "page change" in a reliable fashion is surprisingly complex.
Topic: Safari & Web SubTopic: General Tags:
Jul ’23
Reply to How to resolve - unarchiveObjectWithData:' is deprecated: first deprecated in iOS 12.0
Under option 1 you say you archive with: [NSKeyedArchiver archivedDataWithRootObject:(array of objects of type A) requiringSecureCoding:YES error:&error] And then unarchive with: NSSet *classesSet = [NSSet setWithObjects: [NSMutableArray classForCoder], [A classForCoder], [NSString classForCoder], [NSNumber classForCoder], [B classForCoder], [C classForCoder] , nil]; NSKeyedUnarchiver *unArchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:decryptedData error:&error]; [unArchiver setRequiresSecureCoding:YES]; unarchivedArray = [unArchiver decodeObjectOfClasses:classesSet forKey:NSKeyedArchiveRootObjectKey]; Which doesn't match. Why are you specifying all those classes (NSString, NSNumber, etc.) if the array only contains TypeA? If you archive a single array that only contains TypeA objects then why don't you you use -decodeArrayOfObjectsOfClass:forKey: NSArray *unarchivedArray = [unArchiver decodeArrayOfObjectsOfClass:[TypeA class] forKey:NSKeyedArchiveRootObjectKey];
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Reply to How To Set Number Of Lines in UIButtonConfiguration
Being able to enforce numberOfLines would be desirable. It seems like a pretty common need to enforce a button to fit on a single line and I would think having a button wrap multiline would be more uncommon. In my case a button with a configuration initially displays with 1 line, but after toggling the Dynamic type setting to a smaller value, then increasing it back to the original value causes the button to start character wrapping even though there is plenty of room to fit all text on one line. It seems that UIButton (with a button configuration) can't really properly respond to the -sizeToFit method. Calling -sizeToFit just constrains the button to the current width and increases the height which is the opposite of what I often want.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’23