Re: [swift-users] stack trace of Swift executable

2017-04-28 Thread Josh Parmenter via swift-users
Thanks for articulating this. It is something I have also found somewhat 
frustrating.

Is there anything that could be done to make swift stack traces more 
informative? Obj-C traces were very clear. I’d love to get back to that level 
again.
Best,
Josh



Joshua Parmenter | Software Development

T 248 777 
C 206 437 1551
F 248 616 1980
www.vectorform.com

Vectorform
2107 Elliott Ave Suite 303
Seattle, WA  98121 USA

Think Tank. Lab. Studio.
We invent digital products and experiences.

SEATTLE | DETROIT | NEW YORK | MUNICH | HYDERABAD

On Apr 28, 2017, at 2:28 PM, Nick Snyder via swift-users 
> wrote:

I have a simple main.swift that looks like this:

```
print("Hello, world!")
let x: String? = nil

func say(message: String?) {
print(x!) // intentional crash
}

say(message: x)
```

Running this results in the crash

```
$ swift build && ./.build/debug/hello
Hello, world!
fatal error: unexpectedly found nil while unwrapping an Optional value
Current stack trace:
0libswiftCore.dylib 0x000110120130 swift_reportError + 
129
1libswiftCore.dylib 0x00011013cb50 
_swift_stdlib_reportFatalError + 60
2libswiftCore.dylib 0x00010ff2d250 specialized 
specialized StaticString.withUTF8Buffer ((UnsafeBufferPointer) -> A) 
-> A + 342
3libswiftCore.dylib 0x0001100a7e90 partial apply for 
(_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : 
UInt, flags : UInt32) -> Never).(closure #2) + 109
4libswiftCore.dylib 0x00010ff2d250 specialized 
specialized StaticString.withUTF8Buffer ((UnsafeBufferPointer) -> A) 
-> A + 342
5libswiftCore.dylib 0x00011005a9a0 specialized 
_fatalErrorMessage(StaticString, StaticString, file : StaticString, line : 
UInt, flags : UInt32) -> Never + 96
6hello  0x00010fee6200 main + 345
7libdyld.dylib  0x7fffe0375234 start + 1
Illegal instruction: 4
```

From the crash, how do I map back line 6 to an actual line in main.swift?
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Importing C system libraries

2017-03-27 Thread Josh Parmenter via swift-users
On Mar 27, 2017, at 2:10 PM, Jan Neumüller via swift-users 
 wrote:
> 
> Is it just me, or is Swift moving to much in a command line direction since 
> the open sourcing? I feel being left behind as an Xcode user...
> 
> Jan
> 


you can specify flags in Xcode - Xcode basically just wraps around command line 
tools anyways for the most part (when it comes to compiling)
Best,
Josh

>> On 27 Mar 2017, at 22:59, Michael Ilseman via swift-users 
>>  wrote:
>> 
>> Sure. At a low level, you can create a module.map file and use -L/-l flags 
>> in your invocation of Swift. If you want to do so at a higher level, then 
>> perhaps SwiftPM can. CCing swift-build-dev for the SwiftPM part.
>> 
>> 
>>> On Mar 26, 2017, at 3:20 PM, Kelvin Ma via swift-users 
>>>  wrote:
>>> 
>>> Idk if this has been asked before, but is there a way to import C libraries 
>>> into a Swift project without creating a local git repo? Preferably 
>>> something similar to C where you can just `#include` headers and then 
>>> specify the link flags (in Package.swift?) 
>>> 
>>> It’s getting very cumbersome to make a bunch of empty git repos just to use 
>>> libglfw or libcairo.
>>> ___
>>> swift-users mailing list
>>> swift-users@swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-users
>> 
>> ___
>> swift-users mailing list
>> swift-users@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Importing C system libraries

2017-03-27 Thread Josh Parmenter via swift-users
On Mar 27, 2017, at 2:10 PM, Jan Neumüller via swift-users 
 wrote:
> 
> Is it just me, or is Swift moving to much in a command line direction since 
> the open sourcing? I feel being left behind as an Xcode user...
> 
> Jan
> 


you can specify flags in Xcode - Xcode basically just wraps around command line 
tools anyways for the most part (when it comes to compiling)
Best,
Josh

>> On 27 Mar 2017, at 22:59, Michael Ilseman via swift-users 
>>  wrote:
>> 
>> Sure. At a low level, you can create a module.map file and use -L/-l flags 
>> in your invocation of Swift. If you want to do so at a higher level, then 
>> perhaps SwiftPM can. CCing swift-build-dev for the SwiftPM part.
>> 
>> 
>>> On Mar 26, 2017, at 3:20 PM, Kelvin Ma via swift-users 
>>>  wrote:
>>> 
>>> Idk if this has been asked before, but is there a way to import C libraries 
>>> into a Swift project without creating a local git repo? Preferably 
>>> something similar to C where you can just `#include` headers and then 
>>> specify the link flags (in Package.swift?) 
>>> 
>>> It’s getting very cumbersome to make a bunch of empty git repos just to use 
>>> libglfw or libcairo.
>>> ___
>>> swift-users mailing list
>>> swift-users@swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-users
>> 
>> ___
>> swift-users mailing list
>> swift-users@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] App Review

2017-01-23 Thread Josh Parmenter via swift-users
I’m not sure if this is the best forum for this question, since this list is 
geared towards the usage of Swift, not with Apple App Store development. 

The guidelines can be strict. Have you asked to speak directly with someone 
through the developer portal?

Hope that helps.
Josh


> On Jan 23, 2017, at 7:13 AM, James Stacy via swift-users 
>  wrote:
> 
> I have been working on an app for two years and now have been trying to get 
> it reviewed.
> Apple will not review my app. They delay keep it in waiting for review. When 
> it finally gets in review they kick it out on.
> You are using location when not in use. (Yes I track the location so it can 
> be displayed on the company map) I had to change it.
> 
> Then there was a mismatch on the in app purchase (My Fault)
> 
> They then later kicked me out saying they could not find in app purchase. (I 
> have a built in help video showing where it is.)
> They were able to find one tim and then not later. I did not move it.
> 
> What are they really doing? 
> 
> Has anyone else had long delays. I mean the changes to swift lost me two 
> months how much time of mine are they wanting to waist?
> 
> Last thing, I was reading where apple stole ideals from developers, Is that 
> true?
> 
> I have requested a expeditetwice but have been rejected. I have a planned 
> event on Feb 1st. So that looking bad. 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] @objc and private methods

2016-07-21 Thread Josh Parmenter via swift-users
Is this a bug? I think this is more a question of what is best practice.
Best,
Josh

On Jul 21, 2016, at 10:48 AM, Zhao Xin via swift-users 
> wrote:

Then you should file a bug.

Zhaoxin

On Fri, Jul 22, 2016 at 1:03 AM, Tod Cunningham 
> wrote:
If Test and Test2 are in separate files, swift doesn’t allow you to do the 
override as it “can’t see” the definition of the private method in Test.


From: Zhao Xin >
Date: Thursday, July 21, 2016 at 11:06 AM
To: Tod Cunningham 
>
Cc: "swift-users@swift.org" 
>
Subject: Re: [swift-users] @objc and private methods

I think @objc makes the function an Objective-C function, so the private is no 
longer making the function private in Swift way, but in Objective-C way. In 
C++,  sub-class can call super-class's private method. What you have to do is 
to override the function.


class Test {

@objc private func somefunc() {

print( "hello 1" )

}

}



class Test2: Test {

@objc override private func somefunc() {

print( "hello 2" )

}

}



Zhaoxin





On Thu, Jul 21, 2016 at 10:25 PM, Tod Cunningham via swift-users 
>>
 wrote:
I wanted to get thoughts on the use of @objc and private methods.  Should this 
usage be avoided or leveraged?

I have seen some code where things like UIButton and Gesture recognizer 
handlers are defined as being private.  I would have thought this would result 
in a compiler error given objective-c doesn’t support private accessors.  
However, it compiles and works as expected (kind of).

One plus for defining the handlers as private is they aren’t visible to swift 
outside of the file they are defined in.  The problem is you can run into some 
issues with inheritance if you define the same handler in a derived class.  
Take the following simple example:

class Test {
@objc private func somefunc() {
print( "hello 1" )
}
}

-- in another file –

class Test2: Test {
@objc private func somefunc() {
print( "hello 2" )
}
}

This will result in the following compiler error:

Method 'somefunc()' with Objective-C selector 'somefunc' conflicts with method 
'somefunc()' from superclass 'Test' with the same Objective-C selector

That error makes sense in an Objective-C context as Test2 has two different 
methods defined with the same objective-c selector (somefunc).  Swift can tell 
them apart as they are private to each class, but Obj-C can’t tell them apart 
as they have the same selector thus the error.

One workaround would be to give the method a different Objective-C names such 
as @objc(test2_somefunc); however, that could really lead to some unexpected 
results depending on what selector is used to call somefunc.  Test2 would need 
to “register” a different selector for somefunc then Test does for whatever is 
calling it on the Objective-C side (yuck!).

This can of course be solved by not making the method private which allows 
Test2 to explicitly override somefunc.

class Test {
   @objc func somefunc() {
   print( "hello 1" )
   }
}

-- in another file –

class Test2: Test {
   @objc override func somefunc() {
   print( "hello 2" )
   }
}

I would say that when declaring @objc methods they shouldn’t be private and 
should have the same (public/internal) access method as their containing class. 
 What’s your thoughts?  Why does swift allow a method to be declared as both 
@objc and private?

Thanks,



___
swift-users mailing list
swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users


___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users