Re: Hiding tab bar causes web content in pushed view to slide down
Try doing the load in -viewWillAppear: instead. My guess is that the WKWebView is adding a UIScrollView when you load the content, and that scroll view is being modified after the fact when you can see it. Alternatively you can try setting automaticallyAdjustsScrollViewInsets=NO on your view controller. > On Oct 29, 2015, at 6:14 PM, Rick Mann wrote: > > I have a tab bar application with a nav controller in each of the tabs. > Clicking on an item in that pushes a new view controller with a WKWebView. > Actually there's a UIView specified in IB, and in -loadView I create the > WKWebView and add it to the UIView, and then add constraints to make it be > the same size. > > Then in -viewDidAppear:, I load the web view content. This works fine. > > Now I changed the pushed controller so that it hides the tab bar on push. > Now, when the web content loads, there's a gap between the top of it and the > bottom of the nav bar (no gap along the bottom). You can see it slide from > the right, then snap down. If I skip the load in -viewDidAppear:, I don't see > it move, but of course the page is all the same color. > > I tried coloring the container view blue and the web view red. The view > hierarchy inspector in Xcode does not appear to render the stack correctly > (e.g. it shows the web content as completely off to the left). > > I finally solved this by a) removing the simulated nav bar in the pushed VC, > and b) constraining the container view to the super view, not the top layout > guide. I can't tell if this is causing the web content to appear under the > nav bar, but that's not particularly critical in this case. > > The thing is, I feel like this is a bit of a hacked solution, and don't > understand what's going wrong in the first place. > > -- > Rick Mann > rm...@latencyzero.com > > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com > > This email sent to david.dun...@apple.com -- David Duncan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: -replaceSubview transition animation that is applied to both old and new subviews
Answering my own question - I ended up using NSPageController. 2015-10-29 8:55 GMT+02:00 Nick : > Hi > I am trying to do a nice sliding effect (that looks to the user as > Calendar scrolling), but for pages. So basically I have several pages that > I want to present to the user one by one, that he can flip with a trackpad > gesture. > > I am using a kCATransitionFromLeft animation, when the pages are being > flipped backwards: > > -(IBAction)prevPage:(id)sender { > if(self.currentPageIndex <= 0) > return; //no previous subview > > [self.pageDisplayView > removeConstraints:self.pageDisplayView.constraints]; > > CATransition *trans = [CATransition animation]; > trans.type = kCATransitionMoveIn; > trans.subtype = kCATransitionFromLeft; > self.pageDisplayView.animations = @{@"subviews": trans}; > > [[self.pageDisplayView animator] > replaceSubview:self.pages[self.currentPageIndex] > with:self.pages[self.currentPageIndex-1]]; > self.currentPageIndex--; > > NSDictionary *subView = @{@"page": self.pages[self.currentPageIndex]}; > NSArray *hConstraints = [NSArray array]; > hConstraints = [hConstraints > arrayByAddingObjectsFromArray:[NSLayoutConstraint > constraintsWithVisualFormat:@"H:|[page]|" options:0 metrics:nil > views:subView]]; > NSArray *vConstraints = [NSArray array]; > vConstraints = [hConstraints > arrayByAddingObjectsFromArray:[NSLayoutConstraint > constraintsWithVisualFormat:@"V:|[page]|" options:0 metrics:nil > views:subView]]; > [self.pagedisplayView addConstraints:hConstraints]; > [self.pageDisplayView addConstraints:vConstraints]; > } > > But the problem is that the previous (old) subview, that is being replaced > by the new one, does not animate - only the new one does. So it doesn't > look like scrolling, more like the new page goes over the old page. > I would like to have the old subview move from right to left as it > disappears (as in slide out) as well. > How could I achieve this? > > And just as a subquestion, how is continuous swipe gesture tracking > usually implemented? Basically I was hoping to have the user to be able to > swipe the pages left (go to the next page) and right (go to the prev page), > but in such a way that while his fingers are still on the trackpad, the > page doesn't move away completely but stays "in a transition". Something > like pages in Safari, when you go back and forward with the swipe gesture > but do not take the fingers off the trackpad. I was wondering how did Apple > do this? > > Thank you for reading this far and possible suggestions! > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AppleScript-ObjC Bridge Question
On 1 Nov 2015, at 12:05 AM, Dave wrote: > > continue initWithParam:theParam andAnotherParam:(missing value) of me ? > > Otherwise how will it know to call super or self? From the AppleScript Language Guide: > A continue statement causes AppleScript to invoke the handler with the same > name in the parent of the current handler. No me. -- Shane Stanley ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AppleScript-ObjC Bridge Question
or maybe: > continue initWithParam:theParam andAnotherParam:(missing value) continue initWithParam:theParam andAnotherParam:(missing value) of me ? Otherwise how will it know to call super or self? Cheers Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AppleScript-ObjC Bridge Question
On 31 Oct 2015, at 10:58 PM, Dave wrote: > > So: > >continue init() > > Calls the Superclass? Yes. > How would I do this: > > -(void) initWithParam:(NSString*) theParam > { > self = [self initWithParam:theParam andAnotherParam:nil]; > if (self == nil) > return; > > // Do something > > return self; > } Probably: on initWithParam:theParam continue initWithParam:theParam andAnotherParam:(missing value) -- Add your subclass-specific initialization here. -- If an error occurs here, return missing value. return me end init But the differing inits smells a bit to me -- especially as it's unnecessary. > > Thanks a lot, if you could point me to some documentation on this There is none to speak of. -- Shane Stanley ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AppleScript-ObjC Bridge Question
So: continue init() Calls the Superclass? How would I do this: -(void) initWithParam:(NSString*) theParam { self = [self initWithParam:theParam andAnotherParam:nil]; if (self == nil) return; // Do something return self; } Thanks a lot, if you could point me to some documentation on this I’d be grateful I’ve googled it but not come up with much….. All the Best Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: AppleScript-ObjC Bridge Question
Thanks a lot Shane, I totally missed it, sorry for the misunderstanding. Cheers Dave > On 30 Oct 2015, at 15:40, Dave wrote: > > Well, obviously it does get called, but how do you actually define in is > AppleScript? I mean what is the equivalent of: > > -(id) init > { > self = [super init]; > if (self == nil) > return nil; > > [self doSomething]; > > return self; > } > > In AppleScript? > > All the Best > Dave > > >> On 30 Oct 2015, at 09:46, Dave wrote: >> >> Hi, >> >> This is a normal Objective-C type project but calls to AppleScript files as >> per http://appscript.sourceforge.net/asoc.html here is an example: >> >> LTWAppleScriptHandlerOutlook.h file: >> >> @interface LTWAppleScriptHandlerOutlook : NSObject >> { >> } >> >> -(NSString*) testOutlook:(NSString*) theNameString; >> -(NSString*) testOutlookAgain:(NSString*) theNameString; >> >> @end >> * >> LTWAppleScriptHandlerOutlook.applescript File >> >> >> script LTWAppleScriptHandlerOutlook >> >> property parent : class "NSObject" >> >> on testOutlook_(theName) >> local myString >> >> tell application "Microsoft Outlook" >> >> activate >> set myString to the name of window 1 >> set myString to "Hello " & myString >> >> end tell >> >> return myString >> end testOutlook_ >> >> >> on testOutlookAgain_(theName) >> local myString >> >> tell application "Microsoft Outlook" >> >> activate >> set myString to the name of window 1 >> set myString to "Hello Again " & myString >> >> end tell >> >> return myString >> end testOutlook_ >> >> end script >> >> >> I can’t seem to find any other documentation on this and was wondering if >> init would get called if I defined it, when I execute the following: >> >> Class >> myOutlookTestClass; >> LTWAppleScriptHandlerOutlook*myOutlookTest; >> >> myOutlookTestClass = NSClassFromString(@“ LTWAppleScriptHandlerOutlook”); >> myOutlookTest = [[myOutlookTestClass alloc] init]; >> >> >> All the Best >> Dave >> >> >> >> >> >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com >> >> This email sent to d...@looktowindward.com > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com > > This email sent to d...@looktowindward.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com