Skip to content

Commit

Permalink
Update Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
wfltaylor committed Apr 6, 2019
1 parent 40751b2 commit 834f319
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 9 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 6 additions & 2 deletions GlitchLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
9C83B74922596E3C00324A23 /* GlitchLabel.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 9C83B74822596E3C00324A23 /* GlitchLabel.podspec */; };
B64C3BE31CD0801700D91D98 /* GlitchLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B64C3BE11CD0801700D91D98 /* GlitchLabel.h */; settings = {ATTRIBUTES = (Public, ); }; };
B64C3BE41CD0801700D91D98 /* GlitchLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64C3BE21CD0801700D91D98 /* GlitchLabel.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
9C83B74822596E3C00324A23 /* GlitchLabel.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GlitchLabel.podspec; sourceTree = "<group>"; };
B64C3BB61CD07C5B00D91D98 /* GlitchLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GlitchLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B64C3BE11CD0801700D91D98 /* GlitchLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlitchLabel.h; path = Sources/GlitchLabel.h; sourceTree = SOURCE_ROOT; };
B64C3BE21CD0801700D91D98 /* GlitchLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GlitchLabel.swift; path = Sources/GlitchLabel.swift; sourceTree = SOURCE_ROOT; };
Expand All @@ -32,6 +34,7 @@
B64C3BAC1CD07C5B00D91D98 = {
isa = PBXGroup;
children = (
9C83B74822596E3C00324A23 /* GlitchLabel.podspec */,
B64C3BB81CD07C5B00D91D98 /* GlitchLabel */,
B64C3BB71CD07C5B00D91D98 /* Products */,
);
Expand Down Expand Up @@ -125,6 +128,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9C83B74922596E3C00324A23 /* GlitchLabel.podspec in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -272,7 +276,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -291,7 +295,7 @@
PRODUCT_BUNDLE_IDENTIFIER = kciter.GlitchLabel;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
13 changes: 11 additions & 2 deletions Sample/GlitchLabel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@
TargetAttributes = {
B67E4C571CC9C51500B04CDA = {
CreatedOnToolsVersion = 7.3;
DevelopmentTeam = 5RTMJNH82H;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
};
};
};
Expand All @@ -116,6 +118,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -268,12 +271,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5RTMJNH82H;
INFOPLIST_FILE = GlitchLabel/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = kciter.GlitchLabel;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "7325859d-4e0c-4f8b-98aa-73a3c93a95a2";
SWIFT_VERSION = 4.0;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -282,12 +288,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5RTMJNH82H;
INFOPLIST_FILE = GlitchLabel/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = kciter.GlitchLabel;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "7325859d-4e0c-4f8b-98aa-73a3c93a95a2";
SWIFT_VERSION = 4.0;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sample/GlitchLabel/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/GlitchLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ open class GlitchLabel: UILabel {
UIGraphicsBeginImageContextWithOptions(rect.size, false, UIScreen.main.scale)
text?.draw(in: rect, withAttributes: [
NSAttributedString.Key.font: UIFont.init(name: font.fontName, size: font.pointSize)!,
NSAttributedStringKey.foregroundColor: UIColor.red
NSAttributedString.Key.foregroundColor: UIColor.red
])

let redImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
Expand All @@ -146,7 +146,7 @@ open class GlitchLabel: UILabel {
UIGraphicsBeginImageContextWithOptions(rect.size, false, UIScreen.main.scale)
text?.draw(in: rect, withAttributes: [
NSAttributedString.Key.font: UIFont.init(name: font.fontName, size: font.pointSize)!,
NSAttributedStringKey.foregroundColor: UIColor.green
NSAttributedString.Key.foregroundColor: UIColor.green
])
let greenImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
Expand All @@ -158,7 +158,7 @@ open class GlitchLabel: UILabel {
UIGraphicsBeginImageContextWithOptions(rect.size, false, UIScreen.main.scale)
text?.draw(in: rect, withAttributes: [
NSAttributedString.Key.font: UIFont.init(name: font.fontName, size: font.pointSize)!,
NSAttributedStringKey.foregroundColor: UIColor.blue
NSAttributedString.Key.foregroundColor: UIColor.blue
])

let blueImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
Expand All @@ -185,7 +185,7 @@ open class GlitchLabel: UILabel {
userInfo: nil,
repeats: true)

RunLoop.current.add(timer, forMode: RunLoop.Mode.defaultRunLoopMode)
RunLoop.current.add(timer, forMode: RunLoop.Mode.default)
}

fileprivate func random() -> Double {
Expand Down

0 comments on commit 834f319

Please sign in to comment.