Skip to content

Commit

Permalink
Updated to Swift 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
xoudini committed Nov 27, 2017
1 parent 0f4f582 commit 0473df7
Show file tree
Hide file tree
Showing 8 changed files with 300 additions and 281 deletions.
16 changes: 9 additions & 7 deletions Emojica.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
objects = {

/* Begin PBXBuildFile section */
37009FBB1DF1F5CC00AE002E /* EmojiHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37009FBA1DF1F5CC00AE002E /* EmojiHandler.swift */; };
3755AE1D1DDF99F5007E5EBF /* Emojica.h in Headers */ = {isa = PBXBuildFile; fileRef = 3755AE1B1DDF99F5007E5EBF /* Emojica.h */; settings = {ATTRIBUTES = (Public, ); }; };
3755AE251DDF9A79007E5EBF /* Emojica.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3755AE241DDF9A79007E5EBF /* Emojica.swift */; };
3755AE3D1DDF9C09007E5EBF /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3755AE3C1DDF9C09007E5EBF /* Extensions.swift */; };
37692A271FCC9F2100E9E15B /* Utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37692A261FCC9F2100E9E15B /* Utility.swift */; };
37CF90141DE4DF5400FAE008 /* Unicode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CF90131DE4DF5400FAE008 /* Unicode.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
37009FBA1DF1F5CC00AE002E /* EmojiHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmojiHandler.swift; sourceTree = "<group>"; };
3755AE181DDF99F5007E5EBF /* Emojica.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Emojica.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3755AE1B1DDF99F5007E5EBF /* Emojica.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Emojica.h; sourceTree = "<group>"; };
3755AE1C1DDF99F5007E5EBF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3755AE241DDF9A79007E5EBF /* Emojica.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Emojica.swift; sourceTree = "<group>"; };
3755AE3C1DDF9C09007E5EBF /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
37692A261FCC9F2100E9E15B /* Utility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utility.swift; sourceTree = "<group>"; };
37CF90131DE4DF5400FAE008 /* Unicode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unicode.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -55,9 +55,9 @@
isa = PBXGroup;
children = (
3755AE241DDF9A79007E5EBF /* Emojica.swift */,
37009FBA1DF1F5CC00AE002E /* EmojiHandler.swift */,
3755AE3C1DDF9C09007E5EBF /* Extensions.swift */,
37CF90131DE4DF5400FAE008 /* Unicode.swift */,
37692A261FCC9F2100E9E15B /* Utility.swift */,
3755AE231DDF9A45007E5EBF /* Supporting Files */,
);
path = Source;
Expand Down Expand Up @@ -115,7 +115,7 @@
TargetAttributes = {
3755AE171DDF99F5007E5EBF = {
CreatedOnToolsVersion = 8.1;
LastSwiftMigration = 0810;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -152,10 +152,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
37692A271FCC9F2100E9E15B /* Utility.swift in Sources */,
3755AE251DDF9A79007E5EBF /* Emojica.swift in Sources */,
3755AE3D1DDF9C09007E5EBF /* Extensions.swift in Sources */,
37CF90141DE4DF5400FAE008 /* Unicode.swift in Sources */,
37009FBB1DF1F5CC00AE002E /* EmojiHandler.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -291,7 +291,8 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -310,7 +311,8 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xoudini.Emojica;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
TargetAttributes = {
37CF8FF31DE3B42600FAE008 = {
CreatedOnToolsVersion = 8.1;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -358,7 +359,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xoudini.EmojicaExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -372,7 +374,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xoudini.EmojicaExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@
"idiom" : "ipad",
"filename" : "Icon-83,[email protected]",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
8 changes: 4 additions & 4 deletions Example/EmojicaExample/Files/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ViewController: UIViewController, UITextViewDelegate {
let emojica = Emojica()

// MARK: - Modifiable values
lazy var font = UIFont.systemFont(ofSize: 28, weight: UIFontWeightThin)
lazy var font = UIFont.systemFont(ofSize: 28, weight: UIFont.Weight.thin)
lazy var images: Emojica.ImageSet = .default

// MARK: - Usage of convert
Expand Down Expand Up @@ -84,7 +84,7 @@ extension ViewController {
NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillChangeFrame(_:)), name: .UIKeyboardWillChangeFrame, object: nil)
self.set(imageSet: images)
textView.delegate = self
textView.text = "Write here \u{1f609}"
textView.text = "\u{1f609}\u{1f1f3}\u{1f1f3}\u{1f1f4}\u{1f1f2} \u{23}\u{fe0f}\u{20e3} \u{2640}\u{fe0e} é \u{32}\u{fe0f}"//"Write here \u{1f609}"
textView.font = font
emojica.font = font
emojica.revertible = true
Expand All @@ -95,15 +95,15 @@ extension ViewController {
self.imageSet.title = emojica.imageSet.rawValue
}

func keyboardWillHide(_ notification: NSNotification) {
@objc func keyboardWillHide(_ notification: NSNotification) {
if let info = notification.userInfo {
let animationTime = info[UIKeyboardAnimationDurationUserInfoKey] as! TimeInterval
bottom.constant = 0
UIView.animate(withDuration: animationTime, animations: { self.view.layoutIfNeeded() })
}
}

func keyboardWillChangeFrame(_ notification: NSNotification) {
@objc func keyboardWillChangeFrame(_ notification: NSNotification) {
if let info = notification.userInfo {
let animationTime = info[UIKeyboardAnimationDurationUserInfoKey] as! TimeInterval
let endFrame = (info[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
Expand Down
85 changes: 0 additions & 85 deletions Source/EmojiHandler.swift

This file was deleted.

Loading

0 comments on commit 0473df7

Please sign in to comment.