Skip to content

Commit

Permalink
Merge branch 'release/0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
kof.kofktu committed Sep 5, 2017
2 parents 88c620d + db82e5d commit c2c0433
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 33 deletions.
52 changes: 27 additions & 25 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
objects = {

/* Begin PBXBuildFile section */
C3655DAA1F5E3E900070E243 /* KUIPopOver.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3655DA91F5E3E890070E243 /* KUIPopOver.framework */; };
C3655DAB1F5E3E900070E243 /* KUIPopOver.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C3655DA91F5E3E890070E243 /* KUIPopOver.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C39F320E1F57E56E00B5F269 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39F320D1F57E56E00B5F269 /* AppDelegate.swift */; };
C39F32101F57E56E00B5F269 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39F320F1F57E56E00B5F269 /* ViewController.swift */; };
C39F32131F57E56E00B5F269 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C39F32111F57E56E00B5F269 /* Main.storyboard */; };
C39F32151F57E56E00B5F269 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C39F32141F57E56E00B5F269 /* Assets.xcassets */; };
C39F32181F57E56E00B5F269 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C39F32161F57E56E00B5F269 /* LaunchScreen.storyboard */; };
C39F32251F57E5C200B5F269 /* KUIPopOver.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C39F32241F57E57700B5F269 /* KUIPopOver.framework */; };
C39F32261F57E5C200B5F269 /* KUIPopOver.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C39F32241F57E57700B5F269 /* KUIPopOver.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
C39F32231F57E57700B5F269 /* PBXContainerItemProxy */ = {
C3655DA81F5E3E890070E243 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C39F321F1F57E57600B5F269 /* KUIPopOver.xcodeproj */;
containerPortal = C3655DA41F5E3E890070E243 /* KUIPopOver.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C39F31F61F57E55F00B5F269;
remoteInfo = KUIPopOver;
};
C39F32271F57E5C200B5F269 /* PBXContainerItemProxy */ = {
C3655DAC1F5E3E900070E243 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C39F321F1F57E57600B5F269 /* KUIPopOver.xcodeproj */;
containerPortal = C3655DA41F5E3E890070E243 /* KUIPopOver.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = C39F31F51F57E55F00B5F269;
remoteInfo = KUIPopOver;
Expand All @@ -40,40 +40,48 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
C39F32261F57E5C200B5F269 /* KUIPopOver.framework in Embed Frameworks */,
C3655DAB1F5E3E900070E243 /* KUIPopOver.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
C3655DA41F5E3E890070E243 /* KUIPopOver.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = KUIPopOver.xcodeproj; path = ../KUIPopOver.xcodeproj; sourceTree = "<group>"; };
C39F320A1F57E56E00B5F269 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
C39F320D1F57E56E00B5F269 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C39F320F1F57E56E00B5F269 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C39F32121F57E56E00B5F269 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
C39F32141F57E56E00B5F269 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C39F32171F57E56E00B5F269 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
C39F32191F57E56E00B5F269 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C39F321F1F57E57600B5F269 /* KUIPopOver.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = KUIPopOver.xcodeproj; path = ../KUIPopOver/KUIPopOver.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
C39F32071F57E56E00B5F269 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C39F32251F57E5C200B5F269 /* KUIPopOver.framework in Frameworks */,
C3655DAA1F5E3E900070E243 /* KUIPopOver.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
C3655DA51F5E3E890070E243 /* Products */ = {
isa = PBXGroup;
children = (
C3655DA91F5E3E890070E243 /* KUIPopOver.framework */,
);
name = Products;
sourceTree = "<group>";
};
C39F32011F57E56E00B5F269 = {
isa = PBXGroup;
children = (
C39F321F1F57E57600B5F269 /* KUIPopOver.xcodeproj */,
C3655DA41F5E3E890070E243 /* KUIPopOver.xcodeproj */,
C39F320C1F57E56E00B5F269 /* Example */,
C39F320B1F57E56E00B5F269 /* Products */,
);
Expand All @@ -100,14 +108,6 @@
path = Example;
sourceTree = "<group>";
};
C39F32201F57E57600B5F269 /* Products */ = {
isa = PBXGroup;
children = (
C39F32241F57E57700B5F269 /* KUIPopOver.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -123,7 +123,7 @@
buildRules = (
);
dependencies = (
C39F32281F57E5C200B5F269 /* PBXTargetDependency */,
C3655DAD1F5E3E900070E243 /* PBXTargetDependency */,
);
name = Example;
productName = Example;
Expand Down Expand Up @@ -160,8 +160,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = C39F32201F57E57600B5F269 /* Products */;
ProjectRef = C39F321F1F57E57600B5F269 /* KUIPopOver.xcodeproj */;
ProductGroup = C3655DA51F5E3E890070E243 /* Products */;
ProjectRef = C3655DA41F5E3E890070E243 /* KUIPopOver.xcodeproj */;
},
);
projectRoot = "";
Expand All @@ -172,11 +172,11 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
C39F32241F57E57700B5F269 /* KUIPopOver.framework */ = {
C3655DA91F5E3E890070E243 /* KUIPopOver.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = KUIPopOver.framework;
remoteRef = C39F32231F57E57700B5F269 /* PBXContainerItemProxy */;
remoteRef = C3655DA81F5E3E890070E243 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
Expand Down Expand Up @@ -207,10 +207,10 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
C39F32281F57E5C200B5F269 /* PBXTargetDependency */ = {
C3655DAD1F5E3E900070E243 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = KUIPopOver;
targetProxy = C39F32271F57E5C200B5F269 /* PBXContainerItemProxy */;
targetProxy = C3655DAC1F5E3E900070E243 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

Expand Down Expand Up @@ -330,6 +330,7 @@
C39F321D1F57E56E00B5F269 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = KLVLNTBFM4;
INFOPLIST_FILE = Example/Info.plist;
Expand All @@ -344,6 +345,7 @@
C39F321E1F57E56E00B5F269 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = KLVLNTBFM4;
INFOPLIST_FILE = Example/Info.plist;
Expand Down
2 changes: 1 addition & 1 deletion KUIPopOver.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "KUIPopOver"
s.version = "0.0.1"
s.version = "0.0.2"
s.summary = "Easy to use PopOver in iOS"

# This description is used to generate tags and improve search results.
Expand Down
15 changes: 9 additions & 6 deletions KUIPopOver/Classes/KUIPopOver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ extension KUIPopOverUsable where Self: UIViewController {
return UIApplication.shared.keyWindow?.rootViewController?.topPresentedViewController
}

private var popOverUsableNavigationController: KUIPopOverUsableNavigationController {
let naviController = KUIPopOverUsableNavigationController(rootViewController: self)
naviController.modalPresentationStyle = .popover
naviController.popoverPresentationController?.delegate = KUIPopOverDelegation.shared
return naviController
}

private func setup() {
modalPresentationStyle = .popover
preferredContentSize = contentSize
Expand All @@ -64,9 +71,7 @@ extension KUIPopOverUsable where Self: UIViewController {
}

public func showPopover(withNavigationController sourceView: UIView, sourceRect: CGRect) {
let naviController = KUIPopOverUsableNavigationController(rootViewController: self)
naviController.modalPresentationStyle = .popover
naviController.popoverPresentationController?.delegate = KUIPopOverDelegation.shared
let naviController = popOverUsableNavigationController
naviController.popoverPresentationController?.sourceView = sourceView
naviController.popoverPresentationController?.sourceRect = sourceRect
rootViewController?.present(naviController, animated: true, completion: nil)
Expand All @@ -78,9 +83,7 @@ extension KUIPopOverUsable where Self: UIViewController {
}

public func showPopover(withNavigationController barButtonItem: UIBarButtonItem) {
let naviController = KUIPopOverUsableNavigationController(rootViewController: self)
naviController.modalPresentationStyle = .popover
naviController.popoverPresentationController?.delegate = KUIPopOverDelegation.shared
let naviController = popOverUsableNavigationController
naviController.popoverPresentationController?.barButtonItem = barButtonItem
rootViewController?.present(naviController, animated: true, completion: nil)
}
Expand Down
9 changes: 9 additions & 0 deletions KUIPopOver/Classes/KUIPopOverUsable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ public protocol KUIPopOverUsable {

var contentSize: CGSize { get }
var contentView: UIView { get }
var arrowDirection: UIPopoverArrowDirection { get }

}

extension KUIPopOverUsable {

public var arrowDirection: UIPopoverArrowDirection {
return .any
}

}
2 changes: 1 addition & 1 deletion KUIPopOver/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<string>0.0.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,26 @@ github "Kofktu/KUIPopOver"

## Usage

#### Before

```swift
let popOverViewController = DefaultPopOverViewController()
popOverViewController.preferredContentSize = CGSize(width: 200.0, height: 300.0)
popOverViewController.popoverPresentationController?.sourceView = sender

let customView = CustomPopOverView(frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: 200.0, height: 300.0)))
popOverViewController.view.addSubview(customView)
popOverViewController.popoverPresentationController?.sourceRect = sender.bounds
present(popOverViewController, animated: true, completion: nil)
```

#### KUIPopOverUsable

```swift
public protocol KUIPopOverUsable {
var contentSize: CGSize { get }
var contentView: UIView { get }
var arrowDirection: UIPopoverArrowDirection { get }
}

```
Expand Down

0 comments on commit c2c0433

Please sign in to comment.