Przeglądaj źródła

fixes various Swift 3.0 depreciation warnings

Tobias Herrmann 9 lat temu
rodzic
commit
66f5db3d74
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      SwiftyMarkdown/SwiftyMarkdown.swift

+ 4 - 3
SwiftyMarkdown/SwiftyMarkdown.swift

@@ -139,7 +139,7 @@ public class SwiftyMarkdown {
 		
 		
 		var skipLine = false
 		var skipLine = false
 		for theLine in lines {
 		for theLine in lines {
-			lineCount++
+			lineCount += 1
 			if skipLine {
 			if skipLine {
 				skipLine = false
 				skipLine = false
 				continue
 				continue
@@ -291,7 +291,7 @@ public class SwiftyMarkdown {
 		while matchedCharacters.containsString("\\") {
 		while matchedCharacters.containsString("\\") {
 			if let hasRange = matchedCharacters.rangeOfString("\\") {
 			if let hasRange = matchedCharacters.rangeOfString("\\") {
 				
 				
-				let newRange  = Range(start: hasRange.startIndex, end: hasRange.endIndex.advancedBy(1))
+				let newRange  = hasRange.startIndex...hasRange.endIndex
 				foundCharacters = foundCharacters + matchedCharacters.substringWithRange(newRange)
 				foundCharacters = foundCharacters + matchedCharacters.substringWithRange(newRange)
 
 
 				matchedCharacters.removeRange(newRange)
 				matchedCharacters.removeRange(newRange)
@@ -306,9 +306,10 @@ public class SwiftyMarkdown {
 	
 	
 	// Make H1
 	// Make H1
 	
 	
-	func attributedStringFromString(string : String, withStyle style : LineStyle, var attributes : [String : AnyObject] = [:] ) -> NSAttributedString {
+	func attributedStringFromString(string : String, withStyle style : LineStyle, attributes : [String : AnyObject] = [:] ) -> NSAttributedString {
 		let textStyle : String
 		let textStyle : String
 		var fontName : String?
 		var fontName : String?
+        var attributes = attributes
 
 
 		// What type are we and is there a font name set?
 		// What type are we and is there a font name set?