Skip to content

Instantly share code, notes, and snippets.

@omochi
Created May 13, 2019 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omochi/ce2c38d5dc45b1727fcd55169b6370f2 to your computer and use it in GitHub Desktop.
Save omochi/ce2c38d5dc45b1727fcd55169b6370f2 to your computer and use it in GitHub Desktop.
// HogeLib.framework
public struct S {
public let a: Int
public let b: Int
}
// YourApp
extension S {
public mutating func setA(_ a: Int) {
self = S(a: a, b: b)
}
}
var s = S(a: 0, b: 0)
s.setA(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment