Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Plorkyeran posted:

From my prodding at it there's two main things. The first is just that it's a second copy of the binary in a significant less space-efficient form. The thing that makes it produce binaries ten times larger rather than just 2-3x is that it appears to not implement vague linkage, so link together ten object files that each contain an inline function which didn't get inlined and you get just one copy of the compiled function, but ten copies in the bitcode.

Are you saying that bitcode is being distributed as a bunch of unlinked object files? Because I'm pretty sure that's not expected.

Adbot
ADBOT LOVES YOU

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN
Yeah, multiplatform is not an issue, it's basically a new mobile component to a SaaS website.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Regular Nintendo posted:

This bitcode chat got me thinking... I'm a one-man team at work and I'll be starting a project from scratch shortly. We're sunsetting an app that's been tossed between 3 different external teams prior to my arrival a year ago and as such is kind of a dumpster fire. Does anyone have any reccomendation on build setups to keep the new project optimized? I haven't set up any kind of long-lived project in about 3-4 years so I have no idea what's changed.

fwiw the Xcode new project defaults get updated as they mess with LLVM/clang/etc so you're in a pretty good position if you create a new project from scratch.

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe

Doc Block posted:

What is the actual build number string?

I know this is a month later, but is this something that would be in the source code or project files? I cannot check the iTunes Connect interface myself, since I don't have access to that, and for some reason, because I've got two different developer accounts associated with my AppleID, it only shows me the Connect page for my own personal developer account, and not the one for the organization that I'm an Admin at. Unless, you know, that requires Agent level access. In which case, I can't check.

Doc Block
Apr 15, 2003
Fun Shoe
It's under Info in the project settings.

edit: in iTunes Connect there should be a way to change the organization you're looking at, if you have access to more than one...

lord funk
Feb 16, 2004

180/240 screenshots ready :11tea:
0/6 videos :downsgun:

edit: oh for fucks sake simulator screenshots save at the view percentage? why would you do that???

lord funk fucked around with this message at 22:54 on Jun 5, 2016

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe

Doc Block posted:

It's under Info in the project settings.

edit: in iTunes Connect there should be a way to change the organization you're looking at, if you have access to more than one...

CFBundleShortVersionString
1.0.26

CFBundleVersion
1

Doc Block
Apr 15, 2003
Fun Shoe
As long as each build number is higher than the last one you uploaded it should work, but v:shobon:v

The reason I asked was because one time I tried to put the Git revision hash in there and it made iTunes Connect barf.

lord funk
Feb 16, 2004

:allears: I love app previews! I just love iTunesConnect!

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Anyone want to organize a WWDC meet up this year?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
I'd show up to one.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
iOS 9 being an unstable piece of poo poo for anyone else? I'm getting tired of phones rebooting while I'm debugging

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN

hackbunny posted:

iOS 9 being an unstable piece of poo poo for anyone else? I'm getting tired of phones rebooting while I'm debugging

I've noticed just from general use that it seems like the longer the device uptime is the more "cruft" it seems to accumulate mandating a reboot every few days or so, that's about it

Oh and the assistivetouch button going apeshit up and down the screen

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

hackbunny posted:

iOS 9 being an unstable piece of poo poo for anyone else? I'm getting tired of phones rebooting while I'm debugging

No more so than other versions of iOS.

I not sure if that's helpful or depressing.

Hughlander
May 11, 2005

Ender.uNF posted:

Anyone want to organize a WWDC meet up this year?

I'll be there but feel I may be too busy to organize this time. I have PMs and some people may have my # from previous years.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

eschaton posted:

I'd show up to one.

lord funk
Feb 16, 2004

TC-11 3.0 update today :toot:

So far a smooth rollout, although one of the sister apps is hung up *again* in app review because it runs in the background. Just like it did the last update. And the one before it. And for the dozens of updates of the other two apps of mine that do the same thing.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I'll be around all week

Hughlander
May 11, 2005

I have a question about IPV6 requirements in iOS9.

quote:

Note: The ability to synthesize IPv6 addresses was added to getaddrinfo in iOS 9.2 and OS X 10.11.2. However, leveraging it does not break compatibility with older system versions. See getaddrinfo(3) Mac OS X Developer Tools Manual Page.

We rely on that ability, but the docs say that it's a requirement for iOS9. Is that sufficient that we support 9.2/9.3 or do we have to strip it now and get it back to 9.1/9.0? What's the right place to ask that?

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Hughlander posted:

I have a question about IPV6 requirements in iOS9.


We rely on that ability, but the docs say that it's a requirement for iOS9. Is that sufficient that we support 9.2/9.3 or do we have to strip it now and get it back to 9.1/9.0? What's the right place to ask that?

We bumped our required version to iOS 9.2 and passed review no problem. Now we're having an issue with dual-stack UDP sockets, that stop working with IPv4 peers after the application switches to background mode (... but only on WiFi? who the hell knows. loving background mode). loving IPv6

By the way, you can implement address synthesis yourself if you need to support <9.2, the protocol is RFC 7050. I did it before we opted to require 9.2, it's not super hard, just full of annoying heuristics to distinguish between DNS64 and things like captive portals

hackbunny fucked around with this message at 19:15 on Jun 8, 2016

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Captive portals are the worst thing in the world. I implemented our captive portal detection and I was floored when I realized these idiots purposefully intercept the iOS probing traffic and allow it through to trick the device into thinking it has valid WiFi, then block everything else. A lot of them try to MITM HTTPS to do it too, which breaks tons of apps. Apple implemented some DNS randomization stuff a few releases ago and now the same moron IT admins and captive portal vendors are in an arms-race as every so often iOS springs a brand new DNS name on them that they rush to add to their whitelist.

Their rationale? Their super special (Java Webserver based) login forms "don't work" in the popup browser iOS gives you. Fix our crappy non-valid-HTML login form? Pfffft, hell no. Just try to trick the OS into believing it has a connection.

gently caress network admins, forever.

emoji
Jun 4, 2004
WHY does NSTextView's automaticLinkDetection property only do anything when the textview instance's editable property is true and not when false with programmatically set text? Many people have asked online over the years and end up implementing link detection logic manually or use a library.

NSTextView's automaticDataDetectionEnabled (phone #s, dates, addresses) works (gives mouseover options) in either case. Why data detectors and not link detectors? It seems reasonable to assume that the data detector logic would include link detection, because it definitely does and is documented and visible in the headers. Using the link detection mask `NSTextCheckingTypeLink` with enabledTextCheckingTypes (used with checkTextInDocument, which seems to invoke the same data detection facilities) gives the same non-working result.

Here, I programmatically append text to my NSTextView from my NSTextField in my NSTextFieldDelegate's controlTextDidEndEditing method. Now, I can make link detection work by enabling editable, calling checkTextInDocument, and disabling editable on my NSTextView, but this seems really dumb. None of those steps are required for data detectors to activate. I can't find it now but I feel like I read this is intentional somehow. WHY?


code:
class ChatView: NSView {

    override init(frame frameRect: NSRect) {
        super.init(frame: frameRect)

        let linkTextAttributes = [
            NSForegroundColorAttributeName: NSColor.blueColor(),
            NSCursorAttributeName: NSCursor.pointingHandCursor(),
            NSFontAttributeName: NSFont(name: "Menlo", size: 12)!
        ]

        let stackView = NSStackView(frame: frameRect)
        stackView.autoresizingMask = [.ViewHeightSizable, .ViewWidthSizable]
        stackView.translatesAutoresizingMaskIntoConstraints = true
        stackView.orientation = .Vertical
        addSubview(stackView)

        let chatView = NSTextView()
        chatView.autoresizingMask = [.ViewHeightSizable, .ViewWidthSizable]
        chatView.translatesAutoresizingMaskIntoConstraints = true
        chatView.identifier = "chatView"
        chatView.editable = false
        chatView.selectable = true
        chatView.displaysLinkToolTips = true
        chatView.linkTextAttributes = linkTextAttributes

// START CODE OF CONCERN
        chatView.automaticLinkDetectionEnabled = true
        chatView.automaticDataDetectionEnabled = true
//        chatView.enabledTextCheckingTypes = NSTextCheckingAllTypes  // alternatively the above 2 lines can be replaced with this for the same behavior
// END CODE OF CONCERN

        let scrollView = NSScrollView()
        scrollView.autoresizingMask = [.ViewHeightSizable, .ViewWidthSizable]
        scrollView.translatesAutoresizingMaskIntoConstraints = true
        scrollView.hasVerticalScroller = true
        scrollView.hasHorizontalScroller = false
        scrollView.documentView = chatView
        stackView.addView(scrollView, inGravity: .Top)

        let inputView = NSTextField()
        inputView.delegate = self
        stackView.addView(inputView, inGravity: .Top)

    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

extension ChatView: NSTextFieldDelegate {
    override func controlTextDidEndEditing(obj: NSNotification) {
        guard let inputField = obj.object as? NSTextField else { return }
        guard let chatView = subviewWithIdentifier("chatView") as? NSTextView else { return }
        guard inputField.stringValue != "" else { return }

        let text = textField.stringValue + "\n"
        let textAttributes = [
            NSForegroundColorAttributeName: NSColor.blackColor(),
            NSFontAttributeName: NSFont(name: "Menlo", size: 12)!
        ]

        let attributedText = NSAttributedString(string: text, attributes: textAttributes)
        chatView.textStorage?.appendAttributedString(attributedText)

// START CODE OF CONCERN - these three lines are not necessary for data detectors to do their thing
        chatView.editable = true
        chatView.checkTextInDocument(nil)
        chatView.editable = false
// END CODE OF CONCERN

        inputField.stringValue = ""
    }
}
extra
code:
extension NSView {

    var allSubviews: [NSView] {
        return allSubviewsWithDepth(Int.max)
    }

    func allSubviewsWithDepth(depth: Int) -> [NSView] {
        var allSubviews: [NSView] = []
        guard depth >= 0 else { return allSubviews }

        self.subviews.forEach { (subview) in
            allSubviews.append(subview)
            allSubviews.appendContentsOf(subview.allSubviewsWithDepth(depth - 1))
        }

        return allSubviews
    }

    func subviewWithIdentifier(identifier: String) -> NSView? {
        return self.allSubviews.filter { $0.identifier == identifier }.first
    }
}

Hughlander
May 11, 2005

hackbunny posted:

We bumped our required version to iOS 9.2 and passed review no problem. Now we're having an issue with dual-stack UDP sockets, that stop working with IPv4 peers after the application switches to background mode (... but only on WiFi? who the hell knows. loving background mode). loving IPv6

By the way, you can implement address synthesis yourself if you need to support <9.2, the protocol is RFC 7050. I did it before we opted to require 9.2, it's not super hard, just full of annoying heuristics to distinguish between DNS64 and things like captive portals

hackbunny posted:

We bumped our required version to iOS 9.2 and passed review no problem. Now we're having an issue with dual-stack UDP sockets, that stop working with IPv4 peers after the application switches to background mode (... but only on WiFi? who the hell knows. loving background mode). loving IPv6

By the way, you can implement address synthesis yourself if you need to support <9.2, the protocol is RFC 7050. I did it before we opted to require 9.2, it's not super hard, just full of annoying heuristics to distinguish between DNS64 and things like captive portals

Thanks. We're 7.0+ unfortunately. I'll pass the RFC along to the engineer for a LoE.

Data Graham
Dec 28, 2009

📈📊🍪😋



I'm certainly doing something dumb here but I've been banging on it aimlessly for days now to no avail.

I have a tab bar app where one of the tabs leads to a regular UIViewController (A) embedded in a NavBarController, with an action that leads to a second UIViewController (B). (I'll mock up some sketches of this if necessary.)

UIViewController A has a UIScrollView in it, which I'm setting (via storyboard) to the full size of the UIView, aligned to the bottom of the nav bar and the top of the tab bar. Constraints are 0 all around.

When I follow the segue to UIViewController B and then come back to UIViewController A, there's an extra strip of padding at the top and bottom, above and below the UIScrollView—the height of the nav bar (top) and the tab bar (bottom), apparently.

These extra padding strips also appear if an orientation change is triggered. So I guess it's like every time the UIView decides it needs to repaint after the initial load, it builds in an extra doubled top and bottom padding area.

Has anyone encountered this? I feel like it must be a common gotcha.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Yes, I think if you turn off "automatically adjust scroll view insets" it might fix it. UIKit does some crazy stuff if it detects the primary subview of a view is a UIScrollView. You can also get around some of the nonsense by putting an invisible subview ahead of the scroll view in the subviews array (not kidding).

lord funk
Feb 16, 2004

Data Graham posted:

Has anyone encountered this? I feel like it must be a common gotcha.

Absolutely. People don't believe me when I say I spend more time on layout than anything else, but tab bar inserts are one of the big gotchas

Know that when you put a view controller into a navigation stack with a tab bar, the view controller's size will adjust to subtract the bottom bar. Same with the top bar - you'll have to check on the properties Ender pointed out. Also this behavior may change from iOS version to version.

I got so sick of this that I rolled my own tab bar controller, just so I could actually see where view controllers / scrollviews were being sized. Life got a lot easier.

Data Graham
Dec 28, 2009

📈📊🍪😋



Sweet! That did it.

It doesn't happen on any of my other UIView+UIScrollView pages (which are reached sequentially from B), but maybe it's because this is the first one directly linked from the NavBarController? Iunno. Anyway, thanks.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
Is there any way to detect network configuration changes on iOS that isn't SCNetworkReachability? It doesn't detect switches between WiFi networks in some cases (for example when going from a regular WiFi to an IPv6-only NAT64 network)

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
Found it! I can use notify_register_dispatch on the kNotifySCNetworkChange event. Hoping it isn't banned

Data Graham
Dec 28, 2009

📈📊🍪😋



Suppose I were to do my layout manually by setting frames, after a view is loaded. Where is the best place to do this?

Specifically, I have a UIView with a UITableView in it. The table view is loading its data from an array, and I want to set the table size to fit its contents, then position some stuff so it appears right below the table, then resize the container view to fit all that content.

But if I do it in viewDidLoad, the frames all have zero size at the time I go to make my frame transformations. But if I try to hook into some method like cellForRowAtIndexPath, for one thing it feels really wrong because it's getting called a bunch of times (once per row), and for another it leaves my view in a weird and wrong layout, but if I click/tap around on it haphazardly for a few seconds it repaints and puts everything where it's supposed to go.

So my assumption is that I need to be doing my layout fuckery at some single point in time after the table view has been loaded; but if there's an equivalent to viewDidLoad for UITableViews I don't know about it.

Or it there some better way to do this generally?

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do
You're looking for layoutSubviews().

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Or maybe viewDidLayoutSubviews

Data Graham
Dec 28, 2009

📈📊🍪😋



Hum... both are interesting, but seem to be leading in different directions.

viewDidLayoutSubviews gives me the same behavior as if I put the frame-bashing code in viewDidLoad.

For layoutSubviews(), I'm subclassing my UIView, which is fine; now I need to manipulate the subviews within my subclass (either that or create a protocol for my ViewController to implement I guess?). Which means I'm doing something like this:

code:
-(void)layoutSubviews {
    [super layoutSubviews];
    
    for (UIView *subview in self.subviews) {
        if ([subview isKindOfClass:[UITableView class]]) {
            CGRect fooTableFrame = subview.frame;
            fooTableFrame.size.height = subview.contentSize.height;

             dispatch_async(dispatch_get_main_queue(), ^{
                 [subview setFrame:fooTableFrame];
             });
        }
    }
}
But because subview is a UIView and not a UITableView, it doesn't know about contentSize and barfs. This is more a basics thing I know, but do I need to manually instantiate a UITableView from subview so I can work with it on the basis of its table-specific properties? I'm not sure how/whether I should do that.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Data Graham posted:

Hum... both are interesting, but seem to be leading in different directions.

viewDidLayoutSubviews gives me the same behavior as if I put the frame-bashing code in viewDidLoad.

For layoutSubviews(), I'm subclassing my UIView, which is fine; now I need to manipulate the subviews within my subclass (either that or create a protocol for my ViewController to implement I guess?). Which means I'm doing something like this:

code:
-(void)layoutSubviews {
    [super layoutSubviews];
    
    for (UIView *subview in self.subviews) {
        if ([subview isKindOfClass:[UITableView class]]) {
            CGRect fooTableFrame = subview.frame;
            fooTableFrame.size.height = subview.contentSize.height;

             dispatch_async(dispatch_get_main_queue(), ^{
                 [subview setFrame:fooTableFrame];
             });
        }
    }
}
But because subview is a UIView and not a UITableView, it doesn't know about contentSize and barfs. This is more a basics thing I know, but do I need to manually instantiate a UITableView from subview so I can work with it on the basis of its table-specific properties? I'm not sure how/whether I should do that.

Any reason you're not using IB and Autolayout? Like, I get doing things manually for things that need super performance or are really really unique, but it works well for things like this.

Data Graham
Dec 28, 2009

📈📊🍪😋



Well I mean I thought I was, but I have to resize the table manually once it's loaded its data, right? And once I do that it doesn't trigger any of the autolayout stuff, everything else that's stuck around it via constraints just stays put.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Data Graham posted:

Well I mean I thought I was, but I have to resize the table manually once it's loaded its data, right? And once I do that it doesn't trigger any of the autolayout stuff, everything else that's stuck around it via constraints just stays put.

Not necessarily.

It sounds like you want a footer view anchored to the bottom of your screen with a UITableView anchored to the top of your UIView (as well as the leading and trailing margins) and the of the bottom of UITableView anchored to the top of the footer view.

With those constraints set up, your UITableView's frame will always be the correct size, and it'll update it's contentSize to enable scrolling if needed.

Data Graham
Dec 28, 2009

📈📊🍪😋



Kinda. This is what I'm trying to have happen:



I want the table view to auto-size to the right number of cells after loading the data; and I want the box containing the table view to adjust to the size of the table view + the text following it, and I want the text to hug the bottom of the table view. And I want the following container view to keep the vertical gutter spacing constant with the view above it.

I found some stuff about hooking up an outlet to the table view height constraint, though; so I'll try that once I'm home and not photoshoppin' on the train

Doc Block
Apr 15, 2003
Fun Shoe
Sounds like you should set the tableView's height compression resistance priority to be lower than the content hugging priority. Maybe set the vertical content hugging priority to max (1000). For the text, either give the table view a footer view or have another view pegged to the bottom of the table view, depending on whether or not the table view takes the height of its footer view into account when shrinking vertically to match the content size.

Then, depending on which option you went with for the text at the bottom of the table view, either peg the top of the following view to the bottom of the table view or the bottom of the text view.

You'll probably have to adjust various priorities to make sure the bottom view isn't pulling down the table view or the text view, etc.

Doc Block fucked around with this message at 00:21 on Jun 10, 2016

Data Graham
Dec 28, 2009

📈📊🍪😋



Okay, the table footer view approach seems to work well for getting the text to hug the table. But now the issue is making the containing view grow and shrink with the size of the table.

I'm not sure how I'm supposed to do it, but what would seem natural to me is for the pin tool to allow me to pin the bottom edge of the containing view to the object inside it (the table view). But it doesn't seem to do that; it only pins to objects outside it.

I've been experimenting with the hugging/compression resistance priorities but nothing seems to affect it or make the containing view respond to the table view inside it.

Is doing it in code (like the 14-vote answer here) the only way to accomplish this? I hope not, because then I'm back to trying to hook into an event that fires after the table has finished loading.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
Maybe try going the other way, pinning the top & bottom of the table view to its containing view.

As one of the comments to the 14-vote answer says, if the inner views have an intrinsic size and are pinned to the top and bottom of their containing view, the containing view will hug its contents.

Don't forget to adjust compression and hugging values.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply