Merge branch 'master' of https://github.com/JakubMazur/TGPControls into JakubMazur-master
This commit is contained in:
commit
1005779c93
|
|
@ -49,6 +49,12 @@ Using [CocoaPods](http://cocoapods.org/?q=TGPControls)
|
||||||
- **iOS 10 and later down to iOS 8**: install CocoaPods 1.2.0+ [CocoaPods-Frameworks](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/), add `use_frameworks!` to your podfile.
|
- **iOS 10 and later down to iOS 8**: install CocoaPods 1.2.0+ [CocoaPods-Frameworks](http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/), add `use_frameworks!` to your podfile.
|
||||||
- **iOS 7**: Use TGPControls version 2.1.0
|
- **iOS 7**: Use TGPControls version 2.1.0
|
||||||
|
|
||||||
|
Using [Carthage](https://github.com/Carthage/Carthage)
|
||||||
|
```
|
||||||
|
github "SwiftArchitect/TGPControls"
|
||||||
|
```
|
||||||
|
Please note that Carthage is available only for **iOS 8 or higher**
|
||||||
|
|
||||||
Besides customization, which you can do entirely under Interface Builder in iOS 8 and later, both `TGPDiscreteSlider` and `TGPCamelLabels` require surprisingly little code to integrate.
|
Besides customization, which you can do entirely under Interface Builder in iOS 8 and later, both `TGPDiscreteSlider` and `TGPCamelLabels` require surprisingly little code to integrate.
|
||||||
|
|
||||||
### DiscreteSlider
|
### DiscreteSlider
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,6 @@
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
DC56BDFC1E46EA2000AAD0D9 = {
|
DC56BDFC1E46EA2000AAD0D9 = {
|
||||||
CreatedOnToolsVersion = 8.2.1;
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
DevelopmentTeam = 55K7THBUV8;
|
|
||||||
LastSwiftMigration = 0820;
|
LastSwiftMigration = 0820;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
};
|
};
|
||||||
|
|
@ -256,7 +255,7 @@
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = 55K7THBUV8;
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
|
@ -278,7 +277,7 @@
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = 55K7THBUV8;
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0820"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
|
||||||
|
BuildableName = "TGPControls.framework"
|
||||||
|
BlueprintName = "TGPControls"
|
||||||
|
ReferencedContainer = "container:TGPControls.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
|
||||||
|
BuildableName = "TGPControls.framework"
|
||||||
|
BlueprintName = "TGPControls"
|
||||||
|
ReferencedContainer = "container:TGPControls.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "DC56BDFC1E46EA2000AAD0D9"
|
||||||
|
BuildableName = "TGPControls.framework"
|
||||||
|
BlueprintName = "TGPControls"
|
||||||
|
ReferencedContainer = "container:TGPControls.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0</string>
|
<string>3.0.1</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBInspectable public var tickImage:String? = nil {
|
@IBInspectable public var tickImage:UIImage? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
layoutTrack()
|
layoutTrack()
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@IBInspectable public var trackImage:String? = nil {
|
@IBInspectable public var trackImage:UIImage? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
layoutTrack()
|
layoutTrack()
|
||||||
}
|
}
|
||||||
|
|
@ -339,8 +339,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
|
||||||
|
|
||||||
case .image:
|
case .image:
|
||||||
// Draw image if exists
|
// Draw image if exists
|
||||||
if let tickImage = tickImage,
|
if let image = tickImage,
|
||||||
let image = UIImage(named: tickImage),
|
|
||||||
let cgImage = image.cgImage,
|
let cgImage = image.cgImage,
|
||||||
let ctx = UIGraphicsGetCurrentContext() {
|
let ctx = UIGraphicsGetCurrentContext() {
|
||||||
let centered = CGRect(x: rectangle.origin.x + (rectangle.width/2) - (image.size.width/2),
|
let centered = CGRect(x: rectangle.origin.x + (rectangle.width/2) - (image.size.width/2),
|
||||||
|
|
@ -392,8 +391,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
|
||||||
trackLayer.frame = CGRect.zero
|
trackLayer.frame = CGRect.zero
|
||||||
|
|
||||||
// Draw image if exists
|
// Draw image if exists
|
||||||
if let trackImage = trackImage,
|
if let image = trackImage,
|
||||||
let image = UIImage(named: trackImage),
|
|
||||||
let cgImage = image.cgImage,
|
let cgImage = image.cgImage,
|
||||||
let ctx = UIGraphicsGetCurrentContext() {
|
let ctx = UIGraphicsGetCurrentContext() {
|
||||||
let centered = CGRect(x: (frame.width/2) - (image.size.width/2),
|
let centered = CGRect(x: (frame.width/2) - (image.size.width/2),
|
||||||
|
|
@ -531,8 +529,7 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
|
||||||
var trackSize = CGSize(width: frame.width - thumbWidth,
|
var trackSize = CGSize(width: frame.width - thumbWidth,
|
||||||
height: trackHeight)
|
height: trackHeight)
|
||||||
if(.image == trackComponentStyle) {
|
if(.image == trackComponentStyle) {
|
||||||
if let trackImage = trackImage,
|
if let image = trackImage {
|
||||||
let image = UIImage(named: trackImage) {
|
|
||||||
trackSize.width = image.size.width - thumbWidth
|
trackSize.width = image.size.width - thumbWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue