Repository: k-lpmg/AwaitToast Branch: master Commit: d86462c9ecfa Files: 61 Total size: 115.5 KB Directory structure: gitextract_c9b95qr_/ ├── .gitignore ├── .swift-version ├── .travis.yml ├── AwaitToast.h ├── AwaitToast.podspec ├── AwaitToast.xcodeproj/ │ ├── project.pbxproj │ └── xcshareddata/ │ └── xcschemes/ │ └── AwaitToast.xcscheme ├── Example/ │ ├── Assets.xcassets/ │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── await.imageset/ │ │ │ └── Contents.json │ │ ├── egg.imageset/ │ │ │ └── Contents.json │ │ ├── exit.imageset/ │ │ │ └── Contents.json │ │ ├── longText.imageset/ │ │ │ └── Contents.json │ │ ├── toast.imageset/ │ │ │ └── Contents.json │ │ └── trash.imageset/ │ │ └── Contents.json │ ├── Base.lproj/ │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ └── Sources/ │ ├── AppDelegate.swift │ ├── Cells/ │ │ ├── ExampleTableViewCell.swift │ │ └── SettingSwitchTableViewCell.swift │ ├── Enums/ │ │ ├── AwaitExampleCellType.swift │ │ ├── DefaultExampleCellType.swift │ │ ├── ExampleCellType.swift │ │ ├── LongTextCellType.swift │ │ ├── SectionType.swift │ │ └── SettingCellType.swift │ └── ToastExampleTableViewController.swift ├── Info.plist ├── LICENSE ├── README.md └── Sources/ └── AwaitToast/ ├── Appearances/ │ ├── DefaultToastAppearance.swift │ ├── IconToastAppearance.swift │ ├── ToastAppearance.swift │ └── ToastAppearanceManager.swift ├── AwaitToast.swift ├── Behaviors/ │ ├── AwaitToastBehavior.swift │ ├── DefaultToastBehavior.swift │ ├── ToastBehavior.swift │ └── ToastBehaviorManager.swift ├── Operations/ │ ├── AwaitToastOperation.swift │ ├── DefaultToastOperation.swift │ ├── ToastDynamicDispatch.swift │ └── ToastOperation.swift ├── Toast.swift ├── ToastCompatiable.swift ├── ToastDirection.swift ├── Toasts/ │ ├── AwaitToastProducer.swift │ ├── AwaitToastView.swift │ ├── Default/ │ │ ├── AwaitDefault.swift │ │ ├── AwaitDefaultToastView.swift │ │ ├── Default.swift │ │ └── DefaultToastView.swift │ ├── DefaultToastProducer.swift │ ├── Icon/ │ │ ├── AwaitIcon.swift │ │ ├── AwaitIconToastView.swift │ │ ├── Icon.swift │ │ ├── IconImageLocation.swift │ │ └── IconToastView.swift │ └── ToastView.swift └── Utils/ ├── GlobalConstants.swift └── GlobalFunction.swift ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .DS_Store *.xcuserstate project.xcworkspace/ xcuserdata/ ================================================ FILE: .swift-version ================================================ 4.2 ================================================ FILE: .travis.yml ================================================ osx_image: xcode10.2 language: objective-c env: global: - PROJECT="AwaitToast.xcodeproj" - IOS_SDK="iphonesimulator" matrix: - SDK="$IOS_SDK" DESTINATION="platform=iOS Simulator,OS=12.2,name=iPhone X" install: - swift --version before_script: - set -o pipefail script: - xcodebuild clean build -project "$PROJECT" -scheme AwaitToast -sdk "$SDK" -destination "$DESTINATION" | xcpretty -c - xcodebuild clean build -project "$PROJECT" -scheme Example -sdk "$SDK" -destination "$DESTINATION" | xcpretty -c ================================================ FILE: AwaitToast.h ================================================ // // AwaitToast.h // AwaitToast // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // #import //! Project version number for AwaitToast. FOUNDATION_EXPORT double AwaitToastVersionNumber; //! Project version string for AwaitToast. FOUNDATION_EXPORT const unsigned char AwaitToastVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: AwaitToast.podspec ================================================ Pod::Spec.new do |s| s.name = "AwaitToast" s.version = "1.2.0" s.summary = "🍞 An async waiting toast with basic toast. Inspired by facebook posting toast." s.homepage = "https://github.com/k-lpmg/AwaitToast" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { "DongHee Kang" => "kanglpmg@gmail.com" } s.source = { :git => "https://github.com/k-lpmg/AwaitToast.git", :tag => s.version.to_s } s.documentation_url = "https://github.com/k-lpmg/AwaitToast/blob/master/README.md" s.ios.source_files = "Sources/**/*.swift" s.ios.deployment_target = "9.0" end ================================================ FILE: AwaitToast.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 651828472230099A007E54E5 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 6518284622300999007E54E5 /* README.md */; }; 6518284A22301372007E54E5 /* DefaultExampleCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518284922301372007E54E5 /* DefaultExampleCellType.swift */; }; 6518284C2230137D007E54E5 /* AwaitExampleCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518284B2230137D007E54E5 /* AwaitExampleCellType.swift */; }; 65182877223024A9007E54E5 /* ToastCompatiable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182851223024A9007E54E5 /* ToastCompatiable.swift */; }; 65182878223024A9007E54E5 /* ToastDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182852223024A9007E54E5 /* ToastDirection.swift */; }; 65182879223024A9007E54E5 /* AwaitToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182854223024A9007E54E5 /* AwaitToastView.swift */; }; 6518287A223024A9007E54E5 /* ToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182855223024A9007E54E5 /* ToastView.swift */; }; 6518287B223024A9007E54E5 /* AwaitDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182857223024A9007E54E5 /* AwaitDefault.swift */; }; 6518287C223024A9007E54E5 /* Default.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182858223024A9007E54E5 /* Default.swift */; }; 6518287D223024A9007E54E5 /* DefaultToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182859223024A9007E54E5 /* DefaultToastView.swift */; }; 6518287E223024A9007E54E5 /* AwaitDefaultToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518285A223024A9007E54E5 /* AwaitDefaultToastView.swift */; }; 6518287F223024A9007E54E5 /* AwaitToastProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518285B223024A9007E54E5 /* AwaitToastProducer.swift */; }; 65182880223024A9007E54E5 /* IconImageLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518285D223024A9007E54E5 /* IconImageLocation.swift */; }; 65182881223024A9007E54E5 /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518285E223024A9007E54E5 /* Icon.swift */; }; 65182882223024A9007E54E5 /* IconToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518285F223024A9007E54E5 /* IconToastView.swift */; }; 65182883223024A9007E54E5 /* AwaitIconToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182860223024A9007E54E5 /* AwaitIconToastView.swift */; }; 65182884223024A9007E54E5 /* AwaitIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182861223024A9007E54E5 /* AwaitIcon.swift */; }; 65182885223024A9007E54E5 /* DefaultToastProducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182862223024A9007E54E5 /* DefaultToastProducer.swift */; }; 65182886223024A9007E54E5 /* AwaitToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182863223024A9007E54E5 /* AwaitToast.swift */; }; 65182887223024A9007E54E5 /* GlobalFunction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182865223024A9007E54E5 /* GlobalFunction.swift */; }; 65182888223024A9007E54E5 /* ToastOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182867223024A9007E54E5 /* ToastOperation.swift */; }; 65182889223024A9007E54E5 /* DefaultToastOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182868223024A9007E54E5 /* DefaultToastOperation.swift */; }; 6518288B223024A9007E54E5 /* ToastDynamicDispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518286A223024A9007E54E5 /* ToastDynamicDispatch.swift */; }; 6518288C223024A9007E54E5 /* AwaitToastOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518286B223024A9007E54E5 /* AwaitToastOperation.swift */; }; 6518288D223024A9007E54E5 /* DefaultToastBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518286D223024A9007E54E5 /* DefaultToastBehavior.swift */; }; 6518288E223024A9007E54E5 /* ToastBehaviorManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518286E223024A9007E54E5 /* ToastBehaviorManager.swift */; }; 6518288F223024A9007E54E5 /* AwaitToastBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6518286F223024A9007E54E5 /* AwaitToastBehavior.swift */; }; 65182890223024A9007E54E5 /* ToastBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182870223024A9007E54E5 /* ToastBehavior.swift */; }; 65182891223024A9007E54E5 /* DefaultToastAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182872223024A9007E54E5 /* DefaultToastAppearance.swift */; }; 65182892223024A9007E54E5 /* IconToastAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182873223024A9007E54E5 /* IconToastAppearance.swift */; }; 65182893223024A9007E54E5 /* ToastAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182874223024A9007E54E5 /* ToastAppearance.swift */; }; 65182894223024A9007E54E5 /* ToastAppearanceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182875223024A9007E54E5 /* ToastAppearanceManager.swift */; }; 65182895223024A9007E54E5 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65182876223024A9007E54E5 /* Toast.swift */; }; 659E38F9222BA21A00062BDE /* AwaitToast.h in Headers */ = {isa = PBXBuildFile; fileRef = 659E38F7222BA21A00062BDE /* AwaitToast.h */; settings = {ATTRIBUTES = (Public, ); }; }; 659E3950222BA27800062BDE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 659E394F222BA27800062BDE /* Assets.xcassets */; }; 659E3953222BA27800062BDE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 659E3951222BA27800062BDE /* LaunchScreen.storyboard */; }; 65DDDD53222D50140076118E /* AwaitToast.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 659E38F4222BA21A00062BDE /* AwaitToast.framework */; }; 65DDDD54222D50140076118E /* AwaitToast.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 659E38F4222BA21A00062BDE /* AwaitToast.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 65F146752251CB5C00F7CFF6 /* LongTextCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F146742251CB5C00F7CFF6 /* LongTextCellType.swift */; }; 65F1467A2251D47E00F7CFF6 /* GlobalConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F146792251D47E00F7CFF6 /* GlobalConstants.swift */; }; 65FB9951222C40D300A75E8A /* ToastExampleTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB994C222C40D300A75E8A /* ToastExampleTableViewController.swift */; }; 65FB9952222C40D300A75E8A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB994D222C40D300A75E8A /* AppDelegate.swift */; }; 65FB995F222C412300A75E8A /* SettingCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB995C222C412300A75E8A /* SettingCellType.swift */; }; 65FB9960222C412300A75E8A /* ExampleCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB995D222C412300A75E8A /* ExampleCellType.swift */; }; 65FB9963222C41A900A75E8A /* SectionType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB9962222C41A900A75E8A /* SectionType.swift */; }; 65FB9965222C427B00A75E8A /* ExampleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB9964222C427B00A75E8A /* ExampleTableViewCell.swift */; }; 65FB9969222C438100A75E8A /* SettingSwitchTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FB9968222C438100A75E8A /* SettingSwitchTableViewCell.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 65DDDD55222D50140076118E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 659E38EB222BA21A00062BDE /* Project object */; proxyType = 1; remoteGlobalIDString = 659E38F3222BA21A00062BDE; remoteInfo = AwaitToast; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 65DDDD57222D50140076118E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 65DDDD54222D50140076118E /* AwaitToast.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 6518284622300999007E54E5 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 6518284922301372007E54E5 /* DefaultExampleCellType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultExampleCellType.swift; sourceTree = ""; }; 6518284B2230137D007E54E5 /* AwaitExampleCellType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AwaitExampleCellType.swift; sourceTree = ""; }; 65182851223024A9007E54E5 /* ToastCompatiable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastCompatiable.swift; sourceTree = ""; }; 65182852223024A9007E54E5 /* ToastDirection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastDirection.swift; sourceTree = ""; }; 65182854223024A9007E54E5 /* AwaitToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitToastView.swift; sourceTree = ""; }; 65182855223024A9007E54E5 /* ToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastView.swift; sourceTree = ""; }; 65182857223024A9007E54E5 /* AwaitDefault.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitDefault.swift; sourceTree = ""; }; 65182858223024A9007E54E5 /* Default.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Default.swift; sourceTree = ""; }; 65182859223024A9007E54E5 /* DefaultToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultToastView.swift; sourceTree = ""; }; 6518285A223024A9007E54E5 /* AwaitDefaultToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitDefaultToastView.swift; sourceTree = ""; }; 6518285B223024A9007E54E5 /* AwaitToastProducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitToastProducer.swift; sourceTree = ""; }; 6518285D223024A9007E54E5 /* IconImageLocation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IconImageLocation.swift; sourceTree = ""; }; 6518285E223024A9007E54E5 /* Icon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = ""; }; 6518285F223024A9007E54E5 /* IconToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IconToastView.swift; sourceTree = ""; }; 65182860223024A9007E54E5 /* AwaitIconToastView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitIconToastView.swift; sourceTree = ""; }; 65182861223024A9007E54E5 /* AwaitIcon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitIcon.swift; sourceTree = ""; }; 65182862223024A9007E54E5 /* DefaultToastProducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultToastProducer.swift; sourceTree = ""; }; 65182863223024A9007E54E5 /* AwaitToast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitToast.swift; sourceTree = ""; }; 65182865223024A9007E54E5 /* GlobalFunction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalFunction.swift; sourceTree = ""; }; 65182867223024A9007E54E5 /* ToastOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastOperation.swift; sourceTree = ""; }; 65182868223024A9007E54E5 /* DefaultToastOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultToastOperation.swift; sourceTree = ""; }; 6518286A223024A9007E54E5 /* ToastDynamicDispatch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastDynamicDispatch.swift; sourceTree = ""; }; 6518286B223024A9007E54E5 /* AwaitToastOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitToastOperation.swift; sourceTree = ""; }; 6518286D223024A9007E54E5 /* DefaultToastBehavior.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultToastBehavior.swift; sourceTree = ""; }; 6518286E223024A9007E54E5 /* ToastBehaviorManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastBehaviorManager.swift; sourceTree = ""; }; 6518286F223024A9007E54E5 /* AwaitToastBehavior.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AwaitToastBehavior.swift; sourceTree = ""; }; 65182870223024A9007E54E5 /* ToastBehavior.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastBehavior.swift; sourceTree = ""; }; 65182872223024A9007E54E5 /* DefaultToastAppearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultToastAppearance.swift; sourceTree = ""; }; 65182873223024A9007E54E5 /* IconToastAppearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IconToastAppearance.swift; sourceTree = ""; }; 65182874223024A9007E54E5 /* ToastAppearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastAppearance.swift; sourceTree = ""; }; 65182875223024A9007E54E5 /* ToastAppearanceManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastAppearanceManager.swift; sourceTree = ""; }; 65182876223024A9007E54E5 /* Toast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = ""; }; 659E38F4222BA21A00062BDE /* AwaitToast.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AwaitToast.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 659E38F7222BA21A00062BDE /* AwaitToast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AwaitToast.h; sourceTree = ""; }; 659E38F8222BA21A00062BDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 659E3946222BA27700062BDE /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 659E394F222BA27800062BDE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 659E3952222BA27800062BDE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 659E3954222BA27800062BDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65F146742251CB5C00F7CFF6 /* LongTextCellType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LongTextCellType.swift; sourceTree = ""; }; 65F146792251D47E00F7CFF6 /* GlobalConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalConstants.swift; sourceTree = ""; }; 65FB994C222C40D300A75E8A /* ToastExampleTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToastExampleTableViewController.swift; sourceTree = ""; }; 65FB994D222C40D300A75E8A /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 65FB995C222C412300A75E8A /* SettingCellType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingCellType.swift; sourceTree = ""; }; 65FB995D222C412300A75E8A /* ExampleCellType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleCellType.swift; sourceTree = ""; }; 65FB9962222C41A900A75E8A /* SectionType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionType.swift; sourceTree = ""; }; 65FB9964222C427B00A75E8A /* ExampleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleTableViewCell.swift; sourceTree = ""; }; 65FB9968222C438100A75E8A /* SettingSwitchTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingSwitchTableViewCell.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 659E38F1222BA21A00062BDE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 659E3943222BA27700062BDE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 65DDDD53222D50140076118E /* AwaitToast.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 651828482230135B007E54E5 /* Enums */ = { isa = PBXGroup; children = ( 6518284B2230137D007E54E5 /* AwaitExampleCellType.swift */, 6518284922301372007E54E5 /* DefaultExampleCellType.swift */, 65FB995D222C412300A75E8A /* ExampleCellType.swift */, 65F146742251CB5C00F7CFF6 /* LongTextCellType.swift */, 65FB9962222C41A900A75E8A /* SectionType.swift */, 65FB995C222C412300A75E8A /* SettingCellType.swift */, ); path = Enums; sourceTree = ""; }; 6518284F223024A9007E54E5 /* Sources */ = { isa = PBXGroup; children = ( 65182850223024A9007E54E5 /* AwaitToast */, ); path = Sources; sourceTree = ""; }; 65182850223024A9007E54E5 /* AwaitToast */ = { isa = PBXGroup; children = ( 65182863223024A9007E54E5 /* AwaitToast.swift */, 65182876223024A9007E54E5 /* Toast.swift */, 65182851223024A9007E54E5 /* ToastCompatiable.swift */, 65182852223024A9007E54E5 /* ToastDirection.swift */, 65182871223024A9007E54E5 /* Appearances */, 6518286C223024A9007E54E5 /* Behaviors */, 65182866223024A9007E54E5 /* Operations */, 65182853223024A9007E54E5 /* Toasts */, 65182864223024A9007E54E5 /* Utils */, ); path = AwaitToast; sourceTree = ""; }; 65182853223024A9007E54E5 /* Toasts */ = { isa = PBXGroup; children = ( 6518285B223024A9007E54E5 /* AwaitToastProducer.swift */, 65182854223024A9007E54E5 /* AwaitToastView.swift */, 65182862223024A9007E54E5 /* DefaultToastProducer.swift */, 65182855223024A9007E54E5 /* ToastView.swift */, 65182856223024A9007E54E5 /* Default */, 6518285C223024A9007E54E5 /* Icon */, ); path = Toasts; sourceTree = ""; }; 65182856223024A9007E54E5 /* Default */ = { isa = PBXGroup; children = ( 65182857223024A9007E54E5 /* AwaitDefault.swift */, 6518285A223024A9007E54E5 /* AwaitDefaultToastView.swift */, 65182858223024A9007E54E5 /* Default.swift */, 65182859223024A9007E54E5 /* DefaultToastView.swift */, ); path = Default; sourceTree = ""; }; 6518285C223024A9007E54E5 /* Icon */ = { isa = PBXGroup; children = ( 65182861223024A9007E54E5 /* AwaitIcon.swift */, 65182860223024A9007E54E5 /* AwaitIconToastView.swift */, 6518285E223024A9007E54E5 /* Icon.swift */, 6518285D223024A9007E54E5 /* IconImageLocation.swift */, 6518285F223024A9007E54E5 /* IconToastView.swift */, ); path = Icon; sourceTree = ""; }; 65182864223024A9007E54E5 /* Utils */ = { isa = PBXGroup; children = ( 65182865223024A9007E54E5 /* GlobalFunction.swift */, 65F146792251D47E00F7CFF6 /* GlobalConstants.swift */, ); path = Utils; sourceTree = ""; }; 65182866223024A9007E54E5 /* Operations */ = { isa = PBXGroup; children = ( 6518286B223024A9007E54E5 /* AwaitToastOperation.swift */, 65182868223024A9007E54E5 /* DefaultToastOperation.swift */, 6518286A223024A9007E54E5 /* ToastDynamicDispatch.swift */, 65182867223024A9007E54E5 /* ToastOperation.swift */, ); path = Operations; sourceTree = ""; }; 6518286C223024A9007E54E5 /* Behaviors */ = { isa = PBXGroup; children = ( 6518286F223024A9007E54E5 /* AwaitToastBehavior.swift */, 6518286D223024A9007E54E5 /* DefaultToastBehavior.swift */, 65182870223024A9007E54E5 /* ToastBehavior.swift */, 6518286E223024A9007E54E5 /* ToastBehaviorManager.swift */, ); path = Behaviors; sourceTree = ""; }; 65182871223024A9007E54E5 /* Appearances */ = { isa = PBXGroup; children = ( 65182872223024A9007E54E5 /* DefaultToastAppearance.swift */, 65182873223024A9007E54E5 /* IconToastAppearance.swift */, 65182874223024A9007E54E5 /* ToastAppearance.swift */, 65182875223024A9007E54E5 /* ToastAppearanceManager.swift */, ); path = Appearances; sourceTree = ""; }; 659E38EA222BA21A00062BDE = { isa = PBXGroup; children = ( 659E38F7222BA21A00062BDE /* AwaitToast.h */, 6518284622300999007E54E5 /* README.md */, 659E38F8222BA21A00062BDE /* Info.plist */, 6518284F223024A9007E54E5 /* Sources */, 659E3947222BA27700062BDE /* Example */, 659E38F5222BA21A00062BDE /* Products */, ); sourceTree = ""; }; 659E38F5222BA21A00062BDE /* Products */ = { isa = PBXGroup; children = ( 659E38F4222BA21A00062BDE /* AwaitToast.framework */, 659E3946222BA27700062BDE /* Example.app */, ); name = Products; sourceTree = ""; }; 659E3947222BA27700062BDE /* Example */ = { isa = PBXGroup; children = ( 65FB9949222C40D300A75E8A /* Sources */, 659E3954222BA27800062BDE /* Info.plist */, 659E394F222BA27800062BDE /* Assets.xcassets */, 659E3951222BA27800062BDE /* LaunchScreen.storyboard */, ); path = Example; sourceTree = ""; }; 65FB9949222C40D300A75E8A /* Sources */ = { isa = PBXGroup; children = ( 651828482230135B007E54E5 /* Enums */, 65FB995B222C412300A75E8A /* Cells */, 65FB994D222C40D300A75E8A /* AppDelegate.swift */, 65FB994C222C40D300A75E8A /* ToastExampleTableViewController.swift */, ); path = Sources; sourceTree = ""; }; 65FB995B222C412300A75E8A /* Cells */ = { isa = PBXGroup; children = ( 65FB9964222C427B00A75E8A /* ExampleTableViewCell.swift */, 65FB9968222C438100A75E8A /* SettingSwitchTableViewCell.swift */, ); path = Cells; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 659E38EF222BA21A00062BDE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 659E38F9222BA21A00062BDE /* AwaitToast.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 659E38F3222BA21A00062BDE /* AwaitToast */ = { isa = PBXNativeTarget; buildConfigurationList = 659E38FC222BA21A00062BDE /* Build configuration list for PBXNativeTarget "AwaitToast" */; buildPhases = ( 659E38EF222BA21A00062BDE /* Headers */, 659E38F0222BA21A00062BDE /* Sources */, 659E38F1222BA21A00062BDE /* Frameworks */, 659E38F2222BA21A00062BDE /* Resources */, ); buildRules = ( ); dependencies = ( ); name = AwaitToast; productName = AwaitToast; productReference = 659E38F4222BA21A00062BDE /* AwaitToast.framework */; productType = "com.apple.product-type.framework"; }; 659E3945222BA27700062BDE /* Example */ = { isa = PBXNativeTarget; buildConfigurationList = 659E3955222BA27800062BDE /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( 659E3942222BA27700062BDE /* Sources */, 659E3943222BA27700062BDE /* Frameworks */, 659E3944222BA27700062BDE /* Resources */, 65DDDD57222D50140076118E /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( 65DDDD56222D50140076118E /* PBXTargetDependency */, ); name = Example; productName = Example; productReference = 659E3946222BA27700062BDE /* Example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 659E38EB222BA21A00062BDE /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1010; LastUpgradeCheck = 1010; ORGANIZATIONNAME = "k-lpmg"; TargetAttributes = { 659E38F3222BA21A00062BDE = { CreatedOnToolsVersion = 10.1; }; 659E3945222BA27700062BDE = { CreatedOnToolsVersion = 10.1; LastSwiftMigration = 1010; }; }; }; buildConfigurationList = 659E38EE222BA21A00062BDE /* Build configuration list for PBXProject "AwaitToast" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 659E38EA222BA21A00062BDE; productRefGroup = 659E38F5222BA21A00062BDE /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 659E38F3222BA21A00062BDE /* AwaitToast */, 659E3945222BA27700062BDE /* Example */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 659E38F2222BA21A00062BDE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 651828472230099A007E54E5 /* README.md in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 659E3944222BA27700062BDE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 659E3953222BA27800062BDE /* LaunchScreen.storyboard in Resources */, 659E3950222BA27800062BDE /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 659E38F0222BA21A00062BDE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 6518287A223024A9007E54E5 /* ToastView.swift in Sources */, 65182887223024A9007E54E5 /* GlobalFunction.swift in Sources */, 65182885223024A9007E54E5 /* DefaultToastProducer.swift in Sources */, 6518287C223024A9007E54E5 /* Default.swift in Sources */, 65182893223024A9007E54E5 /* ToastAppearance.swift in Sources */, 65182883223024A9007E54E5 /* AwaitIconToastView.swift in Sources */, 65182877223024A9007E54E5 /* ToastCompatiable.swift in Sources */, 6518287B223024A9007E54E5 /* AwaitDefault.swift in Sources */, 6518287F223024A9007E54E5 /* AwaitToastProducer.swift in Sources */, 6518288D223024A9007E54E5 /* DefaultToastBehavior.swift in Sources */, 6518288F223024A9007E54E5 /* AwaitToastBehavior.swift in Sources */, 65182895223024A9007E54E5 /* Toast.swift in Sources */, 65182880223024A9007E54E5 /* IconImageLocation.swift in Sources */, 6518287D223024A9007E54E5 /* DefaultToastView.swift in Sources */, 65182892223024A9007E54E5 /* IconToastAppearance.swift in Sources */, 65182891223024A9007E54E5 /* DefaultToastAppearance.swift in Sources */, 65182878223024A9007E54E5 /* ToastDirection.swift in Sources */, 65182879223024A9007E54E5 /* AwaitToastView.swift in Sources */, 65182894223024A9007E54E5 /* ToastAppearanceManager.swift in Sources */, 6518288C223024A9007E54E5 /* AwaitToastOperation.swift in Sources */, 65182882223024A9007E54E5 /* IconToastView.swift in Sources */, 6518288B223024A9007E54E5 /* ToastDynamicDispatch.swift in Sources */, 65182889223024A9007E54E5 /* DefaultToastOperation.swift in Sources */, 65182886223024A9007E54E5 /* AwaitToast.swift in Sources */, 65182890223024A9007E54E5 /* ToastBehavior.swift in Sources */, 6518287E223024A9007E54E5 /* AwaitDefaultToastView.swift in Sources */, 6518288E223024A9007E54E5 /* ToastBehaviorManager.swift in Sources */, 65182888223024A9007E54E5 /* ToastOperation.swift in Sources */, 65182881223024A9007E54E5 /* Icon.swift in Sources */, 65F1467A2251D47E00F7CFF6 /* GlobalConstants.swift in Sources */, 65182884223024A9007E54E5 /* AwaitIcon.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 659E3942222BA27700062BDE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 65FB9952222C40D300A75E8A /* AppDelegate.swift in Sources */, 65FB995F222C412300A75E8A /* SettingCellType.swift in Sources */, 65F146752251CB5C00F7CFF6 /* LongTextCellType.swift in Sources */, 6518284C2230137D007E54E5 /* AwaitExampleCellType.swift in Sources */, 6518284A22301372007E54E5 /* DefaultExampleCellType.swift in Sources */, 65FB9969222C438100A75E8A /* SettingSwitchTableViewCell.swift in Sources */, 65FB9965222C427B00A75E8A /* ExampleTableViewCell.swift in Sources */, 65FB9960222C412300A75E8A /* ExampleCellType.swift in Sources */, 65FB9951222C40D300A75E8A /* ToastExampleTableViewController.swift in Sources */, 65FB9963222C41A900A75E8A /* SectionType.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 65DDDD56222D50140076118E /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 659E38F3222BA21A00062BDE /* AwaitToast */; targetProxy = 65DDDD55222D50140076118E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 659E3951222BA27800062BDE /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 659E3952222BA27800062BDE /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 659E38FA222BA21A00062BDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 659E38FB222BA21A00062BDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 659E38FD222BA21A00062BDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.k-lpmg.AwaitToast"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 659E38FE222BA21A00062BDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.k-lpmg.AwaitToast"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; 659E3956222BA27800062BDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Example/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.k-lpmg.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 659E3957222BA27800062BDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Example/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "com.k-lpmg.Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 659E38EE222BA21A00062BDE /* Build configuration list for PBXProject "AwaitToast" */ = { isa = XCConfigurationList; buildConfigurations = ( 659E38FA222BA21A00062BDE /* Debug */, 659E38FB222BA21A00062BDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 659E38FC222BA21A00062BDE /* Build configuration list for PBXNativeTarget "AwaitToast" */ = { isa = XCConfigurationList; buildConfigurations = ( 659E38FD222BA21A00062BDE /* Debug */, 659E38FE222BA21A00062BDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 659E3955222BA27800062BDE /* Build configuration list for PBXNativeTarget "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( 659E3956222BA27800062BDE /* Debug */, 659E3957222BA27800062BDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 659E38EB222BA21A00062BDE /* Project object */; } ================================================ FILE: AwaitToast.xcodeproj/xcshareddata/xcschemes/AwaitToast.xcscheme ================================================ ================================================ FILE: Example/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" }, { "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/await.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "await.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/egg.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "egg.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/exit.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "exit.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/longText.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "longText.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/toast.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "toast.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Assets.xcassets/trash.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "trash.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: Example/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: Example/Sources/AppDelegate.swift ================================================ // // AppDelegate.swift // Example // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let window = UIWindow(frame: UIScreen.main.bounds) let rootViewController = UINavigationController(rootViewController: ToastExampleTableViewController()) window.rootViewController = rootViewController window.backgroundColor = .white window.makeKeyAndVisible() self.window = window return true } } ================================================ FILE: Example/Sources/Cells/ExampleTableViewCell.swift ================================================ // // ExampleTableViewCell.swift // Example // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit final class ExampleTableViewCell: UITableViewCell { // MARK: - Constants static let reuseIdentifier = "ExampleTableViewCell" // MARK: - UI Components private let iconImageView: UIImageView = { let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false return imageView }() private let actionLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = UIFont.preferredFont(forTextStyle: .subheadline) label.textAlignment = .left label.textColor = .darkGray return label }() private let targetLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = UIFont.preferredFont(forTextStyle: .body) label.textAlignment = .right label.textColor = .gray return label }() // MARK: - Con(De)structor override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) contentView.addSubview(iconImageView) contentView.addSubview(actionLabel) contentView.addSubview(targetLabel) layout() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Internal methods func configure(with type: ExampleCellType) { iconImageView.image = UIImage(named: type.imageName) actionLabel.text = type.action targetLabel.text = type.target } func configure(image: UIImage, action: String, target: String) { iconImageView.image = image actionLabel.text = action targetLabel.text = target } } // MARK: - Layout extension ExampleTableViewCell { private func layout() { iconImageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16).isActive = true iconImageView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 16).isActive = true iconImageView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -16).isActive = true iconImageView.widthAnchor.constraint(equalToConstant: 32).isActive = true actionLabel.leadingAnchor.constraint(equalTo: iconImageView.trailingAnchor, constant: 16).isActive = true actionLabel.centerYAnchor.constraint(equalTo: iconImageView.centerYAnchor).isActive = true actionLabel.setContentHuggingPriority(.required, for: .horizontal) targetLabel.leadingAnchor.constraint(equalTo: actionLabel.trailingAnchor, constant: 8).isActive = true targetLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16).isActive = true targetLabel.centerYAnchor.constraint(equalTo: iconImageView.centerYAnchor).isActive = true } } ================================================ FILE: Example/Sources/Cells/SettingSwitchTableViewCell.swift ================================================ // // SettingSwitchTableViewCell.swift // Example // // Created by DongHeeKang on 04/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit protocol SettingSwitchTableViewCellDelegate: NSObjectProtocol { func settingSwitchTableViewCell(_ cell: SettingSwitchTableViewCell, switchUpdated isOn: Bool) } final class SettingSwitchTableViewCell: UITableViewCell { // MARK: - Constants static let reuseIdentifier = "SettingSwitchTableViewCell" // MARK: - Properties var indexPath: IndexPath? var isSwitchOn: Bool? = nil { didSet { guard let isSwitchOn = isSwitchOn else {return} settingSwitch.isOn = isSwitchOn } } weak var delegate: SettingSwitchTableViewCellDelegate? // MARK: - UI Components private let settingLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.font = UIFont.preferredFont(forTextStyle: .subheadline) label.textAlignment = .left label.textColor = .darkGray return label }() private let settingSwitch: UISwitch = { let settingSwitch = UISwitch() settingSwitch.translatesAutoresizingMaskIntoConstraints = false return settingSwitch }() // MARK: - Con(De)structor override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) setProperties() setSelector() contentView.addSubview(settingLabel) contentView.addSubview(settingSwitch) layout() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Internal methods func configure(with text: String) { settingLabel.text = text } // MARK: - Private methods private func setProperties() { selectionStyle = .none } private func setSelector() { settingSwitch.addTarget(self, action: #selector(switchValueChanged), for: .valueChanged) } // MARK: - Private selector @objc private func switchValueChanged() { delegate?.settingSwitchTableViewCell(self, switchUpdated: settingSwitch.isOn) } } // MARK: - Layout extension SettingSwitchTableViewCell { private func layout() { settingLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16).isActive = true settingLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor).isActive = true settingSwitch.centerYAnchor.constraint(equalTo: contentView.centerYAnchor).isActive = true settingSwitch.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -16).isActive = true } } ================================================ FILE: Example/Sources/Enums/AwaitExampleCellType.swift ================================================ // // AwaitExampleCellType.swift // Example // // Created by DongHeeKang on 06/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // enum AwaitExampleCellType: Int, CaseIterable, ExampleCellType { case defaultAwait case finishDefaultAwait case iconAwait case finishIconAwait case dismissAwaitLatestToast case dismissAllToast var action: String { switch self { case .defaultAwait: return "Show" case .finishDefaultAwait: return "Finish" case .iconAwait: return "Show" case .finishIconAwait: return "Finish" case .dismissAwaitLatestToast: return "Dismiss" case .dismissAllToast: return "Dismiss" } } var target: String { switch self { case .defaultAwait: return "default await toast" case .finishDefaultAwait: return "default await toast" case .iconAwait: return "icon await toast" case .finishIconAwait: return "icon await toast" case .dismissAwaitLatestToast: return "await latest toast" case .dismissAllToast: return "all toast" } } var imageName: String { switch self { case .defaultAwait: return "await" case .finishDefaultAwait: return "exit" case .iconAwait: return "await" case .finishIconAwait: return "exit" case .dismissAwaitLatestToast: return "trash" case .dismissAllToast: return "trash" } } } ================================================ FILE: Example/Sources/Enums/DefaultExampleCellType.swift ================================================ // // DefaultExampleCellType.swift // Example // // Created by DongHeeKang on 06/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // enum DefaultExampleCellType: Int, CaseIterable, ExampleCellType { case `default` case icon case dismissDefaultLatestToast case dismissAllToast var action: String { switch self { case .default: return "Show" case .icon: return "Show" case .dismissDefaultLatestToast: return "Dismiss" case .dismissAllToast: return "Dismiss" } } var target: String { switch self { case .default: return "default toast" case .icon: return "icon toast" case .dismissDefaultLatestToast: return "default latest toast" case .dismissAllToast: return "all toast" } } var imageName: String { switch self { case .default: return "toast" case .icon: return "toast" case .dismissDefaultLatestToast: return "trash" case .dismissAllToast: return "trash" } } } ================================================ FILE: Example/Sources/Enums/ExampleCellType.swift ================================================ // // ExampleCellType.swift // Example // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // protocol ExampleCellType { var action: String { get } var target: String { get } var imageName: String { get } } ================================================ FILE: Example/Sources/Enums/LongTextCellType.swift ================================================ // // LongTextCellType.swift // Example // // Created by DongHeeKang on 01/04/2019. // Copyright © 2019 k-lpmg. All rights reserved. // enum LongTextCellType: Int, CaseIterable { case automaticDimension case longTestToast var title: String { switch self { case .automaticDimension: return "AutomaticDimension" case .longTestToast: return "" } } } ================================================ FILE: Example/Sources/Enums/SectionType.swift ================================================ // // SectionType.swift // Example // // Created by DongHeeKang on 04/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // enum SectionType: Int, CaseIterable { case settings case defaultExamples case awaitExamples case longText var title: String { switch self { case .settings: return "Settings" case .defaultExamples: return "Default Examples" case .awaitExamples: return "Await Examples" case .longText: return "Long Text Example" } } } ================================================ FILE: Example/Sources/Enums/SettingCellType.swift ================================================ // // SettingCellType.swift // Example // // Created by DongHeeKang on 04/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // enum SettingCellType: Int, CaseIterable { case tapToDismiss case topDirection var title: String { switch self { case .tapToDismiss: return "Tap to dismiss" case .topDirection: return "Top direction" } } } ================================================ FILE: Example/Sources/ToastExampleTableViewController.swift ================================================ // // ToastExampleTableViewController.swift // Example // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit import AwaitToast final class ToastExampleTableViewController: UITableViewController { // MARK: - Properties let sections = SectionType.allCases let settings = SettingCellType.allCases let defaultExamples = DefaultExampleCellType.allCases let awaitExamples = AwaitExampleCellType.allCases let longTextExample = LongTextCellType.allCases var defaultAwaitToast: AwaitToast? var iconAwaitToast: AwaitToast? var direction: ToastDirection = .top // MARK: - Overridden: UITableViewController override func viewDidLoad() { super.viewDidLoad() setAppearance() setProperties() } // MARK: - UITableViewDataSource override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { return sections[section].title } override func numberOfSections(in tableView: UITableView) -> Int { return sections.count } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { switch sections[section] { case .settings: return settings.count case .defaultExamples: return defaultExamples.count case .awaitExamples: return awaitExamples.count case .longText: return longTextExample.count } } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { switch sections[indexPath.section] { case .settings: let cell = tableView.dequeueReusableCell(withIdentifier: SettingSwitchTableViewCell.reuseIdentifier, for: indexPath) as! SettingSwitchTableViewCell cell.indexPath = indexPath cell.delegate = self cell.configure(with: settings[indexPath.row].title) if let setting = SettingCellType(rawValue: indexPath.row) { switch setting { case .tapToDismiss: cell.isSwitchOn = ToastBehaviorManager.default.isTappedDismissEnabled && ToastBehaviorManager.await.isTappedDismissEnabled case .topDirection: cell.isSwitchOn = direction == .top } } return cell case .defaultExamples: let cell = tableView.dequeueReusableCell(withIdentifier: ExampleTableViewCell.reuseIdentifier, for: indexPath) as! ExampleTableViewCell cell.configure(with: defaultExamples[indexPath.row] as ExampleCellType) return cell case .awaitExamples: let cell = tableView.dequeueReusableCell(withIdentifier: ExampleTableViewCell.reuseIdentifier, for: indexPath) as! ExampleTableViewCell cell.configure(with: awaitExamples[indexPath.row] as ExampleCellType) return cell case .longText: let longTextCell = LongTextCellType(rawValue: indexPath.row)! switch longTextCell { case .automaticDimension: let cell = tableView.dequeueReusableCell(withIdentifier: SettingSwitchTableViewCell.reuseIdentifier, for: indexPath) as! SettingSwitchTableViewCell cell.indexPath = indexPath cell.delegate = self cell.configure(with: longTextCell.title) cell.isSwitchOn = ToastAppearanceManager.default.height == AutomaticDimension return cell case .longTestToast: let cell = tableView.dequeueReusableCell(withIdentifier: ExampleTableViewCell.reuseIdentifier, for: indexPath) as! ExampleTableViewCell cell.configure(image: UIImage(named: "longText")!, action: "Show", target: "Default long text") return cell } } } // MARK: - UITableViewDelegate override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 64 } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) switch sections[indexPath.section] { case .defaultExamples: guard let cellType = DefaultExampleCellType(rawValue: indexPath.row) else {return} switch cellType { case .default: let toast = Toast.default(text: "Default toast", direction: direction) toast.show() case .icon: let image = UIImage(named: "egg")!.withRenderingMode(.alwaysTemplate) let toast = Toast.icon(image: image, text: "Icon toast", direction: direction) toast.show() case .dismissDefaultLatestToast: Toast.latestDismiss() case .dismissAllToast: Toast.dismissAll() } case .awaitExamples: guard let cellType = AwaitExampleCellType(rawValue: indexPath.row) else {return} switch cellType { case .defaultAwait: defaultAwaitToast?.finish() defaultAwaitToast = AwaitToast.default(initialText: "Await default toast start", endText: "Await default toast end", direction: direction) defaultAwaitToast?.show() case .finishDefaultAwait: defaultAwaitToast?.finish() case .iconAwait: iconAwaitToast?.finish() let image = UIImage(named: "egg")!.withRenderingMode(.alwaysTemplate) iconAwaitToast = AwaitToast.icon(image: image, initialText: "Await icon toast start", endText: "Await icon toast end", direction: direction) iconAwaitToast?.show() case .finishIconAwait: iconAwaitToast?.finish() case .dismissAwaitLatestToast: AwaitToast.latestDismiss() case .dismissAllToast: AwaitToast.dismissAll() } case .longText: guard let cellType = LongTextCellType(rawValue: indexPath.row) else {return} switch cellType { case .longTestToast: let text = """ This is long text line 1 This is long text line 2 This is long text line 3 This is long text line 4 This is long text line 5 This is long text line 6 This is long text line 7 This is long text line 8 This is long text line 9 This is long text line 10 This is long text line 11 This is long text line 12 This is long text line 13 """ let toast = Toast.default(text: text, direction: direction) toast.show() default: break } default: break } } // MARK: - Private methods private func setAppearance() { ToastAppearanceManager.icon.imageTintColor = .white } private func setProperties() { title = "AwaitToast" tableView.estimatedRowHeight = 64 tableView.rowHeight = UITableView.automaticDimension tableView.register(SettingSwitchTableViewCell.self, forCellReuseIdentifier: SettingSwitchTableViewCell.reuseIdentifier) tableView.register(ExampleTableViewCell.self, forCellReuseIdentifier: ExampleTableViewCell.reuseIdentifier) } } // MARK: - SettingSwitchTableViewCellDelegate extension ToastExampleTableViewController: SettingSwitchTableViewCellDelegate { func settingSwitchTableViewCell(_ cell: SettingSwitchTableViewCell, switchUpdated isOn: Bool) { guard let indexPath = cell.indexPath else {return} switch sections[indexPath.section] { case .settings: guard let type = SettingCellType(rawValue: cell.indexPath?.row ?? -1) else {return} switch type { case .tapToDismiss: ToastBehaviorManager.default.isTappedDismissEnabled = isOn ToastBehaviorManager.await.isTappedDismissEnabled = isOn case .topDirection: direction = isOn ? .top : .bottom } case .longText: guard let type = LongTextCellType(rawValue: cell.indexPath?.row ?? -1) else {return} switch type { case .automaticDimension: ToastAppearanceManager.default.height = isOn ? AutomaticDimension : 96 default: break } default: break } } } ================================================ FILE: Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.2.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2019 DongHee Kang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # AwaitToast [![Build Status](https://travis-ci.org/k-lpmg/AwaitToast.svg?branch=master)](https://travis-ci.org/k-lpmg/AwaitToast) ![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg) [![Cocoapods](https://img.shields.io/cocoapods/v/AwaitToast.svg?style=flat)](https://cocoapods.org/pods/AwaitToast) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 🍞 An async waiting toast with basic toast. Inspired by facebook posting toast. ## Introduction

## Usage #### Default ```swift let toast: Toast = Toast.default(text: "Toast is started") // Show toast.show() // Dismiss toast.dismiss() // Bottom Direction Toast.default(text: "Toast is started", direction: .bottom) ``` #### Await ```swift let awaitToast: AwaitToast = AwaitToast.default(initialText: "Toast is started", endText: "Toast is ended") // Show awaitToast.show() // Finish awaitToast.finish() // Dismiss awaitToast.dismiss() ``` #### Dismiss ```swift // Last toast in queue dismiss Toast.latestDismiss() AwaitToast.latestDismiss() // All toast in queue dismiss Toast.dismissAll() AwaitToast.dismissAll() ``` #### Appearance ```swift // Get singleton appearance object let defaultAppearance = ToastAppearanceManager.default let iconAppearance = ToastAppearanceManager.icon // Update singletone appearance properties defaultAppearance.height = 128 defaultAppearance.backgroundColor = .white defaultAppearance.numberOfLines = 1 defaultAppearance.textAlignment = .left ... ``` #### Behavior ```swift // Get singleton behavior object let defaultBehavior = ToastBehaviorManager.default let awaitBehavior = ToastBehaviorManager.await // Update singletone behavior properties defaultBehavior.isTappedDismissEnabled = false defaultBehavior.delay = 3.0 defaultBehavior.showDurarion = 0.3 defaultBehavior.duration = 3.0 defaultBehavior.dismissDuration = 0.3 ... ``` #### Self-sizing ```swift ToastAppearanceManager.default.height = AutomaticDimension ToastAppearanceManager.icon.height = AutomaticDimension ``` ## Installation #### CocoaPods (iOS 9+) ```ruby platform :ios, '9.0' use_frameworks! target '' do pod 'AwaitToast' end ``` #### Carthage (iOS 9+) ```ruby github "k-lpmg/AwaitToast" ``` ## LICENSE These works are available under the MIT license. See the [LICENSE][license] file for more info. [license]: LICENSE ================================================ FILE: Sources/AwaitToast/Appearances/DefaultToastAppearance.swift ================================================ // // DefaultToastAppearance.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit public final class DefaultToastAppearance: ToastAppearance { static var shared: DefaultToastAppearance = .init() required init() { } // EdgeInsets public var titleEdgeInsets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16) // ToastView public var height: CGFloat = 96 public var backgroundColor: UIColor = UIColor.black // TextLabel public var numberOfLines: Int = 0 public var textAlignment: NSTextAlignment = .center public var textFont: UIFont = UIFont.preferredFont(forTextStyle: .subheadline) public var textColor: UIColor = .white } ================================================ FILE: Sources/AwaitToast/Appearances/IconToastAppearance.swift ================================================ // // IconToastAppearance.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit public final class IconToastAppearance: ToastAppearance { static var shared: IconToastAppearance = .init() required init() { } // EdgeInsets public var titleEdgeInsets: UIEdgeInsets = UIEdgeInsets(top: 16, left: 8, bottom: 16, right: 16) public var imageEdgeInsets: UIEdgeInsets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 8) // ToastView public var height: CGFloat = 96 public var backgroundColor: UIColor = UIColor.black // ImageView public var imageContentMode: UIView.ContentMode = .scaleToFill public var imageTintColor: UIColor? = nil // TextLabel public var numberOfLines: Int = 0 public var textAlignment: NSTextAlignment = .left public var textFont: UIFont = UIFont.preferredFont(forTextStyle: .subheadline) public var textColor: UIColor = .white } ================================================ FILE: Sources/AwaitToast/Appearances/ToastAppearance.swift ================================================ // // ToastAppearance.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit protocol ToastAppearance: class { static var shared: Self { get set } init() // EdgeInsets var titleEdgeInsets: UIEdgeInsets { get set } // ToastView var height: CGFloat { get set } var backgroundColor: UIColor { get set } // TextLabel var numberOfLines: Int { get set } var textAlignment: NSTextAlignment { get set } var textFont: UIFont { get set } var textColor: UIColor { get set } } ================================================ FILE: Sources/AwaitToast/Appearances/ToastAppearanceManager.swift ================================================ // // ToastAppearanceManager.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public enum ToastAppearanceManager { public static var `default` = DefaultToastAppearance.shared public static var icon = IconToastAppearance.shared } ================================================ FILE: Sources/AwaitToast/AwaitToast.swift ================================================ // // AwaitToast.swift // AwaitToast // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public class AwaitToast: ToastCompatiable { // MARK: - Properties static var operationQueue: OperationQueue = { let queue = OperationQueue() queue.name = "com.k-lpmg.AwaitToast.operationQueue" return queue }() // MARK: - Class methods public class func latestDismiss() { operationQueue.operations.last?.cancel() } public class func dismissAll() { operationQueue.cancelAllOperations() } // MARK: - Public methods public func finish() { toastAbstractMethod() } public func show() { toastAbstractMethod() } public func dismiss() { toastAbstractMethod() } } ================================================ FILE: Sources/AwaitToast/Behaviors/AwaitToastBehavior.swift ================================================ // // AwaitToastBehavior.swift // AwaitToast // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public final class AwaitToastBehavior: ToastBehavior { static var shared: AwaitToastBehavior = .init() required init() { } public var isTappedDismissEnabled: Bool = true public var delay: TimeInterval = 0.0 public var showDurarion: TimeInterval = 0.2 public var finishDurarion: TimeInterval = 0.2 public var dismissDelayWhenFinish: TimeInterval = 0.4 public var dismissDuration: TimeInterval = 0.2 } ================================================ FILE: Sources/AwaitToast/Behaviors/DefaultToastBehavior.swift ================================================ // // DefaultToastBehavior.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public final class DefaultToastBehavior: ToastBehavior { static var shared: DefaultToastBehavior = .init() required init() { } public var isTappedDismissEnabled: Bool = true public var delay: TimeInterval = 0.0 public var showDurarion: TimeInterval = 0.2 public var duration: TimeInterval = 3.0 public var dismissDuration: TimeInterval = 0.2 } ================================================ FILE: Sources/AwaitToast/Behaviors/ToastBehavior.swift ================================================ // // ToastBehavior.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // protocol ToastBehavior { static var shared: Self { get set } init() var isTappedDismissEnabled: Bool { get set } var delay: TimeInterval { get set } var showDurarion: TimeInterval { get set} var dismissDuration: TimeInterval { get set } } ================================================ FILE: Sources/AwaitToast/Behaviors/ToastBehaviorManager.swift ================================================ // // ToastBehaviorManager.swift // Example // // Created by DongHeeKang on 04/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public enum ToastBehaviorManager { public static var `default` = DefaultToastBehavior.shared public static var await = AwaitToastBehavior.shared } ================================================ FILE: Sources/AwaitToast/Operations/AwaitToastOperation.swift ================================================ // // AwaitToastOperation.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import Foundation class AwaitToastOperation: ToastOperation where A: ToastAppearance { // MARK: - Properties private var initialWorkItem: DispatchWorkItem? private lazy var finishWorkkItem: DispatchWorkItem = DispatchWorkItem { [weak self] in guard let self = self, let view = self.view as? AwaitToastView else {return} view.finish(duration: self.behavior.finishDurarion) { DispatchQueue.main.asyncAfter(deadline: .now() + self.behavior.dismissDelayWhenFinish, execute: { self.dismiss() }) } } // MARK: - Overridden: Operation override func main() { initialWorkItem = DispatchWorkItem { [weak self] in guard let self = self else {return} self.showToast() } DispatchQueue.main.asyncAfter(deadline: .now() + behavior.delay, execute: initialWorkItem!) } override func cancel() { super.cancel() initialWorkItem?.cancel() dismiss() } // MARK: - Internal methods func finish() { DispatchQueue.main.async(execute: finishWorkkItem) } } ================================================ FILE: Sources/AwaitToast/Operations/DefaultToastOperation.swift ================================================ // // ToastOperation.swift // AwaitToast // // Created by DongHeeKang on 01/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import Foundation class DefaultToastOperation: ToastOperation where A: ToastAppearance { // MARK: - Properties private var workItem: DispatchWorkItem? // MARK: - Overridden: Operation override func main() { workItem = DispatchWorkItem { [weak self] in guard let self = self else {return} defer { DispatchQueue.main.asyncAfter(deadline: .now() + self.behavior.duration, execute: { guard self.workItem?.isCancelled == false else {return} self.dismiss() }) } self.showToast() } DispatchQueue.main.async(execute: workItem!) } override func cancel() { super.cancel() workItem?.cancel() dismiss() } } ================================================ FILE: Sources/AwaitToast/Operations/ToastDynamicDispatch.swift ================================================ // // ToastDynamicDispatch.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // final class ToastDynamicDispatch { weak var view: UIView? unowned let operation: Operation init(view: UIView? = nil, operation: Operation) { self.view = view self.operation = operation setSelector() } // MARK: - Private methods private func setSelector() { view?.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(viewTapped))) } // MARK: - Private selector @objc func viewTapped() { operation.cancel() } } ================================================ FILE: Sources/AwaitToast/Operations/ToastOperation.swift ================================================ // // ToastOperation.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import Foundation fileprivate let kIsFinished = "isFinished" class ToastOperation: Operation where A: ToastAppearance, B: ToastBehavior { // MARK: - Properties var view: ToastView let behavior: B = B.shared private var _dynamicDispatch: ToastDynamicDispatch! // MARK: - Con(De)structor init(view: ToastView) { self.view = view super.init() _dynamicDispatch = .init(view: behavior.isTappedDismissEnabled ? view : nil, operation: self) } // MARK: - Overridden: Operation private var _finished = false override var isFinished: Bool { get { return _finished } set { willChangeValue(forKey: kIsFinished) _finished = newValue didChangeValue(forKey: kIsFinished) } } override func main() { toastAbstractMethod() } // MARK: - Internal methods func dismiss(completion: ((Bool) -> Void)? = nil) { self.isFinished = true let toOriginX = view.frame.origin.x let toOriginY: CGFloat switch view.direction { case .top: toOriginY = -view.bounds.height case .bottom: toOriginY = view.frame.origin.y + view.bounds.height } UIView.animate(withDuration: behavior.dismissDuration, animations: { self.view.frame.origin = CGPoint(x: toOriginX, y: toOriginY) }, completion: { (_) in self.view.removeFromSuperview() }) } func showToast() { guard let window = UIApplication.shared.keyWindow else {return} window.addSubview(view) view.translatesAutoresizingMaskIntoConstraints = false view.leadingAnchor.constraint(equalTo: window.leadingAnchor).isActive = true view.trailingAnchor.constraint(equalTo: window.trailingAnchor).isActive = true if view.appearance.height == AutomaticDimension { view.heightAnchor.constraint(greaterThanOrEqualToConstant: 0).isActive = true } else { let safeAreaPadding: CGFloat switch view.direction { case .top: safeAreaPadding = UIApplication.shared.statusBarFrame.size.height case .bottom: if #available(iOS 11.0, *), let window = UIApplication.shared.keyWindow { safeAreaPadding = window.safeAreaInsets.bottom } else { safeAreaPadding = 0 } } view.heightAnchor.constraint(equalToConstant: view.appearance.height + safeAreaPadding).isActive = true } let initialViewYAnchor: NSLayoutConstraint let toViewYAnchor: NSLayoutConstraint switch self.view.direction { case .top: initialViewYAnchor = self.view.bottomAnchor.constraint(equalTo: window.topAnchor) toViewYAnchor = self.view.topAnchor.constraint(equalTo: window.topAnchor) case .bottom: initialViewYAnchor = self.view.topAnchor.constraint(equalTo: window.bottomAnchor) toViewYAnchor = self.view.bottomAnchor.constraint(equalTo: window.bottomAnchor) } initialViewYAnchor.isActive = true window.layoutIfNeeded() UIView.animate(withDuration: behavior.showDurarion) { initialViewYAnchor.isActive = false toViewYAnchor.isActive = true window.layoutIfNeeded() } } } ================================================ FILE: Sources/AwaitToast/Toast.swift ================================================ // // Toast.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public class Toast: ToastCompatiable { // MARK: - Properties static var operationQueue: OperationQueue = { let queue = OperationQueue() queue.name = "com.k-lpmg.Toast.operationQueue" return queue }() // MARK: - Class methods public class func latestDismiss() { operationQueue.operations.last?.cancel() } public class func dismissAll() { operationQueue.cancelAllOperations() } // MARK: - Public methods public func show() { toastAbstractMethod() } public func dismiss() { toastAbstractMethod() } } ================================================ FILE: Sources/AwaitToast/ToastCompatiable.swift ================================================ // // ToastCompatiable.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // protocol ToastCompatiable { static var operationQueue: OperationQueue { get set } func show() func dismiss() } ================================================ FILE: Sources/AwaitToast/ToastDirection.swift ================================================ // // ToastDirection.swift // AwaitToast // // Created by DongHeeKang on 01/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public enum ToastDirection { case top case bottom } ================================================ FILE: Sources/AwaitToast/Toasts/AwaitToastProducer.swift ================================================ // // AwaitToastProducer.swift // AwaitToast // // Created by DongHeeKang on 03/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // class AwaitToastProducer: AwaitToast where A: ToastAppearance { var view: AwaitToastView! private let _operation: AwaitToastOperation init(view: AwaitToastView) { self.view = view self._operation = AwaitToastOperation(view: view) } override func show() { type(of: self).operationQueue.addOperation(_operation) } override func finish() { _operation.finish() } override func dismiss() { _operation.cancel() } } ================================================ FILE: Sources/AwaitToast/Toasts/AwaitToastView.swift ================================================ // // AwaitToastView.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class AwaitToastView: ToastView where A: ToastAppearance { var endTextLabelFrame: CGRect { let titleEdgeInsets = appearance.titleEdgeInsets let originY: CGFloat switch direction { case .top: originY = -contentView.bounds.height case .bottom: originY = contentView.bounds.height } let originX = titleEdgeInsets.left let width = contentView.bounds.width - titleEdgeInsets.left - titleEdgeInsets.right let height = contentView.bounds.height - titleEdgeInsets.top - titleEdgeInsets.bottom return CGRect(x: originX, y: originY, width: width, height: height) } var endTextLabelToOriginY: CGFloat { return appearance.titleEdgeInsets.top } func finish(duration: TimeInterval, completion: (() -> Void)? = nil) { toastAbstractMethod() } } ================================================ FILE: Sources/AwaitToast/Toasts/Default/AwaitDefault.swift ================================================ // // AwaitDefault.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // extension AwaitToast { public static func `default`(initialText: String, endText: String, direction: ToastDirection = .top) -> AwaitToast { return AwaitDefault(initialText: initialText, endText: endText, direction: direction) } public static func `default`(initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection = .top) -> AwaitToast { return AwaitDefault(initialAttributedString: initialAttributedString, endAttributedString: endAttributedString, direction: direction) } } final private class AwaitDefault: AwaitToastProducer { init(initialText: String, endText: String, direction: ToastDirection) { super.init(view: AwaitDefaultToastView(initialText: initialText, endText: endText, direction: direction)) } init(initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection) { super.init(view: AwaitDefaultToastView(initialAttributedString: initialAttributedString, endAttributedString: endAttributedString, direction: direction)) } } ================================================ FILE: Sources/AwaitToast/Toasts/Default/AwaitDefaultToastView.swift ================================================ // // AwaitDefaultToastView.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class AwaitDefaultToastView: AwaitToastView { // MARK: - Properties let initialText: String? let endText: String? let initialAttributedString: NSAttributedString? let endAttributedString: NSAttributedString? // MARK: - UI Components lazy var initialTextLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() lazy var endTextLabel: UILabel = { let label = UILabel() label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() // MARK: - Con(De)structor init(initialText: String, endText: String, direction: ToastDirection) { self.initialText = initialText self.endText = endText self.initialAttributedString = nil self.endAttributedString = nil super.init(direction: direction) commonInit() initialTextLabel.text = initialText endTextLabel.text = endText } init(initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection) { self.initialText = nil self.endText = nil self.initialAttributedString = initialAttributedString self.endAttributedString = endAttributedString super.init(direction: direction) commonInit() initialTextLabel.attributedText = initialAttributedString endTextLabel.attributedText = endAttributedString } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Overridden: AwaitToastView override func finish(duration: TimeInterval, completion: (() -> Void)? = nil) { initialTextLabel.removeFromSuperview() contentView.addSubview(endTextLabel) endTextLabel.frame = endTextLabelFrame UIView.animate(withDuration: duration, animations: { var frame = self.endTextLabel.frame frame.origin.y = self.endTextLabelToOriginY self.endTextLabel.frame = frame }) { (_) in completion?() } } // MARK: - Internal methods func commonInit() { contentView.addSubview(initialTextLabel) layout() } } // MARK: - Layout extension AwaitDefaultToastView { private func layout() { let titleEdgeInsets = appearance.titleEdgeInsets initialTextLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: titleEdgeInsets.left).isActive = true initialTextLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: titleEdgeInsets.top).isActive = true initialTextLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -titleEdgeInsets.right).isActive = true initialTextLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -titleEdgeInsets.bottom).isActive = true } } ================================================ FILE: Sources/AwaitToast/Toasts/Default/Default.swift ================================================ // // Default.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // extension Toast { public static func `default`(text: String, direction: ToastDirection = .top) -> Toast { return Default(text: text, direction: direction) } public static func `default`(attributedString: NSAttributedString, direction: ToastDirection = .top) -> Toast { return Default(attributedString: attributedString, direction: direction) } } final private class Default: DefaultToastProducer { init(text: String, direction: ToastDirection) { super.init(view: DefaultToastView(text: text, direction: direction)) } init(attributedString: NSAttributedString, direction: ToastDirection) { super.init(view: DefaultToastView(attributedString: attributedString, direction: direction)) } } ================================================ FILE: Sources/AwaitToast/Toasts/Default/DefaultToastView.swift ================================================ // // DefaultToastView.swift // AwaitToast // // Created by DongHeeKang on 01/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class DefaultToastView: ToastView { // MARK: - Properties let text: String? let attributedString: NSAttributedString? // MARK: - UI Components lazy var textLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() // MARK: - Con(De)structor init(text: String, direction: ToastDirection) { self.text = text self.attributedString = nil super.init(direction: direction) commonInit() textLabel.text = text } init(attributedString: NSAttributedString, direction: ToastDirection) { self.text = nil self.attributedString = attributedString super.init(direction: direction) commonInit() textLabel.attributedText = attributedString } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Internal methods func commonInit() { contentView.addSubview(textLabel) layout() } } // MARK: - Layout extension DefaultToastView { private func layout() { let titleEdgeInsets = appearance.titleEdgeInsets textLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: titleEdgeInsets.left).isActive = true textLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: titleEdgeInsets.top).isActive = true textLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -titleEdgeInsets.right).isActive = true textLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -titleEdgeInsets.bottom).isActive = true } } ================================================ FILE: Sources/AwaitToast/Toasts/DefaultToastProducer.swift ================================================ // // DefaultToastProducer.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // class DefaultToastProducer: Toast where A: ToastAppearance { var view: ToastView! private let _operation: DefaultToastOperation init(view: ToastView) { self.view = view self._operation = DefaultToastOperation(view: view) } override func show() { type(of: self).operationQueue.addOperation(_operation) } override func dismiss() { _operation.cancel() } } ================================================ FILE: Sources/AwaitToast/Toasts/Icon/AwaitIcon.swift ================================================ // // AwaitIcon.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // extension AwaitToast { public static func icon(image: UIImage, imageLocation: IconImageLocation = .left, initialText: String, endText: String, direction: ToastDirection = .top) -> AwaitToast { return AwaitIcon(image: image, imageLocation: imageLocation, initialText: initialText, endText: endText, direction: direction) } public static func icon(image: UIImage, imageLocation: IconImageLocation = .left, initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection = .top) -> AwaitToast { return AwaitIcon(image: image, imageLocation: imageLocation, initialAttributedString: initialAttributedString, endAttributedString: endAttributedString, direction: direction) } } final private class AwaitIcon: AwaitToastProducer { init(image: UIImage, imageLocation: IconImageLocation, initialText: String, endText: String, direction: ToastDirection) { super.init(view: AwaitIconToastView(image: image, imageLocation: imageLocation, initialText: initialText, endText: endText, direction: direction)) } init(image: UIImage, imageLocation: IconImageLocation, initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection) { super.init(view: AwaitIconToastView(image: image, imageLocation: imageLocation, initialAttributedString: initialAttributedString, endAttributedString: endAttributedString, direction: direction)) } } ================================================ FILE: Sources/AwaitToast/Toasts/Icon/AwaitIconToastView.swift ================================================ // // AwaitIconToastView.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class AwaitIconToastView: AwaitToastView { // MARK: - Constants private enum Const { static let imageSize = CGSize(width: 24, height: 24) } // MARK: - Properties let image: UIImage? let imageLocation: IconImageLocation let initialText: String? let endText: String? let initialAttributedString: NSAttributedString? let endAttributedString: NSAttributedString? // MARK: - UI Components lazy var imageView: UIImageView = { let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.image = image imageView.contentMode = appearance.imageContentMode imageView.tintColor = appearance.imageTintColor return imageView }() lazy var initialTextLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() lazy var endTextLabel: UILabel = { let label = UILabel() label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() // MARK: - Con(De)structor init(image: UIImage, imageLocation: IconImageLocation, initialText: String, endText: String, direction: ToastDirection) { self.image = image self.imageLocation = imageLocation self.initialText = initialText self.endText = endText self.initialAttributedString = nil self.endAttributedString = nil super.init(direction: direction) commonInit() initialTextLabel.text = initialText endTextLabel.text = endText } init(image: UIImage, imageLocation: IconImageLocation, initialAttributedString: NSAttributedString, endAttributedString: NSAttributedString, direction: ToastDirection) { self.image = image self.imageLocation = imageLocation self.initialText = nil self.endText = nil self.initialAttributedString = initialAttributedString self.endAttributedString = endAttributedString super.init(direction: direction) commonInit() initialTextLabel.attributedText = initialAttributedString endTextLabel.attributedText = endAttributedString } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Overridden: AwaitToastView override func finish(duration: TimeInterval, completion: (() -> Void)? = nil) { let imageViewFrame = imageView.frame let initialTextLabelFrame = initialTextLabel.frame initialTextLabel.removeFromSuperview() imageView.removeFromSuperview() imageView.translatesAutoresizingMaskIntoConstraints = true contentView.addSubview(imageView) contentView.addSubview(endTextLabel) var frame = endTextLabelFrame frame.origin.x = initialTextLabelFrame.origin.x endTextLabel.frame = frame imageView.frame = CGRect(x: imageViewFrame.origin.x, y: frame.origin.y, width: Const.imageSize.width, height: Const.imageSize.height) UIView.animate(withDuration: duration, animations: { var endTextLabelFrame = self.endTextLabel.frame endTextLabelFrame.origin.y = self.endTextLabelToOriginY self.endTextLabel.frame = endTextLabelFrame let imageEdgeInsets = self.appearance.imageEdgeInsets var imageViewFrame = self.imageView.frame imageViewFrame.origin.y = endTextLabelFrame.midY - Const.imageSize.height/2 + imageEdgeInsets.top - imageEdgeInsets.bottom self.imageView.frame = imageViewFrame }) { (_) in completion?() } } // MARK: - Internal methods func commonInit() { contentView.addSubview(imageView) contentView.addSubview(initialTextLabel) layout() } } // MARK: - Layout extension AwaitIconToastView { private func layout() { let titleEdgeInsets = appearance.titleEdgeInsets let imageEdgeInsets = appearance.imageEdgeInsets let imageViewTopConstant = imageEdgeInsets.top - imageEdgeInsets.bottom imageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: imageViewTopConstant).isActive = true imageView.widthAnchor.constraint(equalToConstant: Const.imageSize.width).isActive = true imageView.heightAnchor.constraint(equalToConstant: Const.imageSize.height).isActive = true initialTextLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: titleEdgeInsets.top).isActive = true initialTextLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -titleEdgeInsets.bottom).isActive = true switch imageLocation { case .left: imageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: imageEdgeInsets.left).isActive = true let textLabelLeftConstant = titleEdgeInsets.left + imageEdgeInsets.right initialTextLabel.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: textLabelLeftConstant).isActive = true initialTextLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -titleEdgeInsets.right).isActive = true case .right: imageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -imageEdgeInsets.right).isActive = true let textLabelRightConstant = titleEdgeInsets.right + imageEdgeInsets.left initialTextLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: titleEdgeInsets.left).isActive = true initialTextLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -textLabelRightConstant).isActive = true } } } ================================================ FILE: Sources/AwaitToast/Toasts/Icon/Icon.swift ================================================ // // Icon.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // extension Toast { public static func icon(image: UIImage, imageLocation: IconImageLocation = .left, text: String, direction: ToastDirection = .top) -> Toast { return Icon(image: image, imageLocation: imageLocation, text: text, direction: direction) } public static func icon(image: UIImage, imageLocation: IconImageLocation = .left, attributedString: NSAttributedString, direction: ToastDirection = .top) -> Toast { return Icon(image: image, imageLocation: imageLocation, attributedString: attributedString, direction: direction) } } final private class Icon: DefaultToastProducer { init(image: UIImage, imageLocation: IconImageLocation, text: String, direction: ToastDirection) { super.init(view: IconToastView(image: image, imageLocation: imageLocation, text: text, direction: direction)) } init(image: UIImage, imageLocation: IconImageLocation, attributedString: NSAttributedString, direction: ToastDirection) { super.init(view: IconToastView(image: image, imageLocation: imageLocation, attributedString: attributedString, direction: direction)) } } ================================================ FILE: Sources/AwaitToast/Toasts/Icon/IconImageLocation.swift ================================================ // // IconImageLocation.swift // AwaitToast // // Created by DongHeeKang on 02/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public enum IconImageLocation { case left case right } ================================================ FILE: Sources/AwaitToast/Toasts/Icon/IconToastView.swift ================================================ // // IconToastView.swift // AwaitToast // // Created by DongHeeKang on 01/03/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class IconToastView: ToastView { // MARK: - Constants private enum Const { static let imageSize = CGSize(width: 24, height: 24) } // MARK: - Properties let image: UIImage? let imageLocation: IconImageLocation let text: String? let attributedString: NSAttributedString? // MARK: - UI Components lazy var imageView: UIImageView = { let imageView = UIImageView() imageView.translatesAutoresizingMaskIntoConstraints = false imageView.image = image imageView.contentMode = appearance.imageContentMode imageView.tintColor = appearance.imageTintColor return imageView }() lazy var textLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = appearance.numberOfLines label.textAlignment = appearance.textAlignment label.font = appearance.textFont label.textColor = appearance.textColor return label }() // MARK: - Con(De)structor init(image: UIImage, imageLocation: IconImageLocation, text: String, direction: ToastDirection) { self.image = image self.imageLocation = imageLocation self.text = text self.attributedString = nil super.init(direction: direction) commonInit() textLabel.text = text } init(image: UIImage, imageLocation: IconImageLocation, attributedString: NSAttributedString, direction: ToastDirection) { self.image = image self.imageLocation = imageLocation self.text = nil self.attributedString = attributedString super.init(direction: direction) commonInit() textLabel.attributedText = attributedString } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - Internal methods func commonInit() { contentView.addSubview(imageView) contentView.addSubview(textLabel) layout() } } // MARK: - Layout extension IconToastView { private func layout() { let titleEdgeInsets = appearance.titleEdgeInsets let imageEdgeInsets = appearance.imageEdgeInsets let imageViewTopConstant = imageEdgeInsets.top - imageEdgeInsets.bottom imageView.centerYAnchor.constraint(equalTo: textLabel.centerYAnchor, constant: imageViewTopConstant).isActive = true imageView.widthAnchor.constraint(equalToConstant: Const.imageSize.width).isActive = true imageView.heightAnchor.constraint(equalToConstant: Const.imageSize.height).isActive = true textLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: titleEdgeInsets.top).isActive = true textLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -titleEdgeInsets.bottom).isActive = true switch imageLocation { case .left: imageView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: imageEdgeInsets.left).isActive = true let textLabelLeftConstant = titleEdgeInsets.left + imageEdgeInsets.right textLabel.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: textLabelLeftConstant).isActive = true textLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -titleEdgeInsets.right).isActive = true case .right: imageView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -imageEdgeInsets.right).isActive = true let textLabelRightConstant = titleEdgeInsets.right + imageEdgeInsets.left textLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: titleEdgeInsets.left).isActive = true textLabel.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -textLabelRightConstant).isActive = true } } } ================================================ FILE: Sources/AwaitToast/Toasts/ToastView.swift ================================================ // // ToastView.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // import UIKit class ToastView: UIView where A: ToastAppearance { // MARK: - NSLayoutConstraints private var contentViewTop: NSLayoutConstraint? // MARK: - Properties let appearance: A = A.shared let direction: ToastDirection // MARK: - UI Components let contentView: UIView = { let view = UIView() return view }() // MARK: - Con(De)structor init(direction: ToastDirection) { self.direction = direction super.init(frame: .zero) backgroundColor = appearance.backgroundColor addSubview(contentView) layout() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } // MARK: - Layout extension ToastView { private func layout() { contentView.translatesAutoresizingMaskIntoConstraints = false contentView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true contentView.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true let topConstant: CGFloat let bottomConstant: CGFloat switch direction { case .top: topConstant = UIApplication.shared.statusBarFrame.size.height bottomConstant = 0 case .bottom: topConstant = 0 if #available(iOS 11.0, *), let window = UIApplication.shared.keyWindow { bottomConstant = window.safeAreaInsets.bottom } else { bottomConstant = 0 } } contentView.topAnchor.constraint(equalTo: topAnchor, constant: topConstant).isActive = true contentView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -bottomConstant).isActive = true } } ================================================ FILE: Sources/AwaitToast/Utils/GlobalConstants.swift ================================================ // // GlobalConstants.swift // AwaitToast // // Created by DongHeeKang on 01/04/2019. // Copyright © 2019 k-lpmg. All rights reserved. // public let AutomaticDimension: CGFloat = -1 ================================================ FILE: Sources/AwaitToast/Utils/GlobalFunction.swift ================================================ // // GlobalFunction.swift // AwaitToast // // Created by DongHeeKang on 28/02/2019. // Copyright © 2019 k-lpmg. All rights reserved. // func toastAbstractMethod(file: StaticString = #file, line: UInt = #line) -> Swift.Never { toastFatalError("Abstract method", file: file, line: line) } func toastFatalError(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) -> Swift.Never { fatalError(lastMessage(), file: file, line: line) }