Igor Delovski Board Forum Index Igor Delovski Board
My Own Personal Slashdot!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Modality & Alerts

 
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa
Mac Cocoa  
Author Message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Mon May 11, 2009 3:42 pm    Post subject: Modality & Alerts Reply with quote

Under The Bridge - full screen presentModalViewController

"Today we have a little iPhone user interface programming problem to
present to you with its not so self evident solution, courtesy of the kind
assistance of one Bryan Henry on the iphonesdk list."
Back to top
View user's profile Send private message
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Mon May 11, 2009 3:44 pm    Post subject: Reply with quote

Bill Dudney: Presenting Modal Views Bug

"When you present a modal view controller via the -presentModalViewCont-
roller:animated: method the viewWillAppear: method gets called on the mo-
dal view controller before the view is actually loaded."
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue May 12, 2009 10:05 am    Post subject: Reply with quote

SO - Is parentViewController always a Navigation controller?

"The update to page 1 wasn't happening, and it took me a long time to
realize that the "doSomethingPleaseWithSomeData" message was not be-
ing sent to Page1ViewController, but the Navigation Controller."


ADC - parentViewController somewhat misleading:

"The underlying view controller if this view controller is a modal view cont-
roller; otherwise, the enclosing navigation or tab bar controller."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed May 20, 2009 2:09 am    Post subject: Reply with quote

Modal UIViewController title not showing

"I have a UIViewController object which is being presented as a modal view,
but I am unable to set the view title. I want the title to vary depending on
the context."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Jul 08, 2009 12:33 am    Post subject: Reply with quote

iphonedevsdk.com - Webservice load wait

"So here how I code this

1) I'm loading and displaying UINavigationController with a root view con-
troller
2) Asking a web service for data and loading UIView with activity indicator
as a root view controller's view
3) Once the data from web service is ready I animate the opacity of the
root controller's view to 0.0 and then I'm replacing it with the UITableVi-
ew ..."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon Sep 14, 2009 12:15 am    Post subject: Reply with quote

mf - dismissModalView

"I have a bunch a views connected through buttons by using the command
presentModalView."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sun Sep 27, 2009 2:19 am    Post subject: Reply with quote

MF - Modal UIViewController that doesnt cover all screen

"With the normal invocation, the modal's view is resized to be as high as
the screen (460px) and slides all the way to the top. i tried forcing the size
and the y origin back to what i need in viewDidLoad and viewWillAppear:
with no effect."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon Mar 08, 2010 1:59 am    Post subject: Reply with quote

Jeff LaMarche - Implementing a Wait "Alert"…

"Now, you should be very careful about using something like this. You
really don't want to annoy your users, so you should only do this when
it's absolutely necessary and only show it for short periods of time."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Mon May 17, 2010 11:01 pm    Post subject: Reply with quote

Jeff LaMarche - Custom Alert Views

"What you can do, however, is create your own class that simulates the be-
havior of UIAlertView. You can find a sample implementation of the techni-
que discussed in this post by downloading this project. In this simple exam-
ple, we're going to create an alert view that lets the user enter a value into
a single text field."


Next day: Some Good Advice

"Joe posted some code to replace the gradient background in the previous
post. Admonished for my laziness and inspired to make the code better, I
incorporated his suggestion."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Fri Jul 16, 2010 12:30 am    Post subject: Reply with quote

so - UIActionSheet cancel button strange behaviour

"If you call UIActionSheet's [sheet showInView:self.view] from a view con-
troller that is a child of a UITabViewController, then the hit testing on the
cancel button fails in that portion of the UIActionSheet that lies above the
tabbar's view."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Fri Jul 16, 2010 12:41 am    Post subject: Reply with quote

meekismurder.com - UIActionSheet Cancel Button Blocked In TabBar App


"Instead of showing the ActionSheet in self.view like normal, show it in
the App Delegate Window instead, ensuring it’s on top of everything,
here’s how:

Code:
UIActionSheet *confirmSheet = [[UIActionSheet alloc] initWithTitle:@”Do Something?”
                                                          delegate:self
                                                 cancelButtonTitle:@”Cancel”
                                            destructiveButtonTitle:@”Confirm”
                                                 otherButtonTitles:nil];

[confirmSheet showInView:appDelegate.window];

[confirmSheet release];
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Aug 31, 2010 2:46 pm    Post subject: Reply with quote

MF - Where in Cocoa can I find an infinite loop??

"Maybe use a CFRunLoopObserver. Google it. Read its reference docs.
Then look up CFRunLoop and NSRunLoop's getCFRunLoop method."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Thu Oct 21, 2010 11:02 pm    Post subject: Reply with quote

bitesizecocoa.com - How to get an alert view background in your
iPhone app


"Sometimes you may want to mimic the look of a UIAlertView without
showing the actual alert itself. For example, you may have a HUD style
modal alert. The UIAlertView background is a vignette style overlay that
sits in between the current view and the alert dialog itself."
Back to top
View user's profile Send private message Visit poster's website
XNote
Kapetan


Joined: 16 Jun 2006
Posts: 532

PostPosted: Thu Oct 21, 2010 11:12 pm    Post subject: Reply with quote

http://bitesizecocoa.com/post/534045912/how-to-get-an-alert-view-background-in-your-iphone-app
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Fri Nov 05, 2010 1:46 am    Post subject: Reply with quote

UIAlertViewDelegate Protocol Reference

- (void)alertViewCancel:(UIAlertView *)alertView;

// Called when we cancel a view (eg. the user clicks the Home button). This
// is not called when the user clicks the cancel button.
// If not defined in the delegate, we simulate a click in the cancel button
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Nov 01, 2011 5:13 pm    Post subject: Reply with quote

MF - Alert after App is "closed" (Home button pressed)

"I think this Apple Doc (the UILocalNotification Class Reference,) aught to
tell you everything you need to know:

UILocalNotification Class Reference

with maybe a little help from this tutorial:

iPhone Programming Tutorial – Local Notifications

(I'm tempted to do even more and write your code for you as I'm intrigued
by the idea of using local notifications to pop an alert right as the app
closes.)"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sat Jan 21, 2012 7:20 pm    Post subject: Reply with quote

blog.codecropper.com - Replicating TweetBot’s Alerts and Action Sheets

"Since the first time I had to use an UIActionSheet or UIAlertView in an app
I disliked the way it was implemented. It was a pain if you had two kinds of
alerts in the same class for example as everything is done by invoking a
delegate method. I also disliked the fact that the code that should be exe-
cuted in the event of a button was almost always in a separate place in your
source code. The code needs a lot of constants, switches and you need to
tag your UIAlertView…. I hated it!"
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Thu Feb 02, 2012 5:17 pm    Post subject: Reply with quote

YRDropdownView – A Polite UIAlertView Alternative for iOS

"YRDropdownView is an iOS library for displaying stylish alerts, warnings,
and errors"
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Sat Jun 02, 2012 2:04 pm    Post subject: Reply with quote

Ajnaware’s Weblog - Dynamically adding UIActionSheet buttons

"The problem with this becomes apparent when you run it – the cancel button
appears at the TOP of the sheet, whereas standard practice seems to be that
it should be at the bottom. How to achieve this?"
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Sat Apr 13, 2013 10:29 pm    Post subject: Reply with quote

so - How to create colored or translucent background for UIActionSheet?

"When you try deleting a note in iPhone's Notes application, an UIActionSheet
pops up. The sheet is translucent (but not black translucent). How is that
achieved? Is it possible to make the background of UIActionSheet a certain
color?"
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 2:34 pm    Post subject: Reply with quote

so - How to implement a pop up dialog box in iOS

"I highly recommend reading the Temporary Views documentation. My answer
is largely a summary of this and other related documentation."

Alert (show me an example)
Action Sheet (show me an example)
Modal View (show me an example)
Popover (show me an example)
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 8:07 pm    Post subject: Reply with quote

rw - UIPresentationController Tutorial: Getting Started

"In this UIPresentationController tutorial you'll learn how to present view
controllers with custom transitions and custom presentation styles. No longer
will you be limited to full-screen or popover presentations and the standard
transition animations. You'll start with some drab, lifeless view controller
presentations and you'll bring them to life."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 8:12 pm    Post subject: Reply with quote

appcoda - A Beginner's Guide to Presentation Controllers in iOS 8

"We'll subclass UIPresentationController (which was introduced in iOS 8) to
provide view and transition management for presented view controllers.

Presentations usually consist of three major parts: the presented view con-
troller, presenting view controller and the chrome. Looking at a typical pre-
sentation below, you can see these views. For apps shipped by Apple, the
chrome is usually a grey semi-transparent view, but you have the freedom
to style it however you want."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 8:17 pm    Post subject: Reply with quote

pspdfkit - Presentation Controllers and Adaptive Presentations

"PSPDFKit is written in Objective-C so all the code samples in this article are
too, although our problems are with UIKit and are equally applicable when
using Swift. You can read more about the problems discussed here and find
sample projects by following the Radar links."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 8:19 pm    Post subject: Reply with quote

so - UIPopoverPresentationController on iOS 8 iPhone

"If anybody wants to present a popover with code only, you can use the following approach."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Oct 12, 2016 8:32 pm    Post subject: Reply with quote

github.com - FPPopover

"This library provides an alternative to the native iOS UIPopoverController,
adding support for iPhone and additional opportunities to customize the look
and feel of the popovers.

The development started as first as a Mobiloud open source component, after
some commits we realized was a appreciated library so I decided to continue
the development, also the development is continuing thank to your feedbacks
and pull requests!"
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Nov 09, 2016 10:42 pm    Post subject: Reply with quote

so - Change Action sheet popover arrow in iOS8

"use below line for remove arrow from action sheet"

"The selected answer does not center the alert if you have a nav/status bar.
To exactly center your alert controller..."
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Wed Nov 29, 2017 11:51 am    Post subject: Reply with quote

so - UIActionSheet deprecated on iOS8

Code:
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"Action Sheet" message:@"alert controller" preferredStyle:UIAlertControllerStyleActionSheet];

        [actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

            // Cancel button tappped.
            [self dismissViewControllerAnimated:YES completion:^{
            }];
        }]];

        [actionSheet addAction:[UIAlertAction actionWithTitle:@"Delete" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {

            // Distructive button tapped.
            [self dismissViewControllerAnimated:YES completion:^{
            }];
        }]];

        [actionSheet addAction:[UIAlertAction actionWithTitle:@"Other" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

            // OK button tapped.

            [self dismissViewControllerAnimated:YES completion:^{
            }];
        }]];
    // Present action sheet.
    [self presentViewController:actionSheet animated:YES completion:nil];
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Thu Nov 30, 2017 1:07 pm    Post subject: Reply with quote

so - UITextField in UIAlertController (border, backgroundColor)

"I figured this out by walking the view hierarchy in the debugger, from which I
noticed a UIVisualEffectView. Removing that seems to give you what you want
along with setting the containing view to a clear background. Without removing
the visual effect, a clear background shows what is behind the alert view itself
for some reason."


Code:
UIAlertController *alertController =
 [UIAlertController alertControllerWithTitle:@"Its Not Pretty!"
                                     message:@"Some times things get ugly!"                         
                              preferredStyle:UIAlertControllerStyleAlert];

[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField){
    textField.text = @"Text: No border and clear 8^)";

 }];
[self presentViewController:alertController animated:TRUE completion:^{
}];

for (UIView* textfield in alertController.textfields) {
    UIView *container = textField.superview;
    UIView *effectView = container.superview.subviews[0];

    if (effectView && [effectView class] == [UIVisualEffectView class]){
        container.backgroundColor = [UIColor clearColor];
        [effectView removeFromSuperview];
    }
}
Back to top
View user's profile Send private message Visit poster's website
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Fri Dec 15, 2017 8:11 pm    Post subject: Reply with quote

so - How to present UIAlertController when not in a view controller

Code:
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
//...
id rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
if([rootViewController isKindOfClass:[UINavigationController class]])
{
    rootViewController = ((UINavigationController *)rootViewController).viewControllers.firstObject;
}
if([rootViewController isKindOfClass:[UITabBarController class]])
{
    rootViewController = ((UITabBarController *)rootViewController).selectedViewController;
}
[rootViewController presentViewController:alertController animated:YES completion:nil];
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Wed Dec 19, 2018 5:38 am    Post subject: Reply with quote

https://pspdfkit.com/blog/2016/popovers-on-popovers/

Preventing Popovers on Popovers

Show one popover at a time. Displaying multiple popovers clutters the interface and causes confusion. Never show a cascade or hierarchy of popovers, in which one emerges from another. If you need to show a new popover, close the open one first.
Back to top
View user's profile Send private message
delovski



Joined: 14 Jun 2006
Posts: 3522
Location: Zagreb

PostPosted: Tue Sep 03, 2019 11:41 am    Post subject: Reply with quote

sarun - Modality changes in iOS13

"One behavior that changed and might break your old app once you starting
adopting new iOS 13 is the modal presentation. So with iOS 13, default
presentation for modal is now in sheet style."
Back to top
View user's profile Send private message Visit poster's website
Ike
Kapetan


Joined: 17 Jun 2006
Posts: 3025
Location: Europe

PostPosted: Tue Oct 08, 2019 12:45 am    Post subject: Reply with quote

https://old.reddit.com/r/iOSProgramming/comments/deodwq/ios_13_do_we_need_to_add_fullscreen_to_every/

iOS 13 - Do we need to add .fullScreen to EVERY present() call we do now?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Igor Delovski Board Forum Index -> Mac Cocoa All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Delovski.hr
Powered by php-B.B. © 2001, 2005 php-B.B. Group