Top "Swift-playground" questions

Swift Playgrounds are interactive design environments that evaluate code as you write it.

Making my function calculate average of array Swift

I want my function to calculate the average of my Double type array. The array is called "votes". For now, …

arrays function swift swift-playground
Iterate through a String Swift 2.0

I am trying to do a very simple piece of code in Swift playgrounds. var word = "Zebra" for i in …

swift swift-playground swift2 xcode7
Can Swift playgrounds see other source files in the same project?

I created the most simple custom class in a separate Swift file in my project: class Foo { init() { println("I …

swift xcode directory swift-playground
Playgrounds for Objective-C

Is it at all possible to have Xcode create a .playground file for Objective-C instead of Swift? Are there any …

objective-c xcode swift-playground
Debug breakpoint in Swift Playground?

I'm trying to add a breakpoint in the line # gutter, but no breakpoint is added when I do this in …

swift xcode6 swift-playground
Use of undeclared type 'UIImage' in Swift

On using this function in swift and i am getting compiler error. Function is: class func imageWithImage (imageToResize : UIImage, scaledToSize …

ios uiimage swift cgfloat swift-playground
Read file in swift, iOS playground

Having searched through the many (many!) swift playground questions to even craft this code, I'm still struggling. I've placed a …

ios xcode swift swift-playground
How do you prevent Xcode 7 Playgrounds from automatically running?

I'm working on an Xcode 7 Playground that has many things running at once. Whenever I make an edit, it refreshes, …

ios xcode swift refresh swift-playground
How to use cocoapods with playground?

I am trying out some pods before I implement it with my main project I want to make sure it …

ios xcode swift cocoapods swift-playground
How to write method to calculate average in Swift-playground

In swift I'm trying to write a method to calculate the average. Using the method below if i type average(5,10,15) …

swift swift-playground