Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now building with Swift 5 and updated README.md #343

Merged
merged 7 commits into from
Apr 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
7 changes: 7 additions & 0 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
x.y.z Release Notes (yyyy-MM-dd)
=============================================================

2.4.1 Release Notes (2019-04-04)
=============================================================

## Added
- Swift 5.0 Support, by Oscar Gorog (@OkiRules)
- Updated README.md, by Oscar Gorog (@OkiRules)

2.4.0 Release Notes (2018-12-01)
=============================================================

Expand Down
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion CropViewController.podspec
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Pod::Spec.new do |s|
'TOCropViewControllerBundle' => ['Objective-C/TOCropViewController/**/*.lproj']
}
s.requires_arc = true
s.swift_version = '4.2'
s.swift_version = '5.0'
end
Empty file modified Gemfile
100644 → 100755
Empty file.
Empty file modified Gemfile.lock
100644 → 100755
Empty file.
Empty file modified ISSUE_TEMPLATE.md
100644 → 100755
Empty file.
Empty file modified Images/screenshot.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Images/screenshot2015.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Images/screenshot2016.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Images/screenshot2017.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Images/users.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropOverlayView.h
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropOverlayView.m
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropScrollView.h
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropScrollView.m
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropToolbar.h
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewController/Views/TOCropToolbar.m
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample-Extension/Info.plist
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/AppDelegate.h
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/AppDelegate.m
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/Info.plist
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/ViewController.h
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/ViewController.m
100644 → 100755
Empty file.
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/ar.lproj/Main.strings
100644 → 100755
Empty file.
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/fr.lproj/Main.strings
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/main.m
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerExample/tr.lproj/Main.strings
100644 → 100755
Empty file.
Empty file modified Objective-C/TOCropViewControllerTests/Info.plist
100644 → 100755
Empty file.
Empty file.
51 changes: 48 additions & 3 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,27 @@ func cropViewController(_ cropViewController: CropViewController, didCropToImage
```

### Making a Circular Cropped Image

#### Swift
```swift
func presentCropViewController() {
var image: UIImage? // Load an image
let cropViewController = CropViewController(croppingStyle: .circular, image: image)
cropViewController.delegate = self
self.present(cropViewController, animated: true, completion: nil)
}

func cropViewController(_ cropViewController: TOCropViewController?, didCropToCircularImage image: UIImage?, with cropRect: CGRect, angle: Int) {
// 'image' is the newly cropped, circular version of the original image
}
```


#### Objective-C
```objc
- (void)presentCropViewController
{
UIImage *image = ...; //Load an image
UIImage *image = ...; // Load an image

TOCropViewController *cropViewController = [[TOCropViewController alloc] initWithCroppingStyle:TOCropViewCroppingStyleCircular image:image];
cropViewController.delegate = self;
Expand All @@ -130,10 +147,22 @@ cropViewController.delegate = self;
```

### Sharing Cropped Images Via a Share Sheet

#### Swift
```swift
func presentCropViewController() {
var image: UIImage? // Load an image
let cropViewController = CropViewController(image: image)
cropViewController.showActivitySheetOnDone = true
self.present(cropViewController, animated: true, completion: nil)
}
```

#### Objective-C
```objc
- (void)presentCropViewController
{
UIImage *image = ...; //Load an image
UIImage *image = ...; // Load an image

TOCropViewController *cropViewController = [[TOCropViewController alloc] initWithImage:image];
cropViewController.showActivitySheetOnDone = YES;
Expand All @@ -144,8 +173,24 @@ cropViewController.delegate = self;
### Presenting With a Custom Animation
Optionally, `TOCropViewController` also supports a custom presentation animation where an already-visible copy of the image will zoom in to fill the screen.

#### Swift
```swift

func presentCropViewController() {
var image: UIImage? // Load an image
var imageView = UIImageView(image: image)
var frame: CGRect = view.convert(imageView.frame, to: view)

let cropViewController = CropViewController(image: image)
cropViewController.delegate = self
self.present(cropViewController, animated: true, completion: nil)
cropViewController.presentAnimated(fromParentViewController: self, fromFrame: frame, completion: nil)
}
```

#### Objective-C
```objc
- (void)presentViewController
- (void)presentCropViewController
{
UIImage *image = ...;
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
Expand Down
Empty file modified Swift/CropViewController/CropViewController.h
100644 → 100755
Empty file.
Empty file modified Swift/CropViewController/CropViewController.swift
100644 → 100755
Empty file.
Empty file modified Swift/CropViewController/Info.plist
100644 → 100755
Empty file.
Empty file modified Swift/CropViewControllerExample/AppDelegate.swift
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified Swift/CropViewControllerExample/Base.lproj/Main.storyboard
100644 → 100755
Empty file.
Empty file.
Empty file modified Swift/CropViewControllerExample/Info.plist
100644 → 100755
Empty file.
Empty file modified Swift/CropViewControllerExample/ViewController.swift
100644 → 100755
Empty file.
Empty file modified TOCropViewController.podspec
100644 → 100755
Empty file.
16 changes: 9 additions & 7 deletions TOCropViewControllerExample.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
};
buildConfigurationList = 223424651ABBC0CC00BBC2B1 /* Build configuration list for PBXProject "TOCropViewControllerExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -939,7 +939,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -969,7 +969,7 @@
PRODUCT_BUNDLE_IDENTIFIER = net.timoliver.TOCropViewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -1063,6 +1063,7 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "";
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -1112,6 +1113,7 @@
OTHER_LDFLAGS = "";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -1175,7 +1177,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "Swift/CropViewControllerExample/CropViewController-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -1201,7 +1203,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Swift/CropViewControllerExample/CropViewController-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down Expand Up @@ -1236,7 +1238,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1272,7 +1274,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified breakdown.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified buildkite/pipeline.release.yml
100644 → 100755
Empty file.
Empty file modified buildkite/pipeline.test.yml
100644 → 100755
Empty file.
Empty file modified fastlane/Fastfile
100644 → 100755
Empty file.