Skip to content

Commit

Permalink
Update to Swift 3. (#18)
Browse files Browse the repository at this point in the history
* Update to Swift 3.

* Remove outdated cocoapods installation override.

* Manually install current version of cocoapods.

* Bump pod version.
  • Loading branch information
nickmshelley authored and SerenadeX committed Nov 4, 2016
1 parent 5b959f8 commit 7aa13e9
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ notifications:
slack: lyokotech:7AmemNHORB2ShidELPFrYeUO
email: false
before_install:
- gem install cocoapods -v '1.1.0.rc.2'
- gem install cocoapods -v '1.1.1'
script:
- set -o pipefail && xcodebuild clean build -workspace Example/RichTextVC-iOS-Example.xcworkspace -scheme RichTextVC-iOS-Example -sdk iphonesimulator -destination 'OS=9.3,name=iPhone 5,platform=iOS Simulator' | xcpretty
- pod lib lint
9 changes: 7 additions & 2 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Example/RichTextVC-iOS-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@
TargetAttributes = {
5959A6811CCAA4CC005031E6 = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
LastSwiftMigration = 0810;
};
5959A6951CCAA4CC005031E6 = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0800;
LastSwiftMigration = 0810;
TestTargetID = 5959A6811CCAA4CC005031E6;
};
};
Expand Down Expand Up @@ -472,7 +472,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lyokotech.RichTextVC-iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -487,7 +487,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.lyokotech.RichTextVC-iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -500,7 +500,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.lyokotech.RichTextVC-iOS-ExampleUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = "RichTextVC-iOS-Example";
};
name = Debug;
Expand All @@ -515,7 +515,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.lyokotech.RichTextVC-iOS-ExampleUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = "RichTextVC-iOS-Example";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5959A6951CCAA4CC005031E6"
BuildableName = "RichTextVC-iOS-Tests.xctest"
BlueprintName = "RichTextVC-iOS-Tests"
ReferencedContainer = "container:RichTextVC-iOS-Example.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
Expand Down
12 changes: 6 additions & 6 deletions Example/RichTextVC-iOS-Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication) {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

Expand Down
2 changes: 1 addition & 1 deletion RichTextVC-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "RichTextVC-iOS"
s.version = "1.5.1"
s.version = "2.0.0"
s.summary = "A Rich Text ViewController for iOS."

# This description is used to generate tags and improve search results.
Expand Down
12 changes: 6 additions & 6 deletions src/Classes/NSRange+Extras.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ extension NSRange {
return location + length
}

func containsEntireRange(range: NSRange) -> Bool {
func containsEntireRange(_ range: NSRange) -> Bool {
return containsBeginningOfRange(range) && containsEndOfRange(range)
}

func containedInRange(range: NSRange) -> Bool {
func containedInRange(_ range: NSRange) -> Bool {
return range.containsEntireRange(self)
}

func containsEndOfRange(range: NSRange) -> Bool {
func containsEndOfRange(_ range: NSRange) -> Bool {
return length > 0 && location <= range.endLocation && range.endLocation < endLocation
}

func containsBeginningOfRange(range: NSRange) -> Bool {
func containsBeginningOfRange(_ range: NSRange) -> Bool {
return length > 0 && location <= range.location && endLocation >= range.location
}

func comesBeforeRange(range: NSRange) -> Bool {
func comesBeforeRange(_ range: NSRange) -> Bool {
return endLocation <= range.location
}

func comesAfterRange(range: NSRange) -> Bool {
func comesAfterRange(_ range: NSRange) -> Bool {
return range.comesBeforeRange(self)
}

Expand Down

0 comments on commit 7aa13e9

Please sign in to comment.