-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from didi/swift
sync
- Loading branch information
Showing
18 changed files
with
254 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Make sure to run `pod lib lint DoraemonKit.podspec' to ensure this is a | ||
# valid spec before submitting. | ||
# | ||
# Any lines starting with a # are optional, but their use is encouraged | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'DoraemonKit-Swift' | ||
s.version = '0.0.1' | ||
s.summary = 'iOS各式各样的工具集合' | ||
s.description = <<-DESC | ||
iOS各式各样的工具集合 Desc | ||
DESC | ||
|
||
s.homepage = 'https://github.com/didi/DoraemonKit' | ||
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' } | ||
s.author = { 'yixiang' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/didi/DoraemonKit.git', :tag => s.version.to_s } | ||
s.ios.deployment_target = '9.0' | ||
|
||
s.swift_versions = ['5', '5.1', '5.2'] | ||
|
||
|
||
s.default_subspec = 'Core' | ||
|
||
s.subspec 'Core' do |ss| | ||
ss.source_files = 'iOS/Swift/DoKitSwift/Src/**/*{.swift}' | ||
ss.resource_bundles = { | ||
'DoKitSwift' => 'iOS/DoraemonKit/Resource/**/*' | ||
} | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
iOS/Swift/DoKitSwift/Src/Plugins/Base/DoKitBasePlugin.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// DoKitBasePlugin.swift | ||
// AFNetworking | ||
// | ||
// Created by didi on 2020/5/26. | ||
// | ||
|
||
import UIKit | ||
|
||
public protocol Plugin { | ||
var module: String{get} | ||
var title: String{get} | ||
var icon: UIImage?{get} | ||
func didLoad() | ||
} | ||
|
||
struct DefaultPlugin: Plugin { | ||
var module: String | ||
var title: String | ||
var icon: UIImage? | ||
var callBack:()->Void | ||
|
||
func didLoad() { | ||
self.callBack() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
iOS/Swift/DoKitSwift/Src/Plugins/Common/MainThreadChecker/DoKitMainThreadCheckerPlugin.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// DoKitMainThreadCheckerPlugin.swift | ||
// DoraemonKit | ||
// | ||
// Created by 邓锋 on 2020/5/28. | ||
// | ||
|
||
import Foundation | ||
|
||
struct DoKitMainThreadCheckerPlugin: Plugin{ | ||
var module: String { | ||
return DoKitLocalizedString("常用工具") | ||
} | ||
|
||
var title: String { | ||
return DoKitLocalizedString("子线程UI") | ||
} | ||
|
||
var icon: UIImage? { | ||
return UIImage.dokitImageNamed(name: "doraemon_ui") | ||
} | ||
|
||
func didLoad() { | ||
let vc = DoKitMainThreadCheckerViewController() | ||
DoKitHomeWindow.shared.openPlugin(vc: vc) | ||
} | ||
} |
Oops, something went wrong.