Skip to content

Commit

Permalink
Updated code to Swift 2.2
Browse files Browse the repository at this point in the history
Xcode 7.3 update
  • Loading branch information
analogcode committed Mar 27, 2016
1 parent 444e059 commit c5b5364
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>2C5545B91C1124DE00728469</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9409E1151ABF6FEA00312E2B</key>
<dict>
<key>primary</key>
Expand Down
2 changes: 1 addition & 1 deletion SwiftRadio/AnimationFrames.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AnimationFrames {
}
}

for (var i = 2; i > 0; i--) {
for i in 2.stride(to: 0, by: -1) {
if let image = UIImage(named: "NowPlayingBars-\(i)") {
animationFrames.append(image)
}
Expand Down
6 changes: 3 additions & 3 deletions SwiftRadio/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kdl-ej-Zz5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="kdl-ej-Zz5">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand All @@ -29,7 +29,7 @@
<rect key="frame" x="0.0" y="22" width="320" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hMr-La-1Ga" id="NhW-Qy-GCO">
<rect key="frame" x="0.0" y="0.0" width="320" height="87"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="87.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="stationImage" translatesAutoresizingMaskIntoConstraints="NO" id="GQm-Mf-6pw">
Expand Down
2 changes: 1 addition & 1 deletion SwiftRadio/Libraries/Spring/KeyboardLayoutConstraint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class KeyboardLayoutConstraint: NSLayoutConstraint {
offset = constant

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(KeyboardLayoutConstraint.keyboardWillShowNotification(_:)), name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillHideNotification:", name: UIKeyboardWillHideNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(KeyboardLayoutConstraint.keyboardWillHideNotification(_:)), name: UIKeyboardWillHideNotification, object: nil)
}

deinit {
Expand Down
2 changes: 1 addition & 1 deletion SwiftRadio/Libraries/Spring/Misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public func randomStringWithLength (len : Int) -> NSString {

let randomString : NSMutableString = NSMutableString(capacity: len)

for (var i=0; i < len; i++){
for _ in 0..<len {
let length = UInt32 (letters.length)
let rand = arc4random_uniform(length)
randomString.appendFormat("%C", letters.characterAtIndex(Int(rand)))
Expand Down
2 changes: 1 addition & 1 deletion SwiftRadio/Libraries/SwiftyJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public struct JSONGenerator : GeneratorType {
switch self.type {
case .Array:
if let o = self.arrayGenerate!.next() {
return (String(self.arrayIndex++), JSON(o))
return (String(self.arrayIndex += 1), JSON(o))
} else {
return nil
}
Expand Down

0 comments on commit c5b5364

Please sign in to comment.